Alright, so I was in Albany this last Wednesday (March 24th) for SUNY Palooza, protesting the cuts to SUNY, thus driving up the tuition for myself and every other SUNY student. I went with 7 other people and I was not driving. The drive to Albany from Batavia is about 4 hours. So I brought a power inverter, my laptop adapter, my Hotsync cable, my cellphone, and my laptop. I then used a program called USB Modem to turn my phone into a PPP modem to the internet and the ride to and back from Albany was anything but boring. Note that I have an unlimited data plan with Sprint.

Now, the reason I'm making this post is because people are having problems (like I was) setting up USB Modem via Bluetooth. I was looking for something in my car yesterday and found this old Kensington USB bluetooth dongle that my roommate gave me. Back when I used Windows XP, I left it in the car because the drivers for it end up causing mass BSODs and you have to remove every trace of the driver to get it to stop (it's a Broadcom chipset inside, so I'm not surprised). Now that I'm using Linux solely, I can actually use it since my own laptop doesn't have integrated Bluetooth. So, I plugged the adapter in last night, paired up my phone, and got the brilliant idea to try setting up USB Modem via Bluetooth this morning.

* As a FYI, I'll be updating this post to include output, scripts, and whatnot. I'll have to go through the process again to get some of the output I need to paste here. If you're reading this, check back in a few days. *

As everyone that's set up USB Modem under Linux via the Hotsync cable, you're aware and familiar with the script you have to call to make the whole thing work. I wrote a script so I don't have to remember that single line of text to run as root, but that's besides the point. You're aware that you have to run pppd /dev/ttyACM# call ppp-treo-script to start the connection process. To figure out what the device node (that /dev/ttyACM# thing) is, run dmesg | grep ttyACM and use the last ttyACM device node that is listed. Pretty simple.

So, the first thing I did was to look through the dmesg output without grepping anything. No new device nodes. Crap. So I looked through the PDF manual for USB Modem regarding connecting through Bluetooth via Linux, which I found very unhelpful:

Generally a setup consists of two major steps:
1. Configure the RFCOMM channel to Treo and get a device node for it. The exact meaning of this depends on the Linux Bluetooth stack and distribution.
2. Configure the PPP connection as described above and start just like with the USB case but use the device node from the first step instead of the /dev/ttyACM0.

The second step is pretty familiar. Translated, it's saying to use the device node pointing to your phone instead of /dev/ttyACM#, which should be obvious. The first was pretty broad, but it helped me figure this out.

So, at a bit of a brick wall, I started Googling around, found a site explaining how to set up /etc/bluetooth/rfcomm.conf (uncomment everything and be prepared to go back and change a few things in the future), another explained how to use sdptool, and I already had previous experience with hciconfig and hcitool from setting up my Wiimote to act as a mouse/remote with my HTPC. Eventually, I came across this website. The first command is using rfcomm to manually create a device node. This is what I need!

# rfcomm bind 0 00:00:00:00:00:00 1

is (as root) telling the computer to create the device node /dev/rfcomm0, bind it to the MAC address 00:00:00:00:00:00, and use channel 1. I previously had run sdptool on my phone with USB Modem running. Part of the output mentioned DUN (Dial-Up Networking) and the RFCOMM channnel. The output is below:

Browsing  ...
Service Name: Voice Gateway
Service RecHandle: 0x10000
Service Class ID List:
  "Handsfree Audio Gateway" (0x111f)
  "Generic Audio" (0x1203)
Protocol Descriptor List:
  "L2CAP" (0x0100)
  "RFCOMM" (0x0003)
    Channel: 7
Language Base Attr List:
  code_ISO639: 0x656e
  encoding:    0x6a
  base_offset: 0x100
Profile Descriptor List:
  "Handsfree" (0x111e)
    Version: 0x0101

Service Name: AUDIO Gateway
Service RecHandle: 0x10002
Service Class ID List:
  "Headset Audio Gateway" (0x1112)
  "Generic Audio" (0x1203)
Protocol Descriptor List:
  "L2CAP" (0x0100)
  "RFCOMM" (0x0003)
    Channel: 1
Language Base Attr List:
  code_ISO639: 0x656e
  encoding:    0x6a
  base_offset: 0x100
Profile Descriptor List:
  "Headset" (0x1108)
    Version: 0x0100

Service Name: OBEX Object Push
Service RecHandle: 0x10003
Service Class ID List:
  "OBEX Object Push" (0x1105)
Protocol Descriptor List:
  "L2CAP" (0x0100)
  "RFCOMM" (0x0003)
    Channel: 2
  "OBEX" (0x0008)
Language Base Attr List:
  code_ISO639: 0x656e
  encoding:    0x8cc
  base_offset: 0x100

Service Name: Mobile Stream DUN
Service RecHandle: 0x10007
Service Class ID List:
  "Dialup Networking" (0x1103)
Protocol Descriptor List:
  "L2CAP" (0x0100)
  "RFCOMM" (0x0003)
    Channel: 3
Language Base Attr List:
  code_ISO639: 0x656e
  encoding:    0x8cc
  base_offset: 0x100

See that ending part that I bolded? See that line right after "RFCOMM" (ox0003)that says channel 3? When I ran that rfcomm command, I made sure to bind the device node to channel 3. Afterwards, I simply ran the pppd command, replacing the usual /dev/ttyACM0 to /dev/rfcomm0. Crossed my fingers and.... success. Everything worked.

I'll be updating this over time as I discover and play with this more.