Installation

First check if you have at least openobex version 1.1 otherwise you have to upgrade to the latest openobex version. You can download it from http://prdownloads.sourceforge.net/openobex/openobex-1.1.tar.gz?download.

Unpack the openobex library, configure and install it.

If you also want support for syncml over http, libsoup in version 2.2.94 and greather is required. The latest version of can be found at ftp://ftp.gnome.org/pub/gnome/sources/libsoup/2.2/

Also wbxml2 is required. At least in version 0.9.2. wbxml2 is not well tested in version 0.92 with libsyncml. If you have problems with syncing try wbxml2 0.9.0 which requires a patch. The patch is stored in the libsyncml tarball: misc/wbxml2-0.9.0.patch

Then check out libsyncml:

svn co http://svn.opensync.org/libsyncml/trunk libsyncml

Then build and install libsyncml

cd libsyncml
autoreconf -sfi
./configure
make
make install

If you installed openobex in a non-standard location, please set the path to the pkg-config files using: EXPORT PKG_CONFIG_PATH=/path/to/dir/with/pcfiles
Also make sure that at the end of the configure of libsyncml, it says "Obex Client: Enabled". Otherwise please review your installation of openobex.

Now, the tool is ready to use.

Usage

First you should connect your device with the usb cable.

Then make sure that the lsusb command lists your device.

dani@marvin:~> lsusb
Bus 001 Device 001: ID 0000:0000  
Bus 004 Device 001: ID 0000:0000  
Bus 002 Device 059: ID 0421:040f Nokia Mobile Phones 6230 GSM Phone
Bus 002 Device 001: ID 0000:0000  
Bus 003 Device 001: ID 0000:0000  

It is recommended to give your user access to the device with a udev rule - otherwise you have to sync as root :(

BUS=="usb", SYSFS{idVendor}=="*USB vendor id*", SYSFS{idProduct}=="*USB product id*", MODE="0660", GROUP="users"

Example: For the device which is listed in the lsusb output above with the vendor id 0x421 and product id 0x040f

BUS=="usb", SYSFS{idVendor}=="0421", SYSFS{idProduct}=="04f0", MODE="0660", GROUP="users"

If you are syncing with more then one cellphone it is possible to use other information of your device from sysfs. Example for Nokia cellphones:

BUS=="usb", SYSFS{manufacturer}=="Nokia*", SYSFS{product}=="Nokia [0-9]*", MODE="0660", GROUP="users"

Put this rule in a new or existing rules file in /etc/udev/rules.d/ and run

udevcontrol reload_rules

so udev make us of the rule.

Now we can enumerate the interface available on your device. To do this type:

syncml-obex-client -u

This should generate some output like this:

Found 2 USB OBEX interfaces
Interface 0:
	Manufacturer: Nokia
	Product: Nokia 6680
	Interface description: SYNCML-SYNC
Interface 1:
	Manufacturer: Nokia
	Product: Nokia 6680
	Interface description: PC Suite Services

It is important that you have an interface with the description "SYNCML-SYNC". This is the interface we are going to use.

Now you can run the first "sync" against the device. syncml-obex client is not a real synchronization tool. It is rather used for testing. The tool will list all entries that the device wants to sync and is also capable of adding items to the device.

If you want to display the contacts for example you could type:

syncml-obex-client -u 0 --identifier "PC Suite" --sync text/x-vcard Contacts

The number after -u has to be the interface number of "SYNCML-SYNC". With the identifier you can tell the tool to identify itself as something different (like the Nokia PC Suite in the example). The --sync options states that you want to sync vcards and that your local database is named "Contacts". This example would send syncml as plain xml.

Another example:

syncml-obex-client -u 0 --identifier "PC Suite" --sync text/x-vcard Contacts --sync text/x-vcalendar Calendar --wbxml

This would enable the usage of wap binary xml and get the contacts and the calendar entries (This example works for a Nokia 6680).

You can also add content to the device by using this for example:

syncml-obex-client -u 0 --identifier "PC Suite" --sync text/x-vcard Contacts --sync text/x-vcalendar Calendar --wbxml --add text/x-vcard ~/test.vcard

The test.vcard file has to be a file containing a plain vcard that the phone can understand (mostly 2.1 vcards).

Troubleshooting

If it does not work try the following:

  • Run the syncml-obex-client commands as root if device connected via USB
  • Switch between xml and wbxml using the --wbxml switch (Most devices use wbxml)
  • Change the name of the database ("Contacts" and "Calendar" in the example): "Addressbook", "Agenda", ...
  • You can safely ignore the "I/O error : Attempt to load network entity" errors
  • Phones (and parts of phones) crash quite often. You should restart your phone if everything fails and see if that helps

Nokia Mobiles

  • Play with the identifier string: "PC Suite" or "PC Suite Data Sync" (e.g. Series40 3rd Edition)
  • Locate the entries which you want to sync on your mobile memory, not on the SIM.
  • Check if authentication on your mobile is required, username/password - Some mobiles just reject with 0x44 ("not found") - instead of authentication failure.

If it does not work at all, please send me a bug report (see below)

Bug Reports

First, you should enable tracing by typing:

export SYNCML_TRACE=/path/to/log/dir
export SYNCML_LOG=/path/to/log/dir

You should then find out where the problem appears. If the tool does not display anything at, there is most likely a problem with establishing the connection. The best way to help is to use the windows tool provided with your device and get a usb sniff of the traffic there (see below)

If the problem appears during the sync, please run the tool again with tracing enabled to get a trace (2 files in the log directory). Then send these 2 files to armin.bauer@desscon.com (busy) or dgollub@suse.de, along with information about the manufacturer and model of your device. If possible, also try to get a sniff of the usb traffic of the windows tool.

USB Traffic sniff from vendor software

Download snoopypro from http://sourceforge.net/projects/usbsnoop/.

Most Bluetooth interfaces are connected via USB, even the internal once of Laptops. Try: lsusb.

Start snoopy and follow the readme (from the help menu) to start sniffing a device.

As soon as you are sniffing a device, use the windows tool to generate the traffic.

Now stop the sniff and export the data as xml and send this xml file to armin.bauer@desscon.com (busy with work) or dgollub@suse.de

In Linux it's also possible to sniff the traffic from a VMWare/VirtualBox Windows instance and latest Wireshark version and Linux Kernel >= 2.6.22. Kernel module usbmon needs to be loaded.

Capture Bluetooth traffic with BlueZ hcidump

hcidump -w syncml.log

Capture OpenOBEX traffic

Sometimes it's helpful to analyze the OBEX traffic. To make OpenOBEX more verbose you have to build from source and preload the library:

svn co http://dev.zuckschwerdt.org/svn/openobex/trunk /tmp/openobex-debug/
cd /tmp/openobex-debug/
autoreconf -sfi
CFLAGS="-DOBEX_DUMP=3" ./configure --prefix=/tmp/openobex-debug/build/
make
make install
export LD_LIBRARY_PATH=/tmp/openobex-debug/build/lib/:$LD_LIBRARY_PATH
# run syncml-obex-client with regular parameters

This should return additional output like this:

Tx: 80 00 15 10 00 04 00 46 00 0E 53 59 4E 43 4D 4C 2D 53 59 4E 43

Thanks for your help'''