Using Bluetooth PAN profile to share GPRS/UMTS connection »

Sunday, 15 April 2007 | Linux; Windows Mobile | Dawid Lorenz

After upgrading my MDA Vario II mobile phone to the latest Windows Mobile 6 OS, I have somehow lost ability to create rfcomm device over Bluetooth. I’ve been to lazy to resolve that problem, but I wasn’t lazy enough to find out how to use new WM6’s feature, which is internet connection sharing via Bluetooth PAN profile. It turned out to be quite easy and straightforward task. Read on.

The most comprehensive source of knowledge about Bluetooth PAN under Linux is hidden in one single HOWTO file. However, in this case, I will use only a little part of that knowledge.

First of all, we need to create ifcfg-bnep0 file in /etc/sysconfig/network-scripts directory:

DEVICE=bnep0
BOOTPROTO=dhcp
ONBOOT=no
TYPE=Ethernet
USERCTL=yes
IPV6INIT=no
PEERDNS=yes

This file creates new network device, which is somehow ‘virtual’, as it does not exist until connection with BT PAN profile would be established later on. Next, we need to set up internet connection sharing on WM6 device, by tapping Start -> Programs -> Internet Sharing. Choose Bluetooth PAN as PC Connection, and your preferred Network Connection (which usually is set up to connect with your mobile operator). Then tap Connect. Mobile phone should now establish GPRS/UMTS connection, and await for connections from computer.

Ok, mobile is ready to accept PAN connection, so.. let’s create connection. :) Execute following command:

pand --role PANU --search --service NAP

It will start PAN daemon, which will act as PAN User (–role PANU), and search for Bluetooth devices serving as Network Access Points (–search –service NAP). Searching for BT devices usually takes few seconds, but once pand finds appropriate device, connection is established quickly. On the other hand, if we know physical address of mobile’s BT adapter, following command will establish connection straight away:

pand --role PANU --connect xx:xx:xx:xx:xx:xx

Where xx:xx:xx:xx:xx:xx is device’s address. If something goes wrong, check out system log (/var/log/messages), as all pand output goes right there.

After successful connection, mentioned before bnep0 network device should be automatically brought up with IP address assigned by DHCP. Once IP address is assigned, internet is in place! How cool is that? :)

Making life easier

I haven’t found any GUI interfaces for managing PAN connections, so again command line is always your best friend. However, there is possibility to make PAN connections slightly easier. As pand is regular system daemon, which could be controlled by System -> Administration -> Server settings -> Services GUI, we can start/stop it from there. Additional daemon parameters are saved in /etc/sysconfig/pand file:

#add any pand aguments you like, for example:
PANDARGS='--role PANU --search --service NAP'

Starting service from GUI (or - maybe even faster - from root terminal: service pand start), will pick up arguments stored in PANDARGS variable automatically. Just like that.

Related

Bluetooth PAN HOWTO - I think the best HOWTO regarding BT PAN. If you want to fiddle around, try different configurations or daemon parameters - you just MUST read it.

Appendix

Microsoft developers revealed reasons why WM6-powered devices are no longer acting as Dial-Up Networking modems over Bluetooth. Read on:
http://msmobiles.com/news.php/6260.html
and
http://blogs.msdn.com/windowsmobile/archive/2007/04/17/why-did-we-remove-bluetooth-dun.aspx

Comments:

  1. scaine
    Wednesday, 20 February 2008 @ 23:38

    Just a quick note - I’m using Ubuntu 7.10 on my Eee PC here and I’ve just bought a nano USB from Amazon. Thanks for the heads-up on using PAN - I’d been trying for the past two nights to get my MDA Vario II working with rfcomm and DUN.

    Anyway, the reason for the post - try out BlueMan when you get a chance. It’s an excellent, very slick looking GUI tool for just about any type of bluetooth service you could imagine. I’d been using it for DUN over serial (via Bluetooth), but when I read your guide on PAN, sure enough, you just go into Blueman’s services page and enable Network instead - click the add button, choose your device, then select from the real time populated list of services advertised via that device.

    I was connected to the internet through my T-Mobile 3G service in seconds and never saw the command line once.

    Makes a pleasant change that Ubuntu’s GUI tools outstrip the best that windows has to offer.

  2. Dawid Lorenz
    Thursday, 21 February 2008 @ 00:00

    Thanks for that tip - I’ll check BlueMan out soon.

    UPDATE: I’ve just installed BlueMan from the source, and… it’s really great! Thanks for that suggestion :)

  3. Jason
    Monday, 3 March 2008 @ 19:21

    Thanks for the info, will have to try it when I get home. Once connected via bluetooth does a WM6 Wizard allow you to sync Outlook contacts and calendar items with Evolution or Korganizer?

  4. Dawid Lorenz
    Monday, 3 March 2008 @ 19:38

    I never tried sync with Evolution, or anything. I mean I tried, but never succeeded.

  5. Tristan
    Monday, 7 July 2008 @ 06:34

    Genius,

    Thanks so much for this, been using my “Internet Sharing” on Windows as I couldn’t get it going on Linux!!

    Did this with an XDA Trion (HTC Hermes) running Windows Mobile 6 and a Centrino laptop running Ubuntu Heron.

    Thanks again!

    Tristan.

  6. wilq
    Monday, 3 November 2008 @ 13:12

    hi… it’s very interesting an accurate howto for wm5/6 users… u helped me a lot!!!… (miło spotkać fajny poradnik)

  7. Macro_hard
    Saturday, 27 December 2008 @ 08:47

    Thanks for the info, I’ve not tried this but it seems it’ll work.
    What about Symbian OS(fp2 upwards)? Any one with information about ICS using bluetooth or USB cable.

  8. SafeTinspector
    Wednesday, 14 January 2009 @ 11:35

    The new-fangled NetworkManager in OpenSUSE 11.1 doesn’t seem to get along with this at all.
    Either that or my HTC touch doesn’t get along with this at all.
    I can do the HCITOOL scan, and the SDPTOOL search, and I get no errors when running the PAND commands, and I’ve manually created that bnep0 interface in /etc/sysconfig/networks, but no dice.
    ifup bnep0 (which I guess is supposed to be unnecessary) gave a message that networkmanager would be advised of my interest in bnep0 but that I have no guarantee it will do anything for me.
    ifconfig shows no bnep0 device.

    *sigh*

    I could ditch Network Manager, but it is far too handy for WiFi and VPNs….

  9. Dawid Lorenz
    Wednesday, 14 January 2009 @ 11:37

    SafeTinspector: I don’t think method described in this post plays nicely with NetworkManager (or rather other way around), so I’d suggest disabling NM and then trying again.

  10. Tuscho
    Thursday, 5 February 2009 @ 22:51

    I’ve done all steps above, bnep was found using ifconfig and ifup….

    I just don’t understood, if after execute the ” pand –role PANU –connect xx:xx:xx…” command, the internet itself would came up…. or i must configure a gateway or something like that?

    tanks

  11. Tuscho
    Friday, 6 February 2009 @ 10:00

    Another question: my network manager is currently running on Suse 10.3… How to disable it?

    tanks!

  12. Dawid Lorenz
    Friday, 6 February 2009 @ 10:05

    Tuscho:
    [root@m4300 ~]# /etc/init.d/NetworkManager stop

  13. Tuscho
    Saturday, 7 February 2009 @ 12:29

    the “NetworkManager” doesn’t exists in init.d

    The only one that i[ve found is “network”

    This inidicates that i don’t have a Network Manager running?

    Tanks

Anything to say?

  • buy generic viagra
  • buy cialis from canada
  • price of acomplia
  • buy synthroid without prescription
  • synthroid online cheap
  • cialis from india
  • viagra order
  • accutane generic
  • cheapest levitra prices
  • buy clomid online
  • generic cialis cheap
  • buy cialis lowest price
  • buy acomplia
  • buy levitra online
  • cheap cialis pill
  • buy cheapest cialis online
  • discount cialis
  • where to order viagra
  • viagra no prescription
  • order cialis no prescription required
  • soma generic
  • cialis tablet
  • levitra
  • cialis for order
  • order acomplia online
  • cheap generic soma
  • order levitra
  • discount cialis no rx
  • find cialis no prescription required
  • viagra online
  • cialis malaysia
  • viagra uk
  • soma pharmacy
  • buy cheap cialis
  • levitra cheap
  • buy lasix without prescription
  • lasix without prescription
  • order propecia online
  • cheap cialis
  • viagra free delivery
  • viagra overnight
  • cheap clomid online
  • lasix without a prescription
  • viagra online review
  • find viagra online
  • cialis generic
  • purchase viagra
  • propecia pharmacy
  • find cheap cialis
  • cheapest cialis prices
  • buy soma cheap
  • buy lasix cheap
  • cialis overnight
  • sale cialis
  • clomid pills
  • order cialis on internet
  • soma sale
  • cheapest lasix prices
  • viagra no online prescription
  • buy viagra from us
  • buy generic cialis online
  • cheap viagra tablet
  • soma without prescription
  • buy zithromax cheap
  • order propecia
  • buy cheap synthroid
  • find cheap cialis online
  • buy cheap lasix
  • order soma
  • lowest price propecia
  • discount propecia
  • purchase viagra online
  • accutane for sale
  • soma pills