Image credit: Nicholas Moreau at WikiMedia

Mar 1, 2010

PyS60 2.0 install headache on Nokia 5800 XpressMusic

So I just bought the 5800XM a few days ago... the price had dropped enough to make it a rather attractive buy for the features - large screen, 3G, WiFi, A-GPS. Moreover, Nokia has recently (partially?) open-source-licensed Symbian OS code, which appeals to my FOSS sensibilities (yeah, yeah, they were probably forced to do so to compete with the likes of Google's Android, but still!).

Another feature that strongly attracted me toward S60 was the availability of Python, my current favorite programming language, on the platform. It can do some pretty powerful and useful stuff, judging by the modules available, and some of the sample code out there.

The wiki's Installation page was apparently outdated, or did not address some special condition on this phone, since it originally only advised "Download the latest SIS packages of the Python for S60 runtime and the PyS60 Script Shell from the SourceForge project page or maemo garage." (I have since edited the page, but don't know how long that info will last, or whether it is 100% accurate, or will continue to be accurate.)

So I initially installed the two packages, following the wiki. I found, at the Maemo download page for PyS60, an archive named "PyS60_binaries_certificate_error_fixed.zip" which then seemed to be just what I needed - including a fix for some certificate error I didn't have to face. Great, huh? Turns out, not so much...

I installed the two packages, and then tried to run the Python shell. Result? An error message, "Update is mandatory for installing Python Runtime & it's dependencies. Rerun the application for automatic updates". So I looked around, and found the App Update utility on the phone, and ran it. It told me that "Live TV" and "Mailsync for Exchange" (neither of which I needed or would use, and I couldn't understand WTH these had to do with Python anyway) were available for download. Sighh... exiting App Update and trying Python again gave me the same error, so I despondently told it to go ahead and install them.

Still the same error message. Arrghh! Re-ran the App Update, it apparently found even newer versions of the packages, with different sizes, and painfully and slowly (GPRS, no 3G service here yet) downloaded and installed the packages. (Why couldn't it have located the newest versions the first time? Or did I happen to check just before and after release of a new version? Who knows!)

STILL the same error message!!! Some more Google searches... found that I probably needed to reboot the phone. Did that - quite a few times. Nope, no improvement :-(

At this point, I decided the obvious way was probably wrong, and two hours into what should have been a simple and quick install, revisited the Google search I'd abandoned earlier. I kept at it till I found this in the Maemo bug tracker. N97 - another S60 5th Edition phone, but unlike what the wiki stated, this person had a bunch of other packages installed... and his worked after a reboot. Hmm... was I missing some packages, and the stupid error message was wrong? It wouldn't be the first time.

Now where was I supposed to get the packages he mentioned? After looking around the Maemo download page a bit more, I noticed the PythonForS60_2.0.0.tar.gz file. I found it contained pips.sis in the PythonForS60/PyS60Dependencies/ subfolder, as well as ssl and stdioserver packages that the bug report mentioned. I wanted to try them one by one, so I connected the phone via USB cable as a Mass Storage device, and copied the pips.sis file onto the card. I then used the File Manager to locate and install pips.sis. This first package itself fixed the immediate problem with Python - it runs, and I can execute sample scripts. I didn't need to reboot after installing the pips.sis file.

Still miffed, I created an account at the wiki, and added in http://wiki.opensource.nokia.com/projects/Installing_PyS60#For_S60_5th_edition_phones so that at least other users in the same boat might find some semi-accurate information in the wiki! :-/

Probably I'll encounter a need for the ssl and stdioserver packages later, as I get into playing with Python on the phone. For now, other things are holding my attention :-)

No comments:

Post a Comment