Syncing Windows Mobile 5/6 with Synce (updated)

2008/07/30 by Paulo Pereira

~/categories/Linux #Linux #Ubuntu #Synce #Qtek 9100

One of my “to achieve” points was syncing my calendar and contact information from my Windows Mobile 5.0 Smartphone (Qtek 9100).

After trying for some time, I used a tip from Synce mailing lists. This tip was great for me because the author was also having troubles and started from scratch.

I think my problem was the config.xml file. I believe that if I just followed the instructions from the good folks from Synce, as I first did, but changed the config.xml, as in the mailing list, I wouldn’t have needed to clean my system.

So, if you are starting, you probably could skip the “clean your system” part.

I will show how I’m syncing my phone with Evolution using Synce in Ubuntu 8.04. This is based in Synce wiki and Synce mailing lists.

Note: save this post if you’re using Gnome Network Manager, because you’ll probably stay without Internet after installing the core libraries. It’s very easy to fix though.

Disclaimer

This is not an official Synce guide. This is my personal eXPerience using a single device, with a single WM flavor and a single OS.

If you are starting to play around with Synce, this post could help you if you’re using the same WM and Linux OS’s, but you should always check Synce official wiki for updates.

If you are having problems, the Synce mailing lists are probably the best place to go right now. The people are friendly and will help you solving your problems. You could also send me an email. If I can, I’ll help, if not, I’ll guide you in the right direction.

My setup

This is my current environment:

Adding repositories

deb http://ppa.launchpad.net/synce/ubuntu hardy main

Kernel module (for Kernel < 2.6.24-19)

If you’re using Kernel 2.6.24-19 or newer you should skip this part.

sudo rmmod rndis_host cdc_ether usbnet
sudo rm /lib/modules/`uname -r`/kernel/drivers/net/usb/{rndis_host,cdc_ether,usbnet}.ko
sudo apt-get install usb-rndis-source cdbs
sudo module-assistant auto-install usb-rndis

Every time you update your system kernel redo this steps. Everything should be fine again :-)

My eXPerience with Kernel 2.6.24-19 in Ubuntu 8.04 Hardy Heron:

Although Synce official wiki recommends skipping this step for kernel 2.6.24-19 and newer, I had to redo this steps through all 2.6.24-19 kernel updates Hardy as been getting out. If you’re using this kernel try first skipping this step and if you have no joy redo them.

I realize something is wrong if my Internet connection is lost when I connect my device. ifconfig returns eth1 instead of rndis0 (see the “Gnome Network Manager” bellow).

Core libraries

sudo apt-get install odccm librra0-tools librapi2-tools
synce-pls

You should see a list of files on your device. If so you have a working connection to your device!

Password protected device

When running synce-pls, if you have the following error, your device is password protected. If so, install SynCE-GNOME or SynCE-KPM to provide a password prompt on device connect.

I didn’t try this because my device isn’t password protected…

WARNING **: synce_info_from_odccm: Failed to get a connection for :
 Not authenticated, you need to call !ProvidePassword with the
 correct password. pls: Could not find configuration at path
 '(Default)' 

Gnome Network Manager

If you’re running Gnome Network Manager you don’t have Internet by now because your phone is now the new default network connection.

Follow this and you should be fine:

ifconfig -a | grep 80:00:60:0f:e8:00 | cut -d " " -f 1
sudo vi /etc/network/interfaces
iface rndis0 inet dhcp
sudo /etc/init.d/networking restart 

No devices are connected to odccm

If you get an error that no devices are connected to odccm you should probably blacklist ipaq module:

sudo vi /etc/modprobe.d/blacklist
blacklist ipaq
sudo rmmod ipaq

Clean your system

If you have been playing around with Synce without success you may want to clean your system before continuing.

Check this tip for more info.

dpkg-query -l *sync*
dpkg-query -l *dccm*
dpkg-query -l *rra*
dpkg-query -l *rapi*
dpkg-query -l *multis*
dpkg-query -l *opensync*
sudo apt-get remove libsynce0 multisync-tools opensync-module-python \
 opensync-plugin-evolution opensync-plugin-synce python-opensync \
 synce-kpm synce-sync-engine
sudo apt-get remove odccm
sudo apt-get remove librra0 librra0-tools
sudo apt-get remove librapi2 librapi2-tools
sudo apt-get remove multisync-tools
sudo apt-get remove libopensync0
rm -rf ~/.synce
sudo rm -f /usr/lib/opensync/python-plugins/synce-opensync-plugin-2x.pyc 

Syncing with OpenSync (needed packages)

In order to sync your device you need to use OpenSync.

sudo apt-get install odccm librra0-tools librapi2-tools multisync-tools \
 opensync-plugin-kdepim opensync-plugin-synce
sudo apt-get install multisync-tools opensync-plugin-evolution opensync-plugin-synce 

Sync-engine

Sync-engine must be running in order to sync your phone.

cd ~/.synce/
wget http://synce.svn.sf.net/svnroot/synce/trunk/sync-engine/config/config.xml

Now the tip. The current config.xml has the AutoSyncCommand and the Disable commented. Uncommented, leaving it disabled.

cd ~/.synce/
wget http://lofspot.net/synce/config.xml
synce-sync-engine

Connect your phone via usb. You shouldn’t get any errors.

Create a partnership

You have to create a partnership between device and computer using one of two methods:

  1. Via command line
  2. Using synce-kpm (graphical and I recommend)

(1) You can then use the command

synce-create-partnership "Linux desktop" "Contacts,Calendar"

The “Linux desktop” string can be any string of 20 characters or less. The available items for synchronization are:

When specifying items to sync, they must be separated by commas. You must also surround the list in double quotes and the string must not contain any whitespace.

(2) Or install synce-kpm

$ sudo apt-get install synce-kpm

Now run synce-kpm

$ synce-kpm

Go to Partnership manager. You probably have already partnerships created if you ever synced your phone under Windows.

I chose to start by deleting my existing partnerships and start from scratch, but, as pointed out by Guido Diepen: if your device runs WM6 this will erase all your contacts/tasks/calendar. So do not delete your partnership if you’re running WM6 and your want to keep your data in the device.

In my case, having WM5, I’ve deleted every partnerships and created a new one. I chose to sync Calendar, Contacts and Tasks.

synce-opensync-plugin

Check the list of the available plugins:

msynctool --listplugins

You should have synce-opensync-plugin.

If you don’t see the above plugin in the output of msynctool, then download the plugin and copy this file to /usr/lib/opensync/python-plugins.

I already had the plugin.

Create OpenSync group

A group between SynCE and your chosen PIM application must be initiated.

I’m using Evolution (evo2-sync).

msynctool --addgroup synce-sync
msynctool --addmember synce-sync synce-opensync-plugin
msynctool --addmember synce-sync evo2-sync 

Syncing your device (finally)

synce-sync-engine
synce-kpm
msynctool --sync synce-sync

This could take some time the first time, so be patient. You can check your progress in synce-kpm.

After the msynctool command ends completely, check Evolution :-)

Important: keep your device on, so the synchronization isn’t interrupted.

Firewall

If you have a firewall active, and you’re having troubles syncing your device try to disable it.

Inconsistencies while syncing

While syncing kepp an eye out in you console. I had some inconsistencies in my data (contacts) than I had to resolve by selecting witch version of a contact I would like to keep.

If I have another one I’ll post an example.

Day to day config

To simplify I created a script to synchronize my phone.

touch sync_smartphone.sh
chmod a+x sync_smartphone.sh
vi sync_smartphone.sh

Add to the file:

#!/bin/bash
echo ""
echo ""
echo "---> disconnect your device"
echo ""
sleep 10
sudo ufw disable
echo ""
echo "---> connect your device"
echo ""
sleep 10
synce-sync-engine > engine.log &
sleep 20
synce-kpm > kpm.log &
sleep 20
msynctool --sync synce-sync > synctool.log
sleep 10
sudo ufw enable

Now connect your phone, run sync_smartphone.sh and check your progress in synce-kpm graphical UI.

Update: I had to my script disable/enable ufw firewall commands and logging to synce engine, synce-kpm and mysynctool.

Please, feel free to post a comment or email me at lof-ubuntu-xp [(at)] lofspot.net.

This is just a “this is how I did it” post. I probably won’t be able to help you, especially in another distribution/version or phone, still feel free to share your experience.

Synce 0.12 Update

If you updated Synce to version 0.12 using Update Manager, you may me incapable of select the package synce-sync-engine for update.

Although this package wasn’t updated, my config worked fine and without any change.

This version of Synce replaced the odccm daemon with synce-hal, and, basically, this is the problem. Update Manager doesn’t seem to know what to do.

So, go to System > Administration > Synaptic Package Manager, look for synce-sync-engine, right click the package and select “Mark for Upgrade”. This will uninstall the odccm package and install synce-hal.