| Wednesday, February 2, 2005 |
|---|
Hacking my cell phone [www.forum.nokia.com]
As soon as I learned that Nokia is shipping a Python interpreter for series 60 phones I could hardly wait to try it out. And you know what? It WORKS!I went to the above site and downloaded the interpreter. I dragged it onto my Bluetooth File Exchange and voila, I have a real Python interpreter in my Nokia 6600! Supplied are some neat examples such as a simple RSS reader. I was immediately able to read Slashdot headlines on my phone. The RSS reader, although simple, does have some important features such as downloading feeds in background and caching them on the phone. It's an application that I will actually use!
I could hardly wait to start some hacking myself. One of the interesting cell phone applications are location-based services. So I found this little script that returns basic GSM location info obtained through the gsm_location() API call.
Now, this script returns something like:
MCC: 262 MNC: 1 LAC: 35342 Cell id: 25867Which isn't particularly exciting. So, I surfed around and found this file, which gives some interesting information about all T-Mobile cells in Munich. With this information, when walking around the city I'll be able to see not only the useless cell id but also things like:
80331, Platzl 1, Mikrozelle über dem Eingang vom Hard Rock CafeOr:
80799, Heßstr. 22, 1800 MHz, Diakoniewerk München-Maxvorstadt, RückgebäudeIt is not really that useful, really, but it is fun for start.
So, the first step is to use this little Ruby script to parse the data from above mentioned 26201muenchen.clf. This script produces something like this:
# -*- coding: UTF-8 -*-
class CellInfo:
x={}
x[52926]='80331 An der Hauptfeuerwache 8, Feuerwehr'
x[9107]='80331 Kaufingerstr. 1-5, Kaufhof'
x[49295]='80331 Sonnenstr. 26, 1800 MHz'
[... and so on - 971 entries ...]
If you are a Python hacker please don't laugh at me for making that hash a class variable or for generating Python code with Ruby. I am still a complete idiot when it comes to Python. All I want right now is to get this working as fast as possible.
I saved the above script as cinfo.py and dragged to the phone. Then I changed a few line of the above gsm_location.py:
--- gsm_location.py Sun Jan 9 22:04:54 2005
+++ hacked_gsm_location.py Wed Feb 2 18:50:57 2005
@@ -3,6 +3,7 @@
import e32
import appuifw
import location
+import cinfo
class gsm_location :
def __init__(self) :
@@ -10,7 +11,8 @@
def gsm_location(self) :
(self.mcc, self.mnc, self.lac, self.cellid) = location.gsm_location()
- self.text = u"MCC: %s\nMNC: %s\nLAC: %s\nCell id: %s\n" % (self.mcc, self.mnc, self.lac, self.cellid)
+ self.cell_info = cinfo.CellInfo.x[self.cellid]
+ self.text = u"MCC: %s\nMNC: %s\nLAC: %s\nCell id: %s\nCell info: %s\n" % (self.mcc, self.mnc, self.lac, self.cellid, self.cell_info)
return self.text
def close(self) :
This will simply give me the cell information such as '80331 An der Hauptfeuerwache 8, Feuerwehr' in addition to the existing data.
I tried it and it works here at home! I can't wait to take a walk around Munich!
|
Posted by Branimir Dolicki at 19:28 |
|
# - G - Add comment |
You may request notification for Branimir's Blog.