Using the PyS60 bluetooth shell on Mac OSX
Connecting to Bluetooth from Python for Series 60 Nokia phones is actually really easy. It just appears to be voodoo. It all boils down to the Mac’s ability to create arbitrary virtual serial ports and PyS60’s ability to connect to them over bluetooth.
Make sure already paired your phone using the Bluetooth Setup Assistant. Otherwise run through the Setup Assistant and select the options appropriate to your phone. You can find it in the Bluetooth menu in the menubar. I would recommend you also favourite your phone so you don’t have to constantly authorise things.
The Bluetooth Setup Assistant automatically creates a serial port which allows your phone to talk to iSync. This is called /dev/tty.Bluetooth-PDA-Sync. Lets connect to it; Open a new terminal window. A CLI app called Screen allows you to easily connect to the serial port. screen /dev/tty.Bluetooth-PDA-Sync should connect you to the serial port so you can wait for a connection.
Now on your phone open Python. From the options menu choose ‘Bluetooth console’. It will prompt you to pick your laptop’s Bluetooth name. You can set it as the default host. This just makes it quicker to connect in the future. The screen on the phone should now say something like Connection to ('00:00:00:00:00:00',3).... This means it’s connecting to the computer. If everything goes well the terminal on the computer should now show the Python shell running on the phone.
To disconnect simply type ctl+d on a new line in the terminal. This close the interactive shell and the phone should disconnect. However you will still have a screen connection to /dev/tty.Bluetooth-PDA-Sync. To close screen type Ctl+A, Ctl+K. This tells screen to do an action, and the action is kill. It will ask you if you want to exit, type y.
Hopefully this makes sense, if you have any problems please leave a comment and I will try to improve this guide based on peoples’ feedback. Thanks.












Add New Comment
Thanks. Your comment is awaiting approval by a moderator.
Do you already have an account? Log in and claim this comment.
Add New Comment