Sync Multiple Calendars on the Nokia N900

I recently moved to a different corporate infrastructure (you can guess from where to where by reading a bit about the company I work for, Invite Media :)) and decided that I was going to be serious about using the calendar on my Nokia N900.  I had the following “desires”:

The Problem:

  • Work and Pleasure should be separate.    I want my work stuff on my corporate google calendar and I want my personal apts and reminders on my personal google calendar.  No mixing.
  • I want both to sync to the phone at a reasonable interval and not screw up either calendar or cross events from one to the other etc.
  • I would like to not pay anything to accomplish this.

I noticed something really quickly:

Stock Maemo 5 cannot support syncing calendar etc. with more than one Mail For Exchange account.

That sucks.  Oh well, the Maemo-ians must’ve run out of time and had to cut scope on the built in MFE syncing.  Worse things have happened in the world.

My Solution (Update: This may not be the best way to do it.  As is pointed out in the comments another application, Erming, exists which purports to be able to solve this problem.    I’m going to test it soon.)

  • TWO goosync accounts.  I ended up paying for one and using the free service for the second.  I may sadly have to end up paying for both.  (This really stinks :().  I used goosync because it does a very good job of exposing google calendar as a SyncML service.  I couldn’t find anything comparable to this on the web.  The reason you need two accounts is that, even though Goosync supports syncing multiple calendars, all the calendars have to come from the same google login.  I have two in this case.  Although, now that I am typing this, I realize I could just share one calendar with the other account and sync them that way.  That would mean that both calendars show up as the same color and mix on the device though, which would be suboptimal.  If thats OK with you that might be one route.
  • Syncevolution (in extras-testing) on the device to sync with the two different goosync accounts.  I setup each goosync account to use a different Maemo 5 calendar so they appear differently and I can create new events and chose which calendar they go to (very nice!)
  • Syncevolution by default does not provide more than a once daily sync.  Thankfully the Maemo 5 incarnation of syncevolution is really just a UI ontop of an underlying command line client, so we can use the command line client to trigger a sync whenever we want.  I used alarmd (available in extras-devel) to do this.  I used a tip from here: to setup the alarm command.  To save you the jump its:
    • env `dbus-launch` sh -c ‘trap “kill $DBUS_SESSION_BUS_PID” EXIT; syncevolution <NAME_OF_SYNCEVOLUTION_ACCOUNT>’
    • I setup two alarms, one for each goosync account to run every hour and it has been working flawlessly for more than a week now!  If you pay for goosync you can probably use this for tasks and notes as well (I havn’t tested this yet)

  1. I had no idea that I was syndicated on planet Maemo for my #Maemo posts.  Cool.
  2. Apparently there is another application which I had overlooked, Erming-NG.  It purports to be able to sync directly with multiple Google Calendars.  I will investigate this further!  
  3. I swapped N900s and had trouble resetting up Goosync.  I tried out erming and it worked flawlessly without any middle man in connecting to my various Google calendars — the only problem is that I couldn’t get it to sync more than once per day (and the connection needs to already be active for the sync, it wont auto-connect to wifi or 3g for its sync.  It actually throws obnoxious errors if its not connected).

A UPnP Home

Since Zhaan made it into extras-devel I have gotten several feature requests for new functionality.  Many of them have made sense and I have gone ahead implemented them in the latest version.  For example, Zhaan 0.1-8 implements vastly improved playlist support.  Zhaan is now at the point where I have found myself actually using it enough to entirely replace my standard Sonos controller and actually ENJOY the experience.  (I also installed Zhaan on my ‘stable’ N900, not just my development device, and have witnessed no ill effects.  I think it’s probably safe for anybody to use at this point)

Since (in my opinion anyway) I have succeeded at building an application to solve in-home media problems with UPnP I now turn to other problems that UPnP can solve (since it’s so much fun to hack around with).  Zeeshan Ali wrote a GUPnP-light application which shows an image of a lightbulb which goes “on” and “off” based on another test control point application. That seems like an interesting idea, using UPnP to control my lights.  And why not, right?  Who really wants to get out of bed at night to turn off the wall-mount light switch when my phone is on my night stand within arms reach and could be used to control those lights.  (clappers be damned).

Herein lies a rather common problem in computer science.  Writing software to do fun things in simulations is easy.  Applying it to solve real world problems by designing, manufacturing, marketing and selling a real physical product is hard.  Thus for the first 2 days of my search I could not find any devices to allow me to control my lights via UPnP.

During the first two days of searching I did learn a lot.  Here is a quick summary/FAQ of how modern “Smart Homes” work: (Smart meaning networked and remotely controllable)

  • Smart devices in the home do not often connect to the WLAN, let alone expose themselves as UPnP devices.
  • Instead, they use mesh networking.
  • There are several common mesh network protocols.   Z-Wave, X10, Insteon to name a few.
  • Once you deploy a bunch of Z-Wave (or other) mesh devices you need to deploy a “base station” of sorts which can control all of the devices and which MAY connect/bridge to the LAN.
  • Most base stations come with their own software to interact with via a browser or other proprietary mechanism.

Last night at about 3AM, on the verge of giving up my search, I found  They have a device, called the Vera, which looks to do exactly what I want!  I posted a quick question on their forums confirming that the device does what I had hoped (exposing each Z-Wave device as its own UPnP discoverable device). Turns out it does!   Here is a response from Javier, an “administrator” of the micasaverde forums.

Yep, that’s the main point.

Every device attached to Vera gets a full UPnP description and identification. Even for internal programming, everything is done using UPnP references.

In fact, writing device plugins (to get new devices attached to Vera) is mostly writing Lua code to join UPnP actions and state variables with the real-world device control interface.

To boot it looks like Vera is low power and designed for energy savings.  It also runs on a (mostly, from what I can tell) open source Linux stack.  Rock on!

Looks like I’ll be getting myself a Vera for my birthday (next week) and, with any luck, a week or two later posting another application to Maemo extras-devel that can control Z-Wave devices via a Vera!

Update: Turns out you can SSH into your Vera too.  I’m starting to build a collection of embedded Linux/OpenSSH servers around my house 🙂 (Chumby, Vera, N900 etc.)

Zhaan now available in extras-devel!

Myself and the PyMaemo folks have been working these past few days to clear the blockers from making PyGi work on maemo.   There was a last minute bug in the Maemo autobuilder which prevented PyGi from properly being imported into the maemo extras repository.  (Turns out the bug was caused by the fact that the PyGi package’s version number had capital letters in it.  Thanks X-Fade for your help!).  The bug has now been cleared and all of PyGi and Zhaan have been imported successfully.

For any users: Zhaan should be installable in the multimedia category of your application manager.  Please give installing and using it a shot and report any bugs you find (in the BugZilla)!  Positive feedback and/or feature ideas is also appreciated!

Zhaan works on the N900!

It has been a long time coming but finally I’ve gotten Zhaan to work on the Nokia N900, a Maemo 5 device!  Today Anderson and Willer at PyMaemo handed me a whole bunch of armel package dependencies for Zhaan.  I combined them with some secret sauce (i.e. some extra projects, including updated GUPnP and GUPnPAV and their GIR/Typelib files), deployed it all to my development N900 and voila, we have a working Zhaan :).

If you wish to get this running yourself the only way right now is to do this manually.  There are still a whole bunch of packaging road blocks before this can make it to extras-devel.  Instructions to do it by hand:

WARNING: FOR ADVANCED USERS ONLY FOR NOW!  Following these instructions could potentially break some features of your device as it does override your built in gupnp, gupnp-av and pygobject libraries.  This will be made safe by the time it makes it to extras-devel.

Download to your device and extract it.

Install all of the non-doc, non-dbg and non-dev “.deb files”.  e.g. “dpkg -i *.deb”.  (Note that the python-gobject-pygi may have a conflict and you may have to do dpkg -i –force-conflicts python-gobject-pygi…..).  Once all the debs are installed (I believe its 14 .deb files) copy the .gir files to /opt/pygi/share/gir-1.0/ and the .typelb files to /opt/pygi/lib/girepository-1.0/.

Finally download Zhaan from git (git:// and then use the following command to run zhaan:

LD_LIBRARY_PATH=/opt/pygi:/opt/pygi/lib PYTHONPATH=/opt/pygi/lib/python2.5/site-packages/gtk-2.0/ python2.5

And finally, the obligatory screen shots.  (You can tell this is a real device because its charging and the battery guage is moving in the various screenshots, as well as the sim card icon).