Setting up PyS60 Bluetooth Console

Published: by

  • Categories:

If you are into PyS60 development, this is a must… Instructions:-

  • Make sure that your bluetooth device is plugged in.
  • Reset all bluetooth devices:-

$hciconfig reset

  • Optionally, you can also check if the device exists:-

$hcitool dev

  • Register a serial port:-

$sdptool add –channel=2 SP

  • Now, listening to the channel:-

$rfcomm listen rfcomm2 2

Now, switch on the bluetooth on the device and open the PyS60 Interpreter on the mobile and do Options->Bluetooth Console.. You will get the output like-

shadyabhi@shadyabhi-desktop:~$ rfcomm listen rfcomm2 2 Waiting for connection on channel 2 Connection from 00:21:FC:FA:B8:3A to /dev/rfcomm2 Press CTRL-C for hangup

That means you are not connected. As told in the official documentation, when i did-

$ cu -l /dev/rfcomm2 cu: /dev/rfcomm2: Line in use

I was getting the following error.. So, by a bit of googling i succeded by using another program screen by typing:-

$screen /dev/rfcomm2

Now, you will be connected & a new blank screen will come up.

Suppose, you want to make a call to your buddy whose phone number is 9510216275.. Simply type in your terminal…

import telephone
>>> telephone.dial(u'9510216275')
>>> 

This way, you can dial your buddy phone number in mobile by typing from your computer terminal….