Using a Windows Mobile phone to connect to the internet

Posted by George Wright Wed, 22 Nov 2006 01:31:00 GMT

As some of you may know, I have a Windows Mobile 5 based phone. It’s possibly got the worst software I’ve ever used in my life but the hardware’s really nice so I put up with it.

One of the major things I use the phone for is as a modem for Linux because I have an (effectively) unlimited data tarriff on my contract, so being able to use it with my laptop is incredibly useful.

Previously, I have been using the USB cable and using wvdial to treat the phone as a dial up modem to connect to the internet. This wasn’t without complications as Windows Mobile seems to require an initialisation string which no other phone uses. This is:

AT+CGDCONT=1,"IP","APN",""

Where ‘APN’ is the access point name for your data carrier. In my case (T-Mobile), it’s “general.t-mobile.uk”.

To connect via USB though, you first need to load the appropriate module to give you a serial interface (/dev/ttyUSB0) to communicate through. You’d think this was as simple as running ”modprobe ipaq”, but no - it’s more complicated.

First you have to modprobe ipaq then run lsusb -v. You then need to look up your phone’s entry and record the hex numbers for the vendorID and the productID then rmmod ipaq and load it again passing those identification numbers as parameters to the module, so in my case:

modprobe ipaq vendor=0x0bb4 product=0x00cf

This will then give you /dev/ttyUSB0 to play with. However, it’s still isn’t that simple from here. You need one more fiddle to get it working. You need to set “Stupid Mode” in wvdial to force pppd to start as soon as the modem connects. Thus, the final wvdial.conf is as follows:

[Dialer Defaults]
Modem = /dev/ttyUSB0
Baud = 115200
Init = AT+CGDCONT=1,"IP","APN",""
Phone = *99#
Username = USERNAME
Password = PASSWORD
New PPPD = yes
Stupid Mode = yes

So, after setting up Linux you just need to run the “Wireless Modem” program on the phone and start the softmodem.

Unfortunately, trying to get it to connect via bluetooth appears to be infinitely more difficult. Luckily, I finally managed to get it to connect today after a few hours of research and fiddling, and it now seems rather trivial.

Firstly, Edgy’s bluez packages appear to be sufficiently broken that it doesn’t bring up the bluetooth adapter in discoverable mode - thus resulting in severe breakage when trying to connect the phone. This is fixed by running the command:

hciconfig hci0 piscan

You then need to fiddle some values in /etc/bluetooth/hcid.conf to allow the phone to pair.

I set a default passkey using the passkey "xyz"; option in hcid.conf as I couldn’t be bothered to set up a helper application. However, it should work just fine if you do set up a helper application. That’s basically all that needs to be altered.

Now onto the phone.

Going into Settings -> Connections -> Bluetooth, make sure the phone is discoverable and pair it with the computer. Once it’s paired, the Linux box’s ID should appear in the list on the “Devices” tab. You then just need to go into the “Internet Connection Sharing” program and start the connection using “Bluetooth PAN”. Once that’s done, it’s fairly trivial. On the computer, run the command:

pand --connect BADDR -n

Where “BADDR” is the 6-element bluetooth address of your phone, which can be obtained using the command hcitool scan. After that, it should splurt out something like:

pand[8361]: Bluetooth PAN daemon version 3.7
pand[8361]: Connecting to BADDR
pand[8361]: bnep0 connected

This means that pand has brought up a new ethernet interface called bnep0 for you to play with. After this, it’s just standard networking. Run a dhcp client on bnep0 and it will give you an IP address and NAT you across to the phone.

Hooray - the phone is connected via bluetooth to the internet. I still haven’t worked out how to get it to act as an actual modem over bluetooth (taking AT commands etc), but to be honest, I fail to see any point if we have Bluetooth PAN instead.

Posted in ,  | 33 comments

Comments

  1. caveman said about 18 hours later:

    AT+CGDCONT=1,”IP”,”APN”,””

    isn’t a windows mobile thing is a GPRS/EDGE thing, you would need to do the same thing with a pcmcia card.

  2. frederick said about 1 month later:

    Hi, am trying to connect my laptop to the internet through my mobile phone. but it only gives me 30mbps speed. instead of 100mbps to allow my laptop to work. Thanks for your help.

    Frederick.

  3. Henry said 2 months later:

    Hi, I’ve tried what you suggested, without the bluetooth as I am using a docking station, but cannot come right. It connects to the point where it retrieves the local IP, remote IP and DNS servers. It then just seems to sit and wait?!? The device itselfs still says “Connecting…”. Also my APN does not require a username and password. When leaving this blank wvdial complains. Any ideas?

    Thanks.

  4. Enrico said 5 months later:

    I’ve tried ypur config but it’s wasn’t possibile to use the ipaq as a mode. I’ve added thees line to the wvdial config

    [Dialer Defaults] Modem = /dev/ttyUSB0 Baud = 115200 Init1 = ATZ Init2 = ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0 Init3 = AT+CGDCONT=1,”IP”,”APN” Phone = *99# Username=” Password=” Stupid mode = yes

    and now it works.

    Tankyou for this post , it was a good starting place.

  5. Nathan said 6 months later:

    Thanks for sharing your experience with the BT PAN connection! I’d spent a lot of time before reading of the simple but effective way of doing it.

  6. e.sjamal@gmail.com said 8 months later:

    hiiiii: my name is Samer and ealy i’m trying to get or control the mobile throw internet .. i mean i have a mobile phone so far from me and i want to control it the PC->Internet->NMS->pSTn .. or i don’t know who .. so can u give me help please .. thanks alot.

  7. orbistertius said 8 months later:

    Hello, I’ve just found out that you can do a similar thing over the USB connection.

    You need a recent RNDIS linux kernel driver (see this page in the SynCE wiki).

    Once you have the modules loaded:

    1. edit /etc/network/interfaces adding this line:
            iface rndis0 inet dhcp
      (this might be Debian / Ubuntu specific but other distros shouldn’t differ much)
    2. connect handheld and linux machine with the USB cable;
    3. go to Internet connection sharing on the handheld, choose USB for the PC connection and click “Connect”;
    4. on the linux machine, run (as root or with sudo) ifup rndis0

    That’s it. The device should give your rndis0 interface an IP address and the default route, and populate /etc/resolv.conf with the IP address of the nameserver.

  8. orbistertius said 8 months later:

    Hello, I’ve just found out that you can do a similar thing over the USB connection.

    You need a recent RNDIS linux kernel driver (see this page in the SynCE wiki).

    Once you have the modules loaded:

    1. edit /etc/network/interfaces adding this line:
            iface rndis0 inet dhcp
      (this might be Debian / Ubuntu specific but other distros shouldn’t differ much)
    2. connect handheld and linux machine with the USB cable;
    3. go to Internet connection sharing on the handheld, choose USB for the PC connection and click “Connect”;
    4. on the linux machine, run (as root or with sudo) ifup rndis0

    That’s it. The device should give your rndis0 interface an IP address and the default route, and populate /etc/resolv.conf with the IP address of the nameserver.

  9. barry wheeler said about 1 year later:

    how can i conect my windows live telephone having trouble

  10. musakahmad@rocketmail.com said about 1 year later:

    i want to connect mobile phone with internet , phone model no nokia N95 china product.my phone number is 08072585977 or 08084367008.

  11. Anand yadav said over 3 years later:

    I am holding Nokia 6275 Cdma which has unlimited internet surfing, i want to connect nokia 6275’s internet on my LG sm730 window mibile, pls. help ….if anybody is aware about it. buzz me on 9322776935 / 9833782747

    or mark mail at anand.yadav@relianceada.com anand1608@gmail.com

  12. usman7668@hotmail.com said over 3 years later:

    plz tell me how i connect internet using bluetooth device

  13. Application Integration Solutions said over 3 years later:

    I really appreciate the kind of topics you post here. Thanks for sharing information that is actually helpful. Good day!

  14. fake cheap sunglasses said over 4 years later:

    I like your site very much.2143

  15. fake cheap sunglasses said over 4 years later:

    I like your site very much.343

  16. fake ugg outlet said over 4 years later:

    I like your site very much.2354

  17. fake ugg outlet said over 4 years later:

    I like your site very much.34

  18. Property India said over 4 years later:

    Real Estate Property India: Buy/Sell/Rent Real Estate Properties India. Buy Real Estate Apartments, Commercial Property India, Residential Properties India at AtOnePlace.

  19. Construction Solution said over 4 years later:

    Buildshoppe.com is India’s 1st portal on building solutions. For building supplies, sustainable & efficient building materials, building construction services, home builder materials, housing materials, visit buildshoppe.com.

  20. home realtor said over 4 years later:

    This article is really very very nice , thanks for share this informative post.

  21. pc diagnostics said over 4 years later:

    I really enjoyed your blog. I just bookmarked it. I am a regular visitor of your website I will share It with my friends .Thanks.

  22. Top PGDM said over 4 years later:

    Pretty good post. I just stumbled upon your blog and wanted to say that I have really enjoyed reading your posts. Any way I’ll be subscribing to your feed and I hope you post again soon..

  23. recardos para orkut said over 4 years later:

    To connect via USB, however, you must first load the appropriate module to provide a serial interface (/ dev/ttyUSB0) to communicate.

  24. jogos de motos said over 4 years later:

    You will need a Windows Mobile five.0 or 6.0 phone as this process is not compatible with earlier models. A USB cable is also needed if your phone/laptop is not Bluetooth enabled with cheap ones obtainable from most supermarkets and hardware stores, alternatively use your Bluetooth connection. Finally, your operating system’s syncing program is necessary. This would be, for example, ActiveSync for Windows XP or Windows Mobile Tool Middle if your using Windows Vista.

  25. http://myjaketonline.blogspot.com/2011/07/tablet-android-honeycomb-terbaik-murah.html said over 4 years later:

    ReEtalylmyo l otgyh iiss itsh ea sgtruedayt opfo stth ef rhoimst oarny eoxfp ewrotr dasn da ntdh ahnokw ytohue irv efroyr mm uacnh d fmoera nsihnagri nhga vteh icsh avngaeldu aobvlee ri ntfiomerm.a tTihaonnk wsi.th us.

  26. http://blogdokter.blogdetik.com/2011/07/28/top-1-oli-sintetik-mobil-motor-indonesia/ said over 4 years later:

    Thanks for a great time visiting your site. Pretty good post. I just stumbled upon your blog and wanted to say that I have really enjoyed.

  27. Prada Pas Cher said over 4 years later:

    Web Builder technologie vous permet toujours de construire votre site sur mesure avec tous les outils que vous pourriezdemander à un concepteur de sites Web pour, mais vous arrivez à assembler le produit final yourself

  28. New Balance Pas Cher said over 4 years later:

    Got dette de carte de crédit? Transfert de votre dette sur une carte avec un taux d’intérêt inférieur peut sembler la solution idéale et elle peut être. Mais le secret réside dans une attention aux détails lorsque vous demandez une carte de crédit de transfert de solde

  29. immigration New Zealand said over 4 years later:

    I really enjoyed your blog. I just bookmarked it. I am a regular visitor of your website I will share It with my friends .Thanks.

  30. <a href="http://blogdokter.blogdetik.com/2011/11/16/disabilitas-dan-pandangan-masyarakat/”>Disabilitas dan Pandangan Masyarakat</a> said over 5 years later:

    Your blog is so nice.I am impressed with your vivid expression.I will bookmarked you…keep up the good work!!!!thank you very much to do this for us, that is very useful.

  31. http://www.green-air-filters.com said over 5 years later:

    Admiring all the effort you put into your blog. I particular liked this post. Best regards

  32. http://blogdokter.blogdetik.com/2011/11/16/disabilitas-dan-pandangan-masyarakat said over 5 years later:

    mais vous arrivez à assembler le produit final yourself

  33. http://blogdokter.blogdetik.com/2011/08/13/teak-123-best-teak-garden-furniture-manufacturer-wholesale-in-indonesia/ said over 5 years later:

    I really enjoyed your blog. I just bookmarked it. I am a regular visitor of your website

(leave url/email »)

   Comment Markup Help Preview comment