BlueTooth tethering Ubuntu 9.04 to a Rogers N95

I finally took the time to figure out how to tether my laptop to my phone. Yeah - I know, lots of people have done this but I couldn't find a straight forward walk through for my scenario.

I revised this when I realized that I have multiple USB bluetooth dongles. For the record, they are both Trendnet TBW-105UB with FCC ID: NHPWLT1500

Items in RED are values from my equipment - you'll need to substitute values for your equipment.

Items in Green are commands to be entered.

Items in Grey are system prompts or responses.

This walk through has N parts:

  • Getting your BlueTooth adapter recognized
  • Creating a BlueTooth pseudo serial port on your computer
  • Setting up a connection using the phone

Getting your BlueTooth adapter recognized
I'm skipping this section for now because mine worked "out of the box". Under System => Preferences => Bluetooth

Creating a BlueTooth pseudo serial port on your computer
First you have to identify your phone. Run:
jardine@mywhim:~$ hcitool scan
Scanning ...
00:19:4F:DB:0B:63 lilbit
00:1F:5D:3C:3F:CB JJ's Phone

The first entry is my N800, the second (JJ's Phone) is my phone, if you left yours set to the factory default it will by N95

Now we need to identify the channel to talk to:
jardine@mywhim:~$ sdptool search --bdaddr 00:1F:5D:3C:3F:CB DUN
Searching for DUN on 00:1F:5D:3C:3F:CB ...
Service Name: Dial-Up Networking
Service RecHandle: 0x1005e
Service Class ID List:
"Dialup Networking" (0x1103)
Protocol Descriptor List:
"L2CAP" (0x0100)
"RFCOMM" (0x0003)
Channel: 4
Language Base Attr List:
code_ISO639: 0x454e
encoding: 0x6a
base_offset: 0x100
Profile Descriptor List:
"Dialup Networking" (0x1103)
Version: 0x0100

Now we can setup the pseudo serial port. As root, edit /etc/bluetooth/rfcomm.conf to look like:
#
# RFCOMM configuration file.
#
rfcomm0 {
bind yes;
device 00:1F:5D:3C:3F:CB;
channel 4;
}

Now pull the Bluetooth dongle out - give it 30seconds and plug it back in. You should now have a working Bluetooth connection to your phone.

Check for the pseudo serial port:
jardine@mywhim:~$ ls -ld /dev/rfcomm0
crw-rw---- 1 root root 216, 0 2009-06-23 22:29 /dev/rfcomm0

Setting up a connection using the phone
With your laptop & phone paired, you should have have a serial port defined as:
/dev/rfcomm0

Now all we need to do is convince ppp to use it. There are two files that we'll create/modify to do this:
/etc/ppp/peers/rogers
/etc/chatscripts/rogers

Here is the content of /etc/ppp/peers/rogers
/dev/rfcomm0
115200
usepeerdns
noauth
defaultroute

Here is the content of /etc/chatscripts/rogers
ABORT 'BUSY'
ABORT 'NO CARRIER'
ABORT 'ERROR'
'' AT
OK AT+CGATT=1
OK AT+CGDCONT=1,"IP","internet.com"
OK ATDT*99***1#

Now, as root:
root@mywhim:~#pon rogers

You're on the internet at this point. When you want to disconnect:

root@mywhim:~#poff rogers