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
