How-To synchronize Nokia N70, Palm, Evolution and Google Calendar?

Many of you have this problem as well, the happy Mac folks - beside having a nice GTD supporting tools portfolio - can use the multi functional and efficient iSync application, but what about Linux?

I spent some time browsing here and there and googling even more, with scarce results, so finally I decided to write it here, all the ingredients you need to synchronize a Nokia (or Sony Ericsson) Symbian based phone, with your Evolution (Calendar, Tasks and Contacts) and/or with your Palm based device (Calendar, Todo and Contacts) and/or with Google Calendar.

The solution is based on
OpenSync the open-source general synchronization framework, with some plugins. You can have more information about OpenSync from the website, the general principle is that OpenSync act as an mediator between to entity to be synchronized, mapping the data between the entities types and synchronizing when possible the records exchanged, in case of conflict the standard behavior is to prompt the user for correction/decision.
Depending on your distribution you may find different package names, I use Gentoo and for me they are:
• app-pda/libopensync-0.20
• app-pda/msynctool-0.20
• app-pda/libopensync-plugin-evolution2-0.20
• app-pda/libopensync-plugin-palm-0.20
• app-pda/libopensync-plugin-google-calendar-0.20a
• app-pda/libopensync-plugin-syncml-0.20

And optionally you may want to install also;
• app-pda/libopensync-plugin-file-0.20
• app-pda/libopensync-plugin-gnokii-0.20
• app-pda/libopensync-plugin-python-0.20
• app-pda/multisync-gui-0.90.19

Unfortunately the Multisync GUI tool is not really working, at least for me, therefore you will need to use the command line tool :-) what a pity ;-) Based on the fact that my primary goal is to have GTD on the Phone, and on the Palm, my main focus was to find a suitable solution to have the tasks replicated on the phone and the Palm, as well as the Calendar, of course I also needed to synchronize contacts, but I gave no importance to the notes (luckily cause it seems that there are still some bugs around related to notes synchronization :-) ). My other requirements where:
• Do it all via Bluetooth, I have it and I hate cables, so why not use it...
• Evolution has to be the "Master" platform in case of conflicts, I trust it more than Symbian and Palm OS...
• It has to be possible to synchronize all together but also only a couple...
So following the requirements, this is what I did:

Synchronizing Evolution and Nokia N70

1. I have created some OpenSync groups, each group contains at least a couple of member, between which the data have to be synchronized: msynctool --addgroup evo2-n70 msynctool --addgroup evo2-palm msynctool --addgroup evo2-gcal
  • Create the member in each group, first I always put the evo2 (Evolution) because it is more easy than to specify that in case of conflicts is n.1 that overwrite:

    msynctool --addmember evo2-n70 evo2-sync
    msynctool --addmember evo2-n70 syncml-obex-client

    Note that I didn't used gnokii plugin, because at the actual stage it is not working via Bluetooth (for info on how to configure Bluetooth, I found it useful to have a look at Gentoo Wiki and Documentation).
  • Configuration of the members:

    msynctool --configure evo2-n70 1

    Note the number 1 identifies the first configured member, so the evo2-sync plugin...


    file:///home//.evolution/addressbook/local/system
    file:///home//.evolution/calendar/local/system
    file:///home//.evolution/tasks/local/system


    Now configure the Obex client, in Nokia phones the "identity" with which to synchronize is often named "PC Suite", to find out how is it called for you, grab the phone, select "Application" menu , than chose "Connectivity/Sync" there you find the list of the configured profiles for synchronization.
    msynctool --configure evo2-n70 2
    this time the number 2 identifies the obex client plugin



    00:AA:BB:CC:DD:EE
    11
    0
    PC Suite
    1
    1


    2
    1
    0
    10000
    0
    Contacts
    Calendar
    Notes


    How to find out which is the Bluetooth channel to use? You have to identify your device SyncMLClient service, to do so execute the following command:
    sdptool browse 00:AA:BB:CC:DD:EE
    and search for a service block named SyncMLClient, you should find something looking like this:

    Service Name: SyncMLClient
    Service RecHandle: 0x10013
    Service Class ID List:
    "Error: This is UUID-128" (0x00000002-0000-1000-8000-0002ee000002)
    Protocol Descriptor List:
    "L2CAP" (0x0100)
    "RFCOMM" (0x0003)
    Channel: 11
    "OBEX" (0x0008)
    Language Base Attr List:
    code_ISO639: 0x454e
    encoding: 0x6a
    base_offset: 0x100
    Profile Descriptor List:
    "Error: This is UUID-128" (0x00000002-0000-1000-8000-0002ee000002)
    Version: 0x0100

    After having configured the Obex Plugin correctly you can try whether the synchronization is working or not issuing the following command:

    msynctool --sync evo2-n70 --filter-objtype note --filter-objtype event --conflict 1 --slow-sync todo

    The filter object options are used to avoid failure, most of the time note objects and event object contains binary or not well formatted data that can cause the synchronization to fail.
Synchronizing Evolution and Palm OS

  • In order to successfully setup the synchronization with Palm OS, using Bluetooth, I recommend you to have a look at "Synchronize your PalmOS® Handheld over Bluetooth in Linux" from David A. Desrosiers. When you are done with that and you have the Bluetooth connection in place, than you may start with the following:

    msynctool --configure evo2-palm 2

    The configuration of the Evolution plugin is the same reported at point n.3 of previous section.


    net:any
    username
    60
    0
    115200
    0
    cp1252
    1
    1


    The synchronization, if you followed the instructions at point 1, should happen via Network, therefore the address of the socket is "net:any", this should reflect your pilot-link configuration. Remember to use your real username for synchronization. If you want to test it, use the command:

    msynctool --sync evo2-palm --filter-objtype note --conflict 1

    It should work ;-)

Synchronizing Evolution and Google Calendar

  • To synchronize with Google Calendar, you need to set up the appropriate plugin, to do so, issue the command:

    msynctool --configure evo2-gcal 2

    As before the n.1 configuration, for the Evolution plugin is the same as in point 3 of the first section.


    http://www.google.com/calendar/feeds/GOOGLE_USER@gmail.com/private/full
    GOOGLE_USER@gmail.com
    GOOGLE_PASSWORD


    When you have finished, to try it out, once more send the command:

    msynctool --sync evo2-gcal --filter-objtype note --conflict 1

    you may have some error here, the Google format is under minor changes, there may be a fix soon...

Putting it all together

  • As said you will not always have all the devices at hand and ready to synchronize, therefore the evo2-all group may me rarely used, so I created a simple script with which you can synchronize your PIM devices and applications
#Script for synchronization of devices
WHAT=$1
CONFLICT=1

# Helper Function Definition
function sync_palm() {
if [ "`ps ax | grep dund | grep -v grep | wc -l`" = "1" ] ; then
echo "Prepare to push HotSync button!"
msynctool --sync evo2-palm --filter-objtype note --conflict $CONFLICT
else
echo "DUND is not running, network connection from Palm not allowed!"
fi
}

function sync_n70() {
msynctool --sync evo2-n70 --filter-objtype note --filter-objtype event --conflict $CONFLICT --slow-sync todo
}

function sync_gcal() {
msynctool --sync evo2-gcal --filter-objtype note --conflict $CONFLICT
}

function sync_all() {
msynctool --sync evo2-all --filter-objtype note --conflict $CONFLICT
}

# Now process the WHAT and execute the proper function

if [ "$WHAT" = "palm" ] ; then
sync_palm
elif [ "$WHAT" = "n70" ] ; then
sync_n70
elif [ "$WHAT" = "gcal" ] ; then
sync_gcal
else
sync_all
fi

Yes you are right, I didn't told you how to create the evo2-all group, but I
guess you know how to ;-)

I hope you will have fun, and that soon the Multisync GUI tool will be nice and stable enough to be used, in the end a GUI has to be nice ;-)