Use Python to access the built-in GPS in a Nokia phone

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:

  1. Download and install Python for S60
  2. Download Python Script Shell with a test UID
  3. Sign the Python Script Shell by using this web page
  4. Download LocationRequestor with a test UID
  5. Sign the LocationRequestor .sis file with the same web page as above
  6. Move the two signed .sis files to the phone and install them
  7. 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
  8. 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.

Attachments
gps.zip

One thought on “Use Python to access the built-in GPS in a Nokia phone”

  1. I can confirm that it works on a N95 with FW V 30.0.015 (15-07-08), installation according to instrucitons. I typically get the line “7 42.3093 -83.7140 0”!

    Though I would recommend to add that under #7, the script must be stored in “C:\Python” to show up in the Python application.

    Now waiting eagerly to try out the web-upload part as well!

Comments are closed.