A Graphical Guide to Getting your God Damned Bluetooth Modem to Work Again in Linux (Ubuntu Edgy)

Monday February 12, 2007
Much to the chagrin of my cell phone company, I use Bluetooth tethering to provide myself with always-on internet connectivity so that I can always be connected, even when traveling unexpectedly.  It's shocking how often I end up in areas without wifi coverage of any kind, but such is the world we live in.

For the fifth time now, I have managed to convince myself that configuring this in Linux is really easy, and not bothered to back up the one or two critical tidbits which allow it to work.  Also for the fifth time I have found myself in a situation where I needed to use my phone as a modem through my laptop and have been in an awkward situation because I could not.  For myself as much as for anyone else, I'm going to post the instructions for getting a bluetooth tethered modem up and running quickly under Linux, using GUI tools as much as possible.  Other tutorials that I've found for setting this up are rambling monstrosities that cover everything from a threat analysis of bluetooth security to a 1000-line-long configuration for command-line ppp dialer, so I am aiming to just provide a brief overview of how to get the phone up and running.  These instructions are fairly generic, but in my particular case, they apply to Cingular, the Nokia 9300 smartphone, and Ubuntu Edgy.
WARNING: BE AWARE OF THE BILLING IMPLICATIONS OF TETHERING BEFORE YOU FOLLOW ANY OF THESE STEPS, EVEN IF THEY SOUND NEAT.  CELL PHONE COMPANIES HATE TETHERING LIKE RED SOX FANS HATE YANKEES FANS.  THEY WOULD MUCH RATHER SELL YOU A MUCH FASTER AND BETTER DATA CONNECTION THAN ALLOW YOU TO USE YOUR PHONE IN THIS CAPACITY.  TETHERING DATA IS NOT BILLED THE SAME AS DATA ON YOUR DEVICE, YOU MAY INCUR EXTRA CHARGES EVEN IF YOU HAVE A VERY GOOD DATA PLAN FOR YOUR SMART PHONE.  TETHERING ON A DEVICE IS NOT THE SAME AS USING A DATA CARD EVEN IF BOTH ARE ON THE SAME ACCOUNT, AND YOU WILL INCUR EXTRA CHARGES FOR THAT.  IF YOU DO NOT HAVE A PREVIOUS AGREEMENT WHICH YOU ARE VERY SURE GRANTS YOU A LARGE AMOUNT OF TETHERING BANDWIDTH, DOING THIS MAY RESULT IN THOUSANDS OF DOLLARS IN DATA CHARGES.  I AM NOT LIABLE IF THIS HAPPENS TO YOU.  YOU HAVE BEEN WARNED.
Ahem.  Now that that's out of the way, let's move on to the main event.

Step One: make sure your bluetooth device is up and running.  This should happen automatically in edgy, so if you don't see output like this, it is unfortunately likely that your device is entirely unsupported.  You might try restarting your bluetooth device if it isn't visible here.



Step Two: Once you know your device is there, you'll need Linux to talk to your phone.  Scan the area for your phone, and then discover what channel your phone provides Dial-Up Networking (DUN) on.



Step Three: As root, edit /etc/bluetooth/hcid.conf and change the 'security' to 'auto'.  I've found that other methods for communicating the PIN are less reliable.  If you want to change your PIN, edit the "passkey" here.



Step Four: as root, edit /etc/bluetooth/rfcomm.conf to bind "rfcomm0" to your device's modem functionality.  Make sure to set both the "device" and the "channel". from Step Two.



Step Five: install the "gnome-ppp" package.  This is a nice graphical dialer that integrates well into the desktop.



Step Six: Run gnome-ppp.



Step Seven: In the initial window that comes up, enter any username and password that you like.  These are usually ignored by your provider, but they must be present.  I use 'user' and 'pass'.



Step Eight: Click the "Setup" button, and configure:
  • your Device to be "/dev/rfcomm0"
  • your Type to be "USB Modem"
  • your Speed to be something nice and high


Step Nine: Click "Init Strings" and type in the obvious strings that come to mind:
  • ATZ
  • AT+CGDCONT=1,"IP","isp.cingular"


Step Ten: Completely stop and then start your bluetooth services to make sure your phone is available.



Step Eleven: Click "connect" in gnome-ppp.  You will have to enter a PIN on your phone.  Hopefully, this will happen:



Then, the dialog will disappear and an icon will appear in your notification area telling you about the PPP connection.  There you have it!  Cellular internet connectivity, as easy as AT+CGDCONT=1,"IP","isp.cingular"!

I have absolutely no idea how, or why, any of this stuff works.  If the above steps don't work for you, unfortunately, I will not be of much help; I don't know how to diagnose problems other than googling around and running long bluetooth command lines that I don't really understand.  Still, I've been lucky enough to get it working every time after only a little banging my head against a wall.  Good luck!