Archive for the ‘Ubuntu’ Category

How to connect PyS60 Bluetooth console and Ubuntu 8.04

Saturday, August 23rd, 2008

python bluetooth console There appears to be a bug in Ubuntu 8.04’s bluetooth packages, because of which when someone trying to connect to the serial port of the computer from the mobile phone running Python receives an error message saying “No Serial ports found”. This article provides a quick fix for connecting Python Bluetooth console to a computer running Ubuntu




Diving in

The bug only exist in Ubuntu 8.04’s bluetooth packages. Two packages (bluez-utils and libbluetooth2) have to be updated from debian sid’s repository

  • Download and Install:
  1. bluez-utils from http://packages.debian.org/unstable/admin/bluez-utils for your architecture
  2. libbluetooth2 from http://packages.debian.org/sid/libbluetooth2 for your architecture

In a terminal as normal user:

  1. Reset the HCI device:
    $ hciconfig reset
  2. Check that the device exists:
    $ hcitool dev
  3. Register a serial port (use channel 2. For some reason, channel 1 and channel 3 might not let the connection through)
    $ sdptool add --channel=2 SP
  4. Now listen to the channel:
    $ rfcomm listen rfcomm2 2

In your phone, make sure bluetooth is on, then go to the Python application and then select the Bluetooth Console. Select from the list of available devices your computer’s bluetooth adapter (you might need to select search even if you think you have already defined the pairing). If the operation is successful, you should see something similar to the following on your computer’s shell:

Waiting for connection on channel 2
Connection from 00:1D:FD:EE:86:38 to /dev/rfcomm2
Press CTRL-C for hangup

Now open a new shell terminal and execute:

$ cu -l /dev/rfcomm2

You’re now in control of your mobile’s python console.
Happy hacking !