Ubuntu, Serial port, Bluetooth console, Nokia E61i, Python

23 01 2009

A while back, in this post here, i described how to access the Bluetooth console through Bluetooth from a Nokia E61i to Win XP.

After that i’ve been meaning for a long time to write about the same procedure, but running Ubuntu now as an operating system.

First we need to install Python for Symbian (pys60). The .sisx file can be found on the project’s SourceForge page here.

Hardware used:
Dikom Bluetooth Usb Dongle : 00:02:72:XX:XX:XX
Nokia E61i : 00:17:E5:XX:XX:XX
Dell Dimension C521 running Ubuntu Intrepid Ibex (8.10)

The correct functioning of the BT dongle, BT service, and the pairing of the devices goes beyond the scope of this article.

From this point it is assumed that BT works correctly on your system, and that the devices are paired.

First we need to know if the BT dongle is up and running. Open a shell window and type:
hcitool dev

If everything is running properly, the output should be something similar to this:
sid@dev:~$ hcitool dev
Devices:
hci0 00:02:72:XX:XX:XX

The next two steps are quite a logical following :
1. Create a serial port on the pc
sdptool add --channel=3 SP

that should output:
Serial Port service registered

2. Start listening for connections on that port:
rfcomm listen rfcomm0 3

that should output:
Waiting for connection on channel 3

Now on the phone, enable bluetooth, start up the python shell the choose:
Options -> Bluetooth console and select from the devices list the BT device of the computer

Done this, on the phone screen’s python shell you should see something similar:
Connecting to ('00:02:72:XX:XX:XX', 3)... OK.
telling that the connection with our device succeeded.

Meanwhile on the command line, where we are listening for connections on the serial port 3, the output should be:

rfcomm listen rfcomm0 3
Waiting for connection on channel 3
Connection from 00:17:E5:XX:XX:XX to /dev/rfcomm0
Press CTRL-C for hangup

If you’ve gotten this far with these results, we’re all good and we have one more step left.

So far we have an active connection between these two devices.
Let’s tap into it with cu

The cu command is used to call up another system and act as a dial in
terminal. It can also do simple file transfers with no error checking.

Open another command line window and type:

cu -l /dev/rfcomm0

Th desired output is something like this:

cu -l /dev/rfcomm0
Connected.
Python 2.4#
>>>

And voilĂ . Done.

Now we can fiddle around and do some Python Mobile programming.

The very same procedure can be used with any application using a bluetooth serial port.

About these ads

Actions

Information

One response

1 03 2009
Mike

Just passing by.Btw, you website have great content!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s




Follow

Get every new post delivered to your Inbox.

%d bloggers like this: