Scripting

Bluetooth DUN

Linux Bluetooth DUN on Windows Mobile

Set up for using Bluetooth DUN from Ubuntu (should work with other linux distros) to Windows Mobile.

1 - Firstly, install wvdial and bluez-compat :

aptitude install bluez-compat, wvdial

2 - pair your windows mobile device with the PC. I cheated and used the ubuntu bluetooth-applet.

  1. set PC to be visible
  2. on WM go to settings > connections > bluetooth and select connect to device
  3. find PC in list and connect.
  4. enter the pin on WM then the same pin on the PC when the prompt appears.
  5. Finish the rest of the wizard.

(it is also possible to edit /etc/bluetooth/pin to set up default pin etc)

3 - configure bluetooth to connect to the windows mobile device - paste this into your /etc/bluetooth/rfcomm.conf

rfcomm0 {
	bind yes;
	device 00:17:83:CF:A2:90;
	channel 4;
	comment HTC_TyTN_II
}

You need to alter the device id etc - find this out from :

# hcitool dev
Devices:
	hci0	00:1B:DC:01:D3:A7

use the device here in the next line :

#  hcitool -i hci0 scan
Scanning ...
	00:17:83:CF:A2:90	HTC_TyTN_II

4 - restart bluetooth - it should assign the device

Check using

# rfcomm show hci0
rfcomm0: 00:17:83:CF:A2:90 channel 4 closed

5 - configure wvdial with a script to allow dial up via GPRS

[Dialer bt]
Modem = /dev/rfcomm0
Baud = 230400
Init1 = AT+CGDCONT=1,"IP","btmobile.bt.com"
Init2 = ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
Modem Type = Analog Modem
ISDN = 0
Phone = *99#
Username = bt
Password = bt
New PPPD = yes
Modem = /dev/rfcomm0
Abort on Busy = off
Carrier Check = on
Check Def Route = on
Abort on No Dialtone = on
Stupid Mode = on
Idle Seconds = 0
Auto DNS = on
Modem Type = Analog Modem 

you will need to change the apn name (btmobile.bt.com) and the username and password for your network.

The phone number may well work with '*99***1#' but you should not need this as this specifies to connect using a pre-saved connection in the phone rather than using the apn here.

Dial with wvdial <dialer name> so in this case would be wvdial bt

Note - On WM6?, bluetooth DUN was removed in place of bluetooth PAN. You need to install this using the cab attached to this page.

command history :

 365  hcitool -i hci0 scan
  366  pand --role PANU --connect 00:17:83:CF:A2:90 --service DUN
  367  pand --role PANU --connect 00:17:83:CF:A2:90 --service NAP
  368  tail /var/log/messages
  369  rfcomm show
  370  rfcomm show
  371  rfcomm show hci0
  372  locate pand
  373  rfcomm show
  374  rfcomm show hci0
  375  ifconfig 
  376  cd ..
  377  exit
  378  sdptool search DUN
  379  rfcomm bind 0 00:17:83:CF:A2:90 1
  380  ll /dev/rfcomm0 
  381  vi /etc/wvdial.conf 
  382  wvdial GPRS
  383  vi /etc/wvdial.conf 
  384  wvdial GPRS

if you get the following line in dmesg :
rfcomm_tty_ioctl: TIOCGSERIAL is not supported

you have probably got the wrong channel set up. Re-do : sdptool search DUN