For some reason I have agreed to participate in one of the longest bike rides here in Sweden this year, the 300 km Vätternrundan. During the race every bike rider has an RFID tag on the leg which is read as you pass various points along the course. Apparently there are only a handful of locations where the tags are read and I wanted to do better than that.
I thought about using a phone with built-in GPS and send the positions in real-time to my server so that my loved ones can see where I am during the race. First I hoped to be able to use my iPhone 3G but the lack of background processes in a non-jailbroken iPhone meant it was a no-go. I then turned to my previous phone, a Nokia N82.
Doing a native application didn’t seem necessary for this type of application. I really just need a small hack to send periodical updates to an Internet server (which I will also write). I knew that it was possible to write Python applications for Series 60 phones but to be able to access internal resources like the GPS required signed applications.
Various Internet sources spoke about how to access the GPS information from Python but they all seemed to lack some detail that made it not quite work. At the end I got it working and this is how I did:
- Download and install Python for S60
- Download Python Script Shell with a test UID
- Sign the Python Script Shell by using this web page
- Download LocationRequestor with a test UID
- Sign the LocationRequestor .sis file with the same web page as above
- Move the two signed .sis files to the phone and install them
- Move the attached script to your phone (e.g. using Bluetooth) and place it under C:\Python or E:\Python. Personally I prefer the latter since I can then reset my phone and have all the files intact on the memory card
- Start Python and run the script
The above has been tested on a N82 (v 30.0.019) but may work on other similar phones with built-in GPS (e.g. N95).
In a future article I will follow up with an updated script that also sends the GPS data to a remote server. Stay tuned.