Using the SyncML Plugin
The syncml plugin is a plugin that allows OpenSync to be synchronized against SyncML capable devices. The plugin supports the protocol version 1.0, 1.1 and 1.2. Available transports are http and obex.
The guide contains 3 parts: Installing libsyncml, installing the syncml plugin and configuring the sync group.
Libsyncml
You will need a library called libsyncml that is capable of parsing syncml messages. But first we need to install some patched libraries: Before you can install libsyncml you must have these packages installed: libopensync libopensync-devel
All steps, except the "make install" ones, dont require root privileges
Before you start you should have opensync itself and a gui/cli installed. See the InstallGUide? for more info.
First we need the latest openobex lib with usb support. You can download it from http://prdownloads.sourceforge.net/openobex/openobex-1.1.tar.gz?download.
Unpack the openobex library, configure and install it.
First check out libsyncml from subversion:
svn co http://svn.opensync.org/libsyncml/trunk libsyncml
Then check out the latest libsoup from gnome cvs. There are some required patches in there:
cvs -d :pserver:anonymous@anoncvs.gnome.org:/cvs/gnome co libsoup
Now run autogen.sh, configure and install libsoup. Yo will need an automake>=1.9
Also, please make sure that you are using at least wbxml 0.9.2 or a patched version 0.9.0. If you dont have the patched wbxml library please download wbxml2 from http://sourceforge.net/project/showfiles.php?group_id=55834&package_id=77694. Then apply the patch from misc/wbxml2-0.9.0.patch to the library and install it.
At least for Debian Users there are some Bugs/Flaws in the lib. See Bug 487217 for details. You need to rebuild the library.
Then build and install libsyncml
cd libsyncml autoreconf -sfi ./configure make install
Now go on to installing the syncml plugin:
The SyncML Plugin
To install the plugin please do:
svn co http://svn.opensync.org/plugins/syncml/ syncml-plugin cd syncml-plugin autoreconf -sfi ./configure make make install
Check that it installed correctly:
msynctool --listplugins
should return:
Available plugins: syncml-http-server syncml-obex-client
Configuring the SyncML Plugin
Create a new group following this guideline?. But instead of using 2 file-sync plugins, use 1 file-sync plugin and 1 syncml-http-server or syncml-obex-client plugin.
The config for the syncml-http-server plugin looks like this:
<?xml version="1.0"?> <config> <!-- username to use. Leave empty to not require a username --> <username></username> <!-- the password for the username --> <password></password> <!-- The url that you want the server to listen on. This has to be set on the mobile as well. example: "/" --> <url></url> <!-- The port where to listen. This has to be set on the mobile as well. --> <port>8080</port> <!-- If wbxml is enabled, defines wether the wbxml should use string tables --> <usestringtable>0</usestringtable> <!-- Never send ADD command, but send REPLACE (not needed normally) --> <onlyreplace>0</onlyreplace> <!-- Workaround around for mobile phones which only use local timestamps and _no_ UTC timestamps! --> <onlyLocaltime>0</onlyLocaltime> <!-- Sets the maximum allowed size in bytes of incoming messages (some device need this option set). Example: 10000 --> <recvLimit>0</recvLimit> <maxObjSize>0</maxObjSize> <!-- The name of the contacts db. Must be the same as the phones sends --> <contact_db>contacts</contact_db> <!-- The name of the calendar db. Must be the same as the phones sends --> <calendar_db>calendar</calendar_db> <!-- The name of the note db. Must be the same as the phones sends --> <note_db>notes</note_db> </config>
The options are:
- username: The username to use. Leave empty to not require a username
- password: the password for the username
- url: The url that you want the server to listen on. This has to be set on the mobile as well. example: "/"
- port: The port where to listen. This has to be set on the mobile as well.
- userstringtable: If wbxml is enabled, defines wether the wbxml should use string tables
- onlyreplace: Never send ADD command, but send REPLACE (not needed normally)
- recvLimit: Sets the maximum allowed size in bytes of incoming messages (some device need this option set). Example: 10000
- contact_db: The name of the contacts db. Must be the same as the phones sends
- calendar_db: The name of the contacts db. Must be the same as the phones sends
- note_db: The name of the contacts db. Must be the same as the phones sends
The config for the syncml-obex-client plugin looks like this:
<?xml version="1.0"?> <config> <!-- (Only for bluetooth) The bluetooth address if the bluetooth mode is selected --> <bluetooth_address></bluetooth_address> <!-- (Only for bluetooth) The bluetooth channel to use. `sdptool browse $MAC` to search for the correct channel --> <bluetooth_channel></bluetooth_channel> <!-- (Only for USB) The usb interface number of the SYNCML-SYNC target. use syncml-obex-client -u (you will need access to the USB raw device) to find it. --> <interface>0</interface> <!-- The string that the plugin will use to identify itself. Some devices need a special string here. --> <identifier></identifier> <!-- The syncml version to use: 0 for 1.0, 1 for 1.1 and 2 for 1.2 --> <version>1</version> <!-- if the plugin should use wbxml --> <wbxml>1</wbxml> <!-- The username to use. Leave empty to not require a username --> <username></username> <!-- the password for the username --> <password></password> <!-- sets the connection type to use. 5 means obex over usb, 2 means obex over bluetooth --> <type>2</type> <!-- If wbxml is enabled, defines wether the wbxml should use string tables --> <usestringtable>0</usestringtable> <!-- Never send ADD command, but send REPLACE (not needed normally) --> <onlyreplace>0</onlyreplace> <!-- Workaround around for mobile phones which only use local timestamps and _no_ UTC timestamps! --> <onlyLocaltime>0</onlyLocaltime> <!-- Sets the maximum allowed size in bytes of incoming messages (some device need this option set). Example: 10000 --> <recvLimit>0</recvLimit> <maxObjSize>0</maxObjSize> <!-- The name of the contacts db. Must be the same as the phones sends --> <contact_db>Contacts</contact_db> <!-- The name of the calendar db. Must be the same as the phones sends --> <calendar_db>Calendar</calendar_db> <!-- The name of the note db. Must be the same as the phones sends --> <note_db>Notes</note_db> </config>
The options are:
- bluetooth_address: (Only for blue) The bluetooth address if the bluetooth mode is selected
- bluetooth_channel: (Only for blue) The bluetooth channel to use (usualy the 11) [x]
- interface: (Only for USB) The usb interface number of the SYNCML-SYNC target. use syncml-obex-client -u (as root!) to find it.
- identifier: The string that the plugin will use to identify itself. Some devices need a special string here.
- version: The syncml version to use: 0 for 1.0, 1 for 1.1 and 2 for 1.2
- wbxml: if the plugin should use wbxml
- username: The username to use. Leave empty to not require a username
- password: the password for the username
- type: sets the connection type to use. 5 means obex over usb, 2 means obex over bluetooth
- userstringtable: If wbxml is enabled, defines wether the wbxml should use string tables
- onlyreplace: Never send ADD command, but send REPLACE (not needed normally)
- recvLimit: Sets the maximum allowed size in bytes of incoming messages (some device need this option set). Example: 10000
- contact_db: The name of the contacts db. Must be the same as the phones sends
- calendar_db: The name of the contacts db. Must be the same as the phones sends
- note_db: The name of the contacts db. Must be the same as the phones sends
[x] If you are using bluetooth, you can locate your SyncML channel (different from the OBEX one!) using the command "sdptool browse XX:XX:XX:XX:XX:XX" (XX:XX:XX:XX:XX:XX is the MAC of your device)!!
Now to synchronization: If you use the syncml-http-server you have to use a special option since this plugin is a server and it cannot be synced like a normal plugin. Instead it has to listen for incoming connections like this:
msynctool --sync groupname --wait
Now it sits waiting for incoming connections. Once you tell the phone to connect you should see something like this:
Synchronizing group "syncml" Member 2 of type file-sync just connected Member 1 of type syncml-http-server just connected All clients connected or error Member 2 of type file-sync just sent all changes Member 1 of type syncml-http-server just sent all changes All clients sent changes or error Member 2 of type file-sync just committed all Member 2 of type file-sync just disconnected Member 1 of type syncml-http-server just committed all All clients have writen Member 1 of type syncml-http-server just disconnected All clients have disconnected The sync was successfull
if you use the syncml-obex-client, you can just use the normal --sync option. Note that you have to run the msynctool as root to access the usb devices (normally).
Known Configurations
Important note On OBEX (whether over bluetooth or USB), for all newer Sony Ericsson phones, the <identifier> is "Sony Ericss" and for all newer Nokia phones, the <identifier> is "PC Suite". The main trick in finding the right configuration also depends upon finding the right <contact_db>, <calendar_db> and <note_db> strings. Although the only foolproof way is sniffing, some suggestions are helpful:
- <contact_db>: Contacts, Addressbook
- <calendar_db>: Calendar, Agenda
- <note_db>: Notes, Tasks
Sony Ericsson K750i (using OBEX over USB)
<config> <interface>0</interface> <identifier>Sony Ericss</identifier> <version>1</version> <wbxml>1</wbxml> <username></username> <password></password> <type>5</type> <usestringtable>0</usestringtable> <onlyreplace>0</onlyreplace> <onlyLocaltime>0</onlyLocaltime> <recvLimit>0</recvLimit> <maxObjSize>0</maxObjSize> <contact_db>Contacts</contact_db> <calendar_db>Agenda</calendar_db> <note_db>Notes</note_db> </config>
Notes for Sony Ericsson K750i configuration The synchronisation succeeds only on contacts. Calendar sync with explicit vevent10 and vevent20 events fed in from the file-sync plugin fail with error 500. The calendar issue requires some further investigation and we are unable to presently determine the exact problem. We apologise for the inconvinience.
Samsung i520 (OBEX over Bluetooth)
<bluetooth_address>XX:XX:XX:XX:XX:XX</bluetooth_address> <bluetooth_channel>10</bluetooth_channel> <identifier>PC Suite</identifier> <version>1</version> <wbxml>1</wbxml> <username></username> <password></password> <type>2</type> <usestringtable>0</usestringtable> <onlyreplace>0</onlyreplace> <recvLimit>0</recvLimit> <maxObjSize>0</maxObjSize> <contact_db>Contacts</contact_db> <calendar_db>Calendar</calendar_db> <note_db>Notes</note_db>
The synchronisation succeeds on contacts and calendar. Tested on Ubuntu 8.04.2
Nokia N73
<bluetooth_address>XX:XX:XX:XX:XX:XX</bluetooth_address> <bluetooth_channel>10</bluetooth_channel> <identifier>PC Suite</identifier> <version>1</version> <wbxml>1</wbxml><username></username><password></password> <type>2</type> <usestringtable>1</usestringtable> <onlyreplace>0</onlyreplace> <recvLimit>10000</recvLimit> <maxObjSize>0</maxObjSize> <contact_db>Contacts</contact_db> <calendar_db>Calendar</calendar_db> <note_db>Notes</note_db>
Notes for Nokia N73 configuration Partial success with bluetooth (calendar, todo, addresses). There are issues, though: the sync fails frequently (including phone crashes), and hangs most often when syncing calendar and contacts together. When that happens, a slow sync follows and contacts and events get duplicated. Works best if syncing only contacts (config the phone to control this).
Nokia 6680 (using obex over USB)
<config> <interface>0</interface> <identifier>PC Suite</identifier> <version>1</version> <wbxml>1</wbxml> <username></username> <password></password> <type>5</type> <usestringtable>1</usestringtable> <onlyreplace>0</onlyreplace> <recvLimit>10000</recvLimit> <contact_db>Contacts</contact_db> <calendar_db>Calendar</calendar_db> <note_db>Notes</note_db> </config>
Nokia 6680 (using http)
<config> <username></username> <password></password> <url>/</url> <port>8080</port> <usestringtable>1</usestringtable> <onlyreplace>0</onlyreplace> <recvLimit>10000</recvLimit> <contact_db>Contacts</contact_db> <calendar_db>Calendar</calendar_db> <note_db>Notes</note_db> </config>
Nokia 6230i (using obex over bluetooth)
<config> <bluetooth_address>XX:XX:XX:XX:XX:XX</bluetooth_address> <bluetooth_channel>11</bluetooth_channel> <identifier>opium</identifier> <version>1</version> <wbxml>1</wbxml><username></username><password></password> <type>2</type> <usestringtable>1</usestringtable><onlyreplace>0</onlyreplace><recvLimit>0</recvLimit> <maxObjSize>0</maxObjSize> <contact_db>addressbook</contact_db> <calendar_db>calendar</calendar_db> <note_db>tasks</note_db> </config>
Nokia 9300i (using obex over usb)
<config> <type>5</type> <interface>1</interface> <version>1</version> <identifier>PC Suite</identifier> <wbxml>1</wbxml> <recvLimit>0</recvLimit> <maxObjSize>0</maxObjSize> <usestringtable>0</usestringtable> <onlyreplace>0</onlyreplace> <contact_db>Contacts</contact_db> <calendar_db>Calendar</calendar_db> <note_db>RcntTask</note_db> </config>
Notes for Nokia 9300i configuration
I had to get write permissions on ALL devices on the same usb bus (e.g.: chown mh /dev/bus/usb/002/*), otherwise syncml-obex-client -u wouldn't show me any information about the connected device''
Successfully synced events. Partial success with tasks and contacts (synced with error Unable to commit change). No success with notes, perhaps because of my old firmware (V 05.50(00), 16-12-2005, RA-8). Although RcntTask seems to be the right choice for notes ( http://de.opensuse.org/OpenSync/SyncML-OBEX-Client#Nokia).
Older Nokias (with syncml 1.0 over http)
<config> <username></username> <password></password> <url>/</url> <port>8080</port> <usestringtable>1</usestringtable> <onlyreplace>0</onlyreplace> <recvLimit>10000</recvLimit> <contact_db>addressbook</contact_db> <calendar_db>calendar</calendar_db> </config>
Troubleshooting
Please remember that this plugin is still pre beta. So problems WILL occur. I am really thankful though that you are helping with the testing!
Nothing happens when you connect with the phone:
- Make sure that you have the correct ports configured in the config and on the phone
- Use netstat -npa and look if it list the msynctool listening on the specified port
- Use ethereal to sniff what the mobile sends (Maybe a firewall is blocking traffic)
The sync failed:
- Please provide the trace files (See this page? for details). Please send them by mail either to the mailing list or to armin.bauer@…
When you want to provide trace files please turn on tracing like this: (opensync and the syncml library both have tracing capabilities)
export OSYNC_TRACE=/path/to/log/dir export SYNCML_TRACE=/path/to/log/dir
Please make sure that both paths are the same so that both libraries use the same files for debugging.
