2008-04-09

Linux EeePC and Windows Mobile: Internet Sharing


(This article was written with the help of this article here.)

So, you got your EeePC. You already own a Windows Mobile device. You want to use the Internet connection of your device to surf on your EeePC? No problem, most of the things you need are already installed on your 3E. Here is a step-by-step howto:

1) Install the GPRS Configuration Utility. This will work with Nokia devices and maybe others, but not with Windows Mobile. Windows Mobile does not provide the same Bluetooth profile as Nokia. Windows Mobile uses PAN for internet sharing. We only need the GPRS Configuration Utility as a handy GUI for pairing the WM device with the 3E. So install the Utility and follow the instruction there and on the screen. The Utility will tell you that you can now use GPRS, but this is wrong. After pairing, the 3E should be in the list of paired bluetooth devices on your WM device. Internet will not work, yet.

2) Start the terminal on your 3E (Crtl+Alt+T) and become root (type "sudo su").

3) Enable PAN on the 3E: "nano /etc/default/bluetooth". Find the line with the PAND_ENABLED option. Change the option to 1 (=enabled). Save the file, quit nano. Restart bluetooth: "/etc/init.d/bluetooth restart"

4) Open your network interface configuration file ("nano /etc/network/interfaces") and add another interface: "iface bnep0 inet dhcp". Save the file, quit nano. Restart the network on the 3E: "/etc/init.d/networking restart"

5) Find the mac address of your WM device. Put the device into discovery mode and type "hcitool scan" on your 3E. You will get a list with at least your WM device and its bluetooth address.

6) Start the "Internet Sharing" application on your WM device.

7) Connect your 3E to your WM device: "pand -c <mac_address_from_step_5> -e bnep0"

8) Bring up the network interface on your 3E: "ifup bnep0"


Start browsing! It took me some hours and configuration to get the connection, so I don't really know if this is REALLY enough to get everything together. The steps are more or less a condensate of what I did and what I think is necessary for bluetooth on Linux. So please comment and tell me what your 3E doesn't like about this.

8 comments:

helkyrie said...

Hi there

thanks for a good clear guide... but I can't get it to work.

i get all the way through the instructions, but still only get two choices of network in the end: lan or wireless, no new bluetooth connection. Thinking that the LAN option might be the bluetooth in disguise, I try to connect, but every time I get the following message:

Setting lan2 interface ath0 metric to 10
Listening on LPF/eth0/00:1f:c6:05:ab:5d
Sending on LPF/eth0/00:1f:c6:05:ab:5d
Sending on Socket/fallback
DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 4
DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 11
DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 16
No DHCPOFFERS received.
No working leases in persistent database - sleeping.
Setting lan2 interface ath0 metric to 10
run-parts --verbose /etc/network/if-up.d
Setting lan2 interface ath0 metric to 10

I'm a total newbie, so no idea where to start.

TIA for any help you can provide!

Cheers

Helen

bigbloke said...

Hi,

I also cannot get this procedure to work with my HTC TyTN .

everything is ok up until the point of ifup bnep0

which returns:

siocsifaddr:no such device
bnep0: ERROR while getting device interface flags: No such device

and repeats this error again

perhaps its a missing /etc/init.d/network restart ??

Schuss

BB

Dicko said...

I think there are a couple of steps missing.

Firstly, (certainly on the PC 900) bnep is not part of the kernel and needs to be loaded first. "modprobe bnep".

Secondly when you edit /etc/default/bluetooth you need to set PAND_OPTIONS to something. PAND_OPTIONS="--listen --role PANU" worked for me.

Then just follow the guide. Worked for me with an HTC S710.

peterbouda said...

@dicko:
thanks for the instructions.

The modprobe is not necessary on my EeePC 701, I found a line in /etc/modprobe.d/aliases:

alias bt-proto-4 bnep

Maybe that is missing on the 900?

I checked my default /etc/bluetooth/default and in fact I added a similar line there. Your line works for me, too. I will update the instructions soon.

@helkyrie:
The bluetooth connections does not show up in the standard Eee network connections. The connection should be establish as soon as you fire the "ifup" command.

Anonymous said...

Thanks for putting this up. I finally got this running.

In order to make this more user friendly I was trying to write a script to automate steps 8 and 9. I am really new at this but I wrote the following:

#!/bin/sh
sudo su -
pand -c 00:1B:98:BF:CF:CF -e bnep0
ifup bnep0

When I run this script it disconnects the phone internet connection. The message on the Internet Sharing screen goes from telling me to set up my PC's PAN to disconnected.

If I copy and paste each line in the script to the console it works fine. I am probably forgetting something really obvious. Any help would be appreciated.

FPH said...

assuming your bt phone is paired, put that in your /etc/network/interfaces (check if lan5 is unused)

This allows PAN connection trough the GUI. It works (don't trust the error msg).


iface lan5 inet manual
down dhclient3 -r -pf /var/run/dhclient.bnep0.pid -lf /var/run/dhclient.bnep0.leases bnep0
down ifconfig bnep0 down
up pand -e bnep0 --search
up ifconfig bnep0 up
up dhclient3 -cf /etc/dhcp3/dhclient.$LOGICAL.conf -pf /var/run/dhclient.bnep0.pid -lf /var/run/dhclient.bnep0.leases bnep0

Anonymous said...

I don't have internet sharing in my HTC Torndo:(

Anonymous said...

Great blog you got here. I'd like to read more about this theme. The only thing that blog needs is some pictures of any devices.
Katherine Watcerson
Cell phone jammer