Kmail/Korganizer and Nokia phone synchronization

When Nokia bought Trolltech, the makers of QT, one could assume that Nokia PC-Suite for Linux was on the horizon… But so far nothing has happened. So how do I synchronize my phone contacts and agenda with KDE software? Easy…

In my case I’m using KDE and Kmail/Korganizer, so the following post is how to accomplish this syncronization with Kmail address book and Korganizer Calendar using the Opensync syncronization framework. I’m using Opensync version that comes with Kubuntu 9.10, that’s 0.22.

Requirements: Latest KDE SC 4.4 release, a bluetooth dongle (in my case I’ll synchronize using BT), Akonadi and Kmail/Korganizer

1st) Make sure that your phone is detected. In my case it’s an Nokia 6280, and using one of these: http://www.dealextreme.com/details.dx/sku.11866 on my desktop PC, that works on Linux/Kubuntu 9.10 without any issue (and cheaper than this is probably impossible…):

Let’s see if the bluetooth dongle is detected: lsusb

Bus 008 Device 002: ID 0a12:0001 Cambridge Silicon Radio, Ltd Bluetooth Dongle (HCI mode)

Detected and Kbluetooth works, now execute the command: hcitool scan and the detected phones should appear:

Scanning ...
 00:3B:34:91:9A:56       Nokia 6280
 00:75:1F:88:08:AF       VF541

Take note of the hexadecimal address for the phones.

We also need to make sure that the phones do have the SyncML client, using the sdptool command browse: For example: sdptool browse 00:3B:34:91:9A:56

And on the output a section like this:

Service Name: SyncML Client
Service RecHandle: 0x1000e
Service Class ID List:
 UUID 128: 00000002-0000-1000-8000-0002ee000002
Protocol Descriptor List:
 "L2CAP" (0x0100)
 "RFCOMM" (0x0003)
 Channel: 11
 "OBEX" (0x0008)
Language Base Attr List:
 code_ISO639: 0x656e
 encoding:    0x6a
 base_offset: 0x100

should appear. In my case, only the Nokia 6280 has the SyncML client. The Vodafone 541 does not have this client so synchronization will be impossible. I also have a Nokia 2630, and it has BT and the SyncML client.

So you need now to take note of the following information: The phone address and the channel address of the SyncML client, in my example 11 (see above).


2nd) Make sure that you have the following msynctool plugins installed: file-sync and syncml-obex-client.

For that just execute the following command: msynctool –listplugins

If they are not available, install them using: sudo apt-get install opensync-plugin-file opensync-plugin-syncml

3rd) Create a directory on your home directory for storing information related to the synchronization. Please note that you never, EVER, should delete any information on this directory. If you do its the same as deleting data on the phone.

mkdir ~/nokiasync

4rd) Create the opensync syncronization configuration:

     msynctool --addgroup nokiasync
     msynctool --addmember nokiasync file-sync
     msynctool --addmember nokiasync syncml-obex-client

5th) Edit the configuration for each member of the synchronization group:

  • On the file-sync member we need to put the full path to the syn directory
  • On the syncml-obex client we need to put the MAC address of the phone (the hexadecimal numbers that we’ve found above) and the channel number.

So execute the following commands:

Edit the first member file-sync: msynctool –configure nokiasync 1

The text editor will show something like:

<config>
<path>/home/USERNAME/nokiasync</path>
<recursive>FALSE</recursive>
</config>

Make sure that USERNAME is your Linux username, namely bob, alice, whatever. A command like ls -l /home/USERNAME/nokiasync should return NO error.

Just press CTRL-X to exit and Y + ENTER to save.

Let’s configure now the Syncml client: msynctool –configure nokiasync 2

The file shown should look like:

<config>
<bluetooth_address>XX:XX:XX:XX:XX:XX</bluetooth_address>
<bluetooth_channel>YY</bluetooth_channel>
<identifier>PC Suite</identifier>

Just make sure that XX:XX… is EXACTLY your mobile phone address, and YY is the channel shown by the sdptool. In the above case it’s  00:3B:34:91:9A:56  and 11 respectively. So the file should look like:

<config>
<bluetooth_address>00:3B:34:91:9A:56</bluetooth_address>
<bluetooth_channel>11</bluetooth_channel>
<identifier>PC Suite</identifier>

Then CTRL-X, Y and Enter to save, and we are ready.

6th) Now is a good idea to backup your phone address list and agenda. Do it now! If things go wrong you need a backup. Also the first rule of good a good backup is that restores are more important than backups, so backup AND restore first so see IF you have a VALID backup. You’ve been warned… 🙂

7th) Now we are ready:

msynctool –sync nokiasync

Because I’m using bluetooth I’ll be asked for a PIN by my phone, and I’ll need to provide it to the PIN question dialog on the computer. After the pin, synchronization takes place, the first one is from the phone to the computer.

After this, on the directory nokiasync you should have some files. These files are your contacts and calendar from the mobile phone. DO NOT DELETE THEM.

8th) Akonadi configuration.

We need to configure Akonadi now. It’s quite easy. Just run akonaditray, and right click on the globe icon that appears on the KDE system tray, and select configure.

For the calendar:

  • On the Akonadi resources tab, press ADD and select the KDE Calendar (Traditional) plugin. A wizard will appear. Press next.
  • Then select more or less at the middle: Calendar in Local Directory and press Next
  • Give as the location the nokiasync directory that we’ve created, and where the opensync works for syncing with our mobile phone. Press Next
  • Give it a name, in my case Nokia Calendar, and press Finish.

OPTIONAL: For the Contacts (For reference only, Korganizer will not use this. See below) :

  • On the Akonadi resources tab, press ADD and select the KDE Adress book (Traditional) plugin. A wizard will appear. Press next.
  • Then select the first option: Folder and press Next
  • Give as the location the nokiasync directory that we’ve created, and where the opensync works for syncing with our mobile phone. Keep the format as vcard, and press Next
  • Give it a name, in my case Nokia Contacts, and press Finish.

That’s it. The akonadi resources are configured.

8th) Korganizer configuration.

For adding the calendar follow these instructions on this post: https://primalcortex.wordpress.com/2010/04/24/korganizer-and-google-calendar-on-kubuntu-9-10/ but instead of adding the Google resources add the Nokia Calendar resource

For the address book, just go to the Contacts section, and on the Address book, select Add Address Book with a right click on the mouse.

  • Select the KDE Adress book (Traditional) plugin. A wizard will appear. Press next.
  • Then select the first option: Folder and press Next
  • Give as the location the nokiasync directory that we’ve created, and where the opensync works for syncing with our mobile phone. Keep the format as vcard, and press Next
  • Give it a name, in my case Nokia Contacts, and press Finish.

And that’s it Nokia<->Korganizer syncronization…

9th) Testing:

Create a contact and a calendar event on Korganizer, but for the Nokia resources. Execute the synchronization command: msynctool –sync nokiasync

Your mobile phone should report that it synchronized 1 or two items. Check your contact list for the new contact. Check your agenda for the new event.

Now repeat the opposite: Create a phone contact and event, and synchronize. It should appear on Korganizer.

Last thoughts:

What happens if the syncronization directory is a sub-directory of your Dropbox folder…???? 🙂

Automatic synchronization of all your agenda and contacts on all your computers! This in fact completely implements the purpose of plugins like akunambol and the Funambol server at this level of functionality…

You can now: Create a contact on your mobile phone, sync it, your local computer sees the change, but Dropbox also sees it sync’s it into the cloud, and into your other computers…

The phone synchronization ideas and howto’s where based on this post: http://www.harald-hoyer.de/linux/linux-and-syncml-multisync-with-nokia-6280

Finally, this also just brought to my ancient phone a new lease of life. No new Android phone for me… and by the way, after synchronization, the Nokia 6280 screensaver just fails to start…. and the Vodafone VF541 needed a restart… Nothing is perfect.

Advertisements

7 thoughts on “Kmail/Korganizer and Nokia phone synchronization

  1. Great, thank you!

    Using multisync-gui, i have synchronization with one click now!

    But i’m experiencing one problem: when i modify an address book entry with kaddressbook, i get a new file for this contact in the synchronization directory and the old file still exists!
    From then on i have 2 entries for that person in kaddressbook.
    Will experiment further with that.

  2. Hi!
    thank you for this really useful guide!
    I’ve followed all the steps but when i try to sync the device (nokia 2630) and my notebook (Kubuntu 10.04) on the screen of the phone it seems to get stucked… the “sync inizialization in progress” message stay forever…
    the output on the pc is this:
    fra@fra-notebook:~$ msynctool --sync nokiasync
    Synchronizing group "nokiasync"
    Member 1 of type file-sync just connected
    received contact dsession
    received event dsession
    received note dsession
    Member 2 of type syncml-obex-client just connected
    All clients connected or error
    Member 1 of type file-sync just sent all changes

    Any idea?

    • Hi, sorry for the delay:

      This also happens to me…. No idea if it’s the msync tool or the SyncML Nokia client on the phone… Restarting the phone sometimes helps…

      • now the error it gives is another:
        fra@fra-notebook:~$ msynctool --sync nokiasync
        Synchronizing group "nokiasync"
        The previous synchronization was unclean. Slow-syncing
        Member 1 of type file-sync just connected
        Member 2 of type syncml-obex-client had an error while connecting: Bluetooth connect error
        Member 1 of type file-sync just disconnected
        All clients have disconnected
        The sync failed: Unable to connect one of the members
        Error while synchronizing: Unable to connect one of the members

  3. Hi there, I found your guide really useful, thank you very much. But I got stuck on some bit =X I can’t find the syncml-obex-client…
    I’m using Ubuntu 10.04 with Gnome and my mobile is a E63.

    When I try “sudo apt-get install opensync-plugin-file opensync-plugin-syncml” on the Terminal, it says opensync-plugin-syncml couldn’t be found. Is it gnome’s fault or anything else you would know?

    Hope you can help =]

    • It seems that the package opensync-plugin-syncml doesn’t exist for 10.04 but only on previous versions. Not sure why… Sorry.

      EDIT: One quick solution is to download the DEB from the previous Ubuntu Releases and install it manually.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s