SyncEngine
From SynCE-Wiki
Contents |
Installation
Make Backups!
Before you begin, be sure to make backups of all your contacts, events, etc on your device and on your computer! To make a backup of the PIM data on your device, see these instructions.
Firewall Configuration
You will need to configure your firewall to allow TCP connections from the device. Specifically, the firewall rules must allow TCP connections over the network interface you configured in Starting A Connection (usually rndis0) on the following ports:
- 999
- 5678
- 26675
Prerequisites
guide to get your SynCE up and running with your Windows Mobile 2005 device.
- libopensync >= 0.21
- libopensync-plugin-python >= 0.21
- msynctool >= 0.21
- 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
- libxslt
- python-libxslt1
- libexpat1-dev
- python2.4-dev
- pyxml
- swig
- libsqlite3-dev (Note, this package could be necessary...)
- libmimedir0
- libmimedir-dev
Downloading and Installing software
Using sudo
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
rra
Grab 0.10 release:
wget http://downloads.sourceforge.net/synce/synce-rra-0.10.0.tar.gz tar -zxf synce-rra-0.10.0.tar.gz cd synce-rra-0.10.0
OR from SVN:
svn co https://synce.svn.sourceforge.net/svnroot/synce/trunk/rra cd rra ./bootstrap
There is a bug in Kubuntu 7.04 (Debian??), you must create a symbolic link for Python:
sudo ln -s /usr/lib/libpython2.5.so /usr/lib/libpython.so
Then, build and install:
./configure make sudo make install cd ..
librtfcomp
Grab 0.10 release:
wget http://downloads.sourceforge.net/synce/librtfcomp-1.1.tar.gz tar -zxf librtfcomp-1.1.tar.gz cd librtfcomp-1.1
OR from SVN:
svn co https://synce.svn.sourceforge.net/svnroot/synce/trunk/librtfcomp cd librtfcomp ./bootstrap
Then, build and install:
./configure make sudo make install cd ..
wbxml2
Grab version distributed with 0.10 release:
wget http://downloads.sourceforge.net/synce/wbxml2-0.9.2+svn49synce.tar.gz tar -zxf wbxml2-0.9.2+svn49synce.tar.gz cd wbxml2-0.9.2+svn49synce
OR from SVN:
svn co https://synce.svn.sourceforge.net/svnroot/synce/trunk/patches svn co http://libwbxml.aymerick.com:8080/repo/wbxml2/trunk wbxml2 cd wbxml2 patch -p1 < ../patches/wbxml-svn-r48-build.patch patch -p1 < ../patches/wbxml-svn-r48-anonymous.patch patch -p1 < ../patches/wbxml-svn-r48-namespace.patch chmod +x bootstrap ./bootstrap
Then, build and install:
./configure make sudo make install cd ..
pywbxml
Grab 0.10 release:
wget http://downloads.sourceforge.net/synce/pywbxml-0.1.tar.gz tar -zxf pywbxml-0.1.tar.gz cd pywbxml-0.1/
OR from SVN:
svn co https://synce.svn.sourceforge.net/svnroot/synce/trunk/pywbxml cd pywbxml/ ./bootstrap
Then, build and install:
./configure make sudo make install cd ..
sync-engine
Grab 0.10 release:
wget http://downloads.sourceforge.net/synce/synce-sync-engine-0.10.0.tar.gz tar -zxf synce-sync-engine-0.10.0.tar.gz cd synce-sync-engine-0.10.0
OR from SVN:
svn co https://synce.svn.sourceforge.net/svnroot/synce/trunk/sync-engine cd sync-engine
OpenSync
Determine the full path to where OpenSync's python plugins are installed. This is usually one of the following:
- /usr/lib/opensync/python-plugins/
- /usr/lib/opensync/plugins/
- /usr/local/lib/opensync/python-plugins/
This path will be referred to as PLUGIN_DIR below.
Determine the full path to the sync-engine directory created in the previous step. This path will be referred to as SYNC_ENGINE_DIR below.
Make a symbolic link to the synce plugin:
sudo ln -sf SYNC_ENGINE_PATH/opensync-plugin.py PLUGIN_DIR/synce.py
Be sure that OpenSync is aware of the new plugin. If you execute the command msynctool --listplugins you should see output similar to the following:
Available plugins: ... synce-plugin ...
Troubleshooting
Using sync-engine
Starting sync-engine
Before you start sync-engine, it is necessary to copy the basic configuration file to your home directory. If you would like to sync files, you need to edit the file as well. In the sync-engine directory, type:
mkdir ~/.synce cp config.xml ~/.synce
To sync files, you need to create a local path to mirror the files on the handheld:
mkdir ~/PDAFiles
Now you can start SyncEngine by entering:
./sync-engine
To test that it works, execute the following in a new console:
(cd sync-engine/tools && ./list_partnerships.py)
This will list any partnerships already configured on your device.
Configuration
Configuration of sync-engine is accomplished through the ~/.synce/config.xml file. This can be edited in your favourite text editor. The basic default config.xml reads as follows:
<?xml version="1.0" ?>
<syncengine-config>
<Global>
<SlowSyncDisable>0</SlowSyncDisable>
<!--
AuthMethod can be one of the following:
INTERNAL_GUI uses internal GUI auth prog
INTERNAL_CLI uses internal console auth prog
[pathname_to_prog] uses external auth prog
Note: INTERNAL_GUI uses GTK to display the box.
INTERNAL_CLI uses the console and will work on systems without GTK
If this element is not specified, the default will be INTERNAL_CLI
-->
<AuthMethod>INTERNAL_GUI</AuthMethod>
</Global>
<Autosync>
<AutoSyncCommand>xterm -e msynctool --sync wm5sync</AutoSyncCommand>
<Disable>1</Disable>
</Autosync>
<FileSync>
<LocalFilePath>/nfshomes/jgow/PDAFiles</LocalFilePath>
<Disable>0</Disable>
<LocalUpdateFreq>10</LocalUpdateFreq>
<ExtraDeleteDelay>0</ExtraDeleteDelay>
<ObjectReportTimeout>8</ObjectReportTimeout>
</FileSync>
</syncengine-config>
Each aspect of sync-engine is controlled by the appropriate XML stanza. Taking these in turn:
- <Global> - general sync-engine configuration.
- <SlowSyncDisable> - control slow sync behaviour
- can be '1' or '0', default is '0'
- If set to '1', the internal slow sync database used by sync-engine to facilitate OpenSync's slow-sync mode will be disabled. You probably do not want this, so leave it set to '0'. Its primary use is in debugging/testing, or if OpenSync changes the way in which slow sync is carried out.
- <AuthMethod> - select authorization method for password-protected devices
- can be 'INTERNAL_GUI', 'INTERNAL_CLI' or <path-to-program>, default is INTERNAL_CLI
- INTERNAL_GUI - will use GTK to pop up a box asking for the password when a password-protected handheld is connected.
- INTERNAL_CLI - will provide a password request in the sync-engine console when a password-protected handheld is connected.
- <path_to_program> - Path to a user-provided executable program to perform the authorization. The program should take a single string command line argument consisting of the d-bus objectID and should return an exit code of nonzero if successfully authorized, zero if not.
- <SlowSyncDisable> - control slow sync behaviour
- <Autosync> - control device-triggered synchronization.
- <AutoSyncCommand> - command run by sync-engine in response to a device-triggered synchronization
- can be set to any executable program specified by the user
- The default, in the absence of this element, is an empty path - nothing is run. The config.xml file provided in the sync-engine distribution contains a command to run msynctool in an xterm, as an example of how this can be used.
- <Disable> - disable or enable device-triggered synchronization
- can be '1' or '0', default is '1'
- if set to '1', device-triggered synchronizations will have no effect and <AutoSyncCommand> will be ignored
- if set to '0', and <AutoSyncCommand> contains a valid path, then the executable specified in <AutoSyncCommand> will be run when the handheld triggers an automatic synchronization
- <AutoSyncCommand> - command run by sync-engine in response to a device-triggered synchronization
- <FileSync> - control file synchronization. Note that file synchronization is independent from PIM data synchronization, and is handled entirely within sync-engine (does not use OpenSync).
- <LocalFilePath - the path to the directory on the desktop that will mirror the handheld.
- This should point to a valid path to a directory. When first creating the partnership, ensure this directory is empty.
- <Disable> - disable or enable file synchronization
- can be '1' or '0', default is '1'
- if set to '1', no file synchronization will take place
- if set to '0', file synchronization will be enabled
- <LocalUpdateFreq> - additional delay in approximate seconds between local directory scans.
- Actual delay is <LocalUpdateFreq>+10. The default is '10' and should not need to be reduced below this figure.
- Increasing it will increase the delay between local files being written and them being reflected on the handheld
- <ExtraDeleteDelay> - controls the delay between a local object being scheduled for deletion and the delete occurring
- Default is '0' and it should not be necessary to change this value unless you have a slow handheld.
- <ObjectReportTimeout> - controls the amount of time we wait for the device to make its initial object list report
- Default is '8' and it should not be necessary to change this value unless you have a slow handheld - OK to increase this but it should not be decreased.
- <LocalFilePath - the path to the directory on the desktop that will mirror the handheld.
The configuration file is read both when sync-engine is started, and again when a device is reconnected after having been disconnected. This allows changes to be made to the configuration of a running sync-engine without stopping it; the changes to be picked up when the device is re-plugged.
Managing Partnerships
First, open a new console and change to the sync-engine/tools directory:
cd sync-engine/tools
Create a partnership between your Linux computer and the device:
./create_partnership.py "Linux desktop" "Contacts,Calendar"
The "Linux desktop" string can be any string of 20 characters or less.
The available items for synchronization are:
Contacts Calendar Tasks Files
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.
Ensure that the newly-created partnership is selected as the current partnership
./select_partnership.py
Configuration File
Troubleshooting
OpenSync
Configuration
First, create an OpenSync group for synchronization, and add the SynCE plugin to the group:
msynctool --addgroup pda-sync msynctool --addmember pda-sync synce-plugin
Evolution
Add the Evolution plugin to the group:
msynctool --addmember pda-sync evo2-sync msynctool --configure pda-sync 2
Kontact
Add the KDE-Pim plugin to the group:
msynctool --addmember pda-sync kdepim-sync
Note: There may be issues under KDE-Pim with event times being off by an hour, especially in the case of recurring events that span a Daylight Savings Time transition. The cause might be this this bug.
Troubleshooting
Synchronization
Contacts, Calendar, Tasks
Manual
Triggered from OpenSync
Tell OpenSync to start the synchronization:
msynctool --sync pda-sync
