Tuesday, March 04, 2008

Simple (but Clunky) Bluetooth on Ubuntu

Since I've somehow gotten my hands on a Nokia 2630 temporarily, I thought I'd give the Bluetooth feature a go. Asking Google quickly turned up a ready solution answering all my questions. Man, I love Open Source >:-)

I'll just distill the specific steps I followed here. Anybody interested in more details & explanations really should follow the link.

First, ensure that Bluetooth is enabled. It should be by default, but I've disabled it on mine since I didn't need it previously


Run the following command: gksu gedit /etc/bluetooth/hcid.conf, then replace "passkey 1234;" with "passkey xxxx;" where xxxx is your desired passkey. Then, restart the Bluetooth service with sudo /etc/init.d/bluetooth restart. That should pop up a Bluetooth icon in your system tray.

Now's the time to initiate a pairing between your mobile & PC. I paired from the 2630 in this case.

Next, you'll need to install gnome-bluetooth package which should be available from one of Ubuntu's repositories. Once that's installed you'll need to edit rc.local with gksu gedit /etc/rc/local, and add the line hciconfig hci0 inqmode 0 above the line "exit 0".

I'm not really sure if a restart is necessary but it's a good idea to do so at this point; just in case ;-)

Be sure your mobile's Bluetooth is set to "visible" or else you'll not see it when you try to transfer files. Create a new launcher somewhere (desktop is suggested) and type gnome-obex-send in the command field. Fill up the name field and icon with something memorable.


Finally, start up Applications->Accessories->Bluetooth File Sharing and you'll now be able to drag & drop a file over the launcher you've just created to initiate a file transfer. Press the Refresh button on the opened dialog and wait a while for your device to get listed if it's not already there.