Showing posts with label Nokia 5800. Show all posts
Showing posts with label Nokia 5800. Show all posts

Saturday, September 10, 2011

TTLS/PAP authentication in Nokia smartphones

Our college revamped the authentication mechanism of our campus wifi recently: instead of WPA2-PSK, it is now EAP-TTLS. The authentication is done by a central LDAP server, so one uses his common college network uid/password for authentication. Really neat.
But I had some trouble getting it to work on my Nokia 5800 smartphone, although a firmware upgrade added native EAP support. I changed the security settings of the wifi to EAP, selected all the right options, but still it would obstinately show the message: "TTLS/PAP authentication failure" or something like that.
I almost gave up hope, when I learnt from prof. Golam Mortuza Hossain that Nokia doesn't allow TTLS/PAP authentication unless an authority certificate is installed. So I promptly transferred the CA certificate to my phone over bluetooth. But the phone didn't even detect it as a certificate.
Then I learnt that Nokia phones only allow certificates of DER format. The conversion is easy enough, provided that openssl is installed on your computer:
That's it. Finally I can connect to the college wifi.
I wish it were that simple for Kindle 3! For some inscrutable reason, amazon doesn't allow kindles to access WPA-enterprise or ad-hoc networks. Even on jailbroken kindles, the process to make it work is very messy:one has to create a WPA wifi with the same ssid first, so that it is added to the list of 'Known' wifi networks, and then install a wpa_supplicant script. I haven't managed to do all that yet. Besides, kindle has free 3g anyway.

Tuesday, January 11, 2011

Merging Two Google Calendars

I regularly use Mail for Exchange to sync my phone with my Google Calendar account. It's awfully useful but there's one catch : you can't set it up to sync with two google calendars. It'll always sync only your primary calendar.

Now, I have a personal calendar with entries for my classes etc. Apart from that, I have also subscribed to another public calendar for keeping track of the activities organized by various clubs of IISER Kolkata. But the default-calendar-only policy of Mail for Exchange meant I was unable to get the second calendar to sync with my phone.

I googled for finding some solution for the issue, but it didn't yield any useful information. I had almost given up when I came across a not so well-known service from google called Google Apps Script. As the name suggests, It lets you run scripts written in JavaScript on google's server and the script can access many of google's popular services, including calendar.

That solved my problem completely. All I needed was a script which will add all the events of the second calendar to the primary calendar, with some background checks to avoid adding duplicate entries. That was pretty easy: as per google's standards, the documentation was excellent, with ample examples too. So I had a working version of the script ready within very little time.

The code:

You can add triggers for the script as well. I added a daily trigger, so it will run once a day and sync the secondary calendar. Problem solved!

Tuesday, January 12, 2010

Living harmoniously with Ubuntu 9.10 and Nokia 5800 XpressMusic

As I mentioned in the previous post, I ran into some trouble syncing my new Nokia 5800 XpressMusic with my laptop running Ubuntu 9.10 Karmic Koala. Sure, the phone would work just fine in mass storage mode via the included data cable and let me transfer anything onto the SD card, but I was not satisfied with it. Apart from other issues, that way I'd still have to create the playlist manually in the phone's music player. And since the phone lacked the capability  to add all the contents of a folder to a playlist (It doesn't allow changing the order of songs in an existing playlist either - those guys at Finland seem to be rather aversive to the idea of playlists), I was not exactly thrilled at the prospect of having to add each song in the full discography of Poets of the Fall to a playlist.
         I needed a program which would not only transfer all the songs in a playlist in my computer to my phone but also create the appropriate playlist in the phone. At first I unsuccessfully tried my luck with Rhythmbox : it showed all the tracks on my phone but stubbornly refused to play any of them.
         But I got lucky the second time. I happened to start amarok - the music player I abandoned ever since Jaunty Jackalope due to its sluggish performance. After googling for amarok plugins to sync with Nokia symbian phones, I came to know about the existence of amarok scripts. Although I couldn't find any script meeting my requirements on the web, on reading some of the scripts I became aware of the powerful DCOP interface of amarok. To my great delight, I found out that it  gives one the freedom to control (and automate) every aspect of that brilliant music player and natively supports python scripts.
         So I chose the obvious solution. I  wrote the code myself in python. The actual procedure was very simple: ask the user to select the playlist he wants to sync and where he wants to copy them to, copy-paste the whole damn thing, create a playlist and be done with it. But  the user interaction part was problematic: the user has to specify long pathnames. Doing so at a  python raw_input prompt without tab-completion can be frustrating. I had to create a gui.
       The last time I tried to code some gui stuff in python, I decided to learn Tkinter. Needless to say, that time I created some of the ugliest possible widgets in the universe. I had no intension of making the same mistake again. But the idea of going through the whole elaborate affair of learning pyQt or pyGTK for creating some simple dialog boxes did not seem appealing to me. While facing this dilemma, I found another gem hidden in the lines of the amarokscripts I already had in my system: kdialog. This was just the perfect thing for my code: simple one-line commands to present pretty dialog boxes showing a message or a file browser where the user can select the paths by means of good old point and click.
       Well, here's another interesting piece of trivia: the temporary playlist amarok creates when you drag and drop music files to its main window is saved as an XML file, but the playlists created manually are saved in normal .m3u format. Unaware of the second fact, I ended up studying xml parsing in python. Although it was totally unnecessary, I learnt about a couple of very powerful python libraries: xml and urllib.
       So the process of syncing the Nokia 5800 with Ubuntu was not as simple as I thought it would be. But my chance encounter with DCOP and urllib turned out to be rather fortuitous as it enabled me to write my second amarok script. I'll write about it in another post someday.

Monday, January 11, 2010

Mixed feelings about my new Nokia 5800 XpressMusic

Well, I have to admit that the decision of buying this phone was a rather impulsive one. That sort of behaviour is certainly not characteristic of me. But the fact is that I haven't had any new gadget to fiddle with for quite a few month. Besides, the included freebies were really tempting: a Sennheiser headset and 100 songs downloadable from Nokia's new Ovi store. Although both of them turned out to be rather disappointing (I'll come to those issues later), I am quite satisfied with the phone.

         The large screen produces crisp colours. Excellent for watching videos. The touch based UI could be a bit better though, occasionally it can't understand whether I want to select something or just scroll through the page. Being an XpressMusic, it is adequately equipped to belt out good quality music. But the Sennheiser PMX-60 headset failed to live up to the expectation (The first thing I did after buying the phone was to check that one out, even before the phone itself!) and the high level of expectation is not to be blamed for that. The sound quality is not  actually bad, but it leaks sound A LOT. Likewise, it allows enough of outside noise to make me reach  for my Creative EP-630 noise isolation earphones ( listening to music on this Nokia/Creative combination is a real pleasure, by the way).
         The Ovi store was an unmitigated disaster. I knew that the website was IE only, but I planned to wiggle out of that one by installing IE on WINE. But lo and behold; the Finnish web designing geniuses did not stop at only making the website incompatible with all the decent browsers over there, but made no provision of directly downloading music from the site at all. The actual job must be done on a software specifically designed for that. And needless to say, that software is windows only. So the only option I have for redeeming that offer is to download the songs directly to my phone.
        
          To be fair, the phone itself leaves very little to be desired at its price point. Getting both Wi-fi and GPS at this price is really nice. Besides, Symbian being the most popular OS for mobile devices, an unnervingly huge collection of softwares are available on the web.
         
          But the biggest plus point of this phone is that the symbian platform is extremely python-friendly. The default symbian port of python (made by Nokia itself) even includes the option of setting up a serial connection to a linux box over bluetooth. This one turned out to be a major boredom buster for me, as it enabled me to tinker with the innards of the phone. They even provided a script to create .sis installers from a python script. I haven't checked it out yet but plan to do that as soon as I write any big enough program.
        
P.S. - I actually started to write the blog with the intention of describing the ordeal I had to go through for syncing the playlists on my computer with the phone, but unfortunately it is almost 7 a.m. So that story will have to wait (In case you are wondering what kind of errand I am up to at 7 a.m. in a January morning, I'm just hoping for a couple of hours of sleep before classes start).