Syncing via OpenSync


From SynCE-Wiki

Windows Mobile 2005 Support: Installing SynCE, Connecting Your Device, Using SynCE, Troubleshooting

The following guide has been tested on:

  • Gentoo Gentoo (Portage date: Jan 25, 2007 16:59:14)

Contents

Prequisities

guide to get your SynCE up and running with your Windows Mobile 2005 device.

  • udev -> make sure that udev->hald->dbus-daemon (ps aux | grep -E "hald|dbus-daemon|udevd") are all running
  • dbus >= 0.60 and its python bindings (e.g. python2.4-dbus, or for Gentoo users: dbus-python)
  • python2.4-gobject (Note, this package could be necessary...)
  • python2.4-pyrex
  • python-pyrex
  • python2.4-xml
  • libxml2-dev
  • libexpat1-dev
  • python2.4-dev
  • swig
  • libsqlite3-dev (Note, this package could be necessary...)

Downloading and Installing software

In the following instructions, the sudo command is used. If you are unfamiliar with this command, then use su. To follow the instructions, you must replace this command:

sudo make install

with these commands:

su
(enter root password)
make install
exit

sudo executes one command as the super-user. In the second set of commands, the user enters super-user mode by executing su, carries out the command in the instructions, and then leaves super-user mode.

Preparation

Ensure that the path /usr/local/lib/python2.4/site-packages is in your PYTHONPATH environment variable:

export PYTHONPATH=$PYTHONPATH:/usr/local/lib/python2.4/site-packages

pyrapi2

To install pyrapi2 do the following steps:

svn co https://synce.svn.sourceforge.net/svnroot/synce/trunk/pyrapi2
cd pyrapi2/
./bootstrap
./configure
make
sudo make install

Note: If you see this error: No package 'librapi2' found, you must execute the following:

echo "/usr/local/lib" | sudo tee -a /etc/ld.so.conf
sudo ldconfig

wbxml2

To install wbxml2 do the following steps:

wget http://prdownloads.sourceforge.net/wbxmllib/wbxml2-0.9.2.tar.gz
  • Get the patches from SynCE's Subversion repository:
svn co https://synce.svn.sourceforge.net/svnroot/synce/trunk/oleavr-files/patches
  • Extract, patch, compile and install it:
tar zxf wbxml2-0.9.2.tar.gz
cd wbxml2-0.9.2
bzcat ../patches/wbxml2-0.9.2-anonymous-support-and-misc-fixes.patch.bz2 | patch -p1
cat ../patches/wbxml2-0.9.2-namespaces.patch | patch -p1
chmod +x bootstrap
./bootstrap
./configure
make
sudo make install
cd ..

Note: if your patches folder is located in /patches you can delete .. in bzcat and cat commands (Ubuntu users)

pywbxml

To install pywbxml do the following steps:

svn co https://synce.svn.sourceforge.net/svnroot/synce/trunk/oleavr-files/pywbxml
cd pywbxml/
./bootstrap
./configure
make
sudo make install
cd ..

sync-engine-python

To checkout SyncEngine do the following steps:

svn co https://synce.svn.sourceforge.net/svnroot/synce/trunk/sync-engine

SyncEngine

Now you can start the SyncEngine by entering:

./sync-engine/sync-engine

Troubleshooting

sync-engine refuses to start

If sync-engine refuses to start, check whether dbus-daemon is running like a normal user, and that DBUS_SESSION_BUS_ADDRESS exist in the environment. If this environmental variable doesn't exist, start dbus-daemon like:

dbus-daemon --session --print-address

Copy the output of this command, and paste it in at the end of this command:

export DBUS_SESSION_BUS_ADDRESS=

Make sure this variable exists in the terminal you run the commands below.

SyncEngine tools

After starting the SyncEngine you can test it in another terminal window:

cd sync-engine/tools/
./list_partnerships.py

You should be fine if you get a list of all partnerships created on your device, like this:

ID: 0x3bfa63e8
Name: 'Sony'
Host: 'SONY'
Items: [ Calendar Tasks Notes Contacts ]
1 partnership

If you are just starting to use your device with SynCE, you should create a new partnership:

./create_partnership.py "Linux desktop" "Contacts,Calendar"

"Linux desktop" is a string with a maximum of 20 chars describing the partnership. The last parameter is a comma-seperated list (with no whitespaces) of itmes to sync. Only Contacts and Calendar are currently available.

Note: At the moment, the sync process does not work very well (you cannot determine which partnership will be used), when you have more than one partnership on the device. So, as of now, you should delete your old windows partnership (after you made a backup, of course!!).

Syncing with OpenSync

Generic

OpenSync has released a new version (0.21), therefore, the current SVN
has moved to the development for v0.30 and a checkout does not compile.
Instead, please download and install the following files
[successfully tested with XDA Neo (HTC Prophet)]:

http://www.opensync.org/attachment/wiki/download/libopensync-0.21.tar.bz2?rev=&format=raw
http://www.opensync.org/attachment/wiki/download/libopensync-plugin-evolution2-0.21.tar.bz2?rev=&format=raw
http://www.opensync.org/attachment/wiki/download/libopensync-plugin-kdepim-0.21.tar.bz2?rev=&format=raw
http://www.opensync.org/attachment/wiki/download/libopensync-plugin-python-0.21.tar.bz2?rev=&format=raw
http://www.opensync.org/attachment/wiki/download/msynctool-0.21.tar.bz2?rev=&format=raw
http://www.opensync.org/attachment/wiki/download/multisync-gui-0.91.0.tar.gz?rev=&format=raw

ALTERNATIVE: #Gentoo users, can emerge the latest ebuilds.


Essentially, you should be able to compile all of them by doing the following steps:

tar -xjvf <PACKAGE_FILE>.tar.bz2
  or
tar -xzvf <PACKAGE_FILE>.tar.gz
cd PACKAGE_DIRECTORY/
./autogen.sh [needed for opensync and multisync-0.90, for evolution2 and python-module use "autoreconf -i"]
./configure [unless it was called by autogen.sh in the previous step]
make
sudo make install

Compiling these packages will install OpenSync on your computer, however we need to install the OpenSync plugin for the SyncEngine.


Make a symbolic link to the plugin, first making sure that /usr/local/lib/opensync/python-plugins/ exists:

sudo ln -sf /path/to/sync-engine/opensync-plugin.py /usr/local/lib/opensync/python-plugins/synce.py

where /path/to/sync-engine is the full path of the sync-engine you checked out above.

To see if everything went alright, you can list all available plugins by executing msynctool --listplugins:

msynctool --listplugins
Available plugins:
evo2-sync
testmodule
synce-plugin

Gentoo

This is an alternative way to install the opensync packages.

You can simply emerge:

ACCEPT_KEYWORDS="~x86" emerge libopensync libopensync-plugin-evolution2 libopensync-plugin-kdepim libopensync-plugin-python msynctool  

NOTE: It is better to add these packages to /etc/portage/package.keywords

Also, don't forget to set your PKG_CONFIG_PATH

PKG_CONFIG_PATH=/usr/local/lib/pkgconfig

If you haven't done this on your default gentoo system, you will have some problems with the custom installed packages outside of portage.

Do the Sync

With SyncEngine running and working, you should now be able to sync your device:

Evolution

msynctool --addgroup evo2-sync
msynctool --addmember evo2-sync evo2-sync
msynctool --addmember evo2-sync synce-plugin
msynctool --configure evo2-sync 1

After the last command an editor will show up to edit your sync configuration. Set <address_path/> and <calendar_path/> to contain just default, and leave <task_path/> empty.

Finally, with fingers crossed:

msynctool --sync evo2-sync

Note: You may have to add a contact to the evolution address book to initialize it, much like a mailbox.
Second note: It would be a good idea to backup your device before syncing and maybe deleting all contacts from evolution to avoid duplicates and the likes thereof.

Kontact

msynctool --addgroup kdeSyncWM5
msynctool --addmember kdeSyncWM5 kdepim-sync
msynctool --addmember kdeSyncWM5 synce-plugin

Finally, with fingers crossed:

msynctool --sync kdeSyncWM5