PyS60 Bluetooth console
From OpenSource
The Bluetooth console is an interactive Python interpreter running on the phone that communicates with your PC over a Bluetooth connection. It's immensely useful for debugging and experimentation, but it can be a bit of a pain to set up.
See also Bluetooth section
Windows
Mac OS X
- Step-by-step Instructables Guide (with Pictures)PUTools, Advanced Python console on your Mac
- Step-by-step Instructables Guide (with Pictures): Python console on your Mac
- How to connect PyS60 Bluetooth console and Mac OSX
- How to connect your python bluetooth console (OSX 10.3 & 10.4 Instructions)
Linux
To be able to understand or to evaluate different howtos it is important to understand basics of the bluetooth layered architecture. http://en.wikipedia.org/wiki/Bluetooth_protocols Otherwise with all the different linux tools for each layer it looks like a mess. You will need at least following tools:
- 'hcitool' to find your mobile device
- 'sdptool' and 'sdpd' daemon to register services like serial port
- 'rfcomm' to emulate serial port over bluetooth
- 'cu' or any other terminal program
Instructions
Plug-in your bluetooth adapter, and then from the shell:
- $ hciconfig reset
Then check that the device exists by typing:
- $ hcitool dev
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
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:11:9F:BE:47:CA 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 :)
NOTE: In some Linux distributions cu command is not a shell built-in. In that case you must use the minicom program which is equivalent to cu.
Example: In Pardus Linux type sudo pisi it minicom to install it.
Tested with:
- Nokia 6630, Ubuntu 7.10.
- N73, Ubuntu 7.04, Thinkpad T42p.
- N95, Debian (kernel 2.6.26) - you need to use minicom -o instead of cu
Notes:
- This procedure doesn't work on Ubuntu 8.04 due a bug in bluez-utils [1] and can be temporally fixed till hardy is updated installing debian sid package [2]
Additional HOWTOs
- This did not work for me (Nokia N95, Ubuntu 7.04 Festy) How to connect PyS60 Bluetooth console and Debian/GNU Linux
- Better HOWTO http://crschmidt.net/blog/archives/11/bluetooth-console/ works at least for (Nokia N95, Ubuntu 7.04 Festy)
