Sync with OpenSync/libsyncml via Obex/bluetooth binding
We are adding Obex transport support for SyncEvolution, in SyncEvolution 1.0 you can sync with your mobile device over bluetooth. This article demonstrates how to sync from SyncEvolution (as the client) with OpenSync (as the server) over bluetooth (The reverse role is also possible but will not explain in this article).
Build and Install OpenSync:
- Install OpenObex, Bluez
- Download libsyncml source code
svn co http://svn.opensync.org/libsyncml/trunk libsyncml
Build and install libsyncml:
cd libsyncml cmake . -B/tmp/build/libsyncml cd /tmp/build/libsyncml make make test make install
- Install Obexd, we are pushing SyncML connection plugin to let it work with SyncEvolution. Please use
obexd -nd
to see whether your obexd installation supports SyncEvolution. (Integrated in Obex 0.19) - Install SyncEvolution.
For more detail, you can refer to obex-guide from opensync wiki.
Usage
We are testing a common setup for mobile sync: SyncML client (SyncEvolution)/obex daemon with SyncML Server(OpenSync)/obex client; OpenSync as the server will initialize the synchronization process.
- List your bluetooth devices to find the mac address.
hciconfig
Note: Bluetooth devices does not support loop-back connection, so either you test from two machines with built-in bluetooth device or use one machine with two bluetooth devices. - Start obexd daemon
obexd -nd --syncevolution
- Find which channel SyncML service is on
sdptool browse macaddress
Find the SyncEvolution block and the channel specified. - Start SyncEvolution dbus service
syncevo-dbus-server
Now the client side is set up and ready for use. Set up a opensync server configuration for SyncEvolution
syncevolution --configure --template google \ --sync-property enableWBXML=0 \ --source-property type=text/x-vcard \ --source-property uri=Contacts \ opensync addressbook
Start OpenSync to init the sync session:
syncml-ds-tool -b BtMac BtChannel \ --version 1.2 --identifier opensync \ --sync text/x-vcard Contacts
Where BtMac is the device mac address where obexd is running and BtChannel found in step 3.
A successful sync session should be conducted!
Trouble shooting
- For SyncEvolution side, you can set the log level larger and see the detailed session log and message dump in $HOME/.cache/syncevolution
- For OpenSync side, you can set
export SYNCML_LOG=/path/to/log
and check the dump messages in /path/to/log