Saturday, February 26, 2011

Nokia Frustration, cont'd is the source and is for OpenSync 0.2 - we are on 0.22-156.1 so it should be applicable...

OpenSync is a successor of project  Multisync, created by the same people.
To get started with OpenSync you probably need:

    * OpenSync itself, the core: 
          it is a library and does not contain any plugins or user interfaces. It is the engine for synchronization.

    * The format plugins. 
          OpenSync converts every data into standard formats before performing the synchronization. You will require at least one of the following plugins:

    (We do not have any of these nor are they offered by YaST!)

    + vformat: 
          supports vcard, vcal, iCalendar, vtodo and vnote. It is required for devices that directly provide this kind of format.

    + xmlformat: 
          enables to handle any xml compatible data, like documents, bookmarks, notes and contacts. It is the central format for libopensync to perform changes comparison and mergers, this format is required.

    + The peer plugins: 
          there is one plugin per type of thing to synchronize (files, PDAs, smartphones, Google Calendar, whatever). Note that the version number for the OpenSync core must match that of the plugins you want to use. For instance, you can use the Evolution2's plugin 0.22 with OpenSync-0.22 but not with OpenSync-0.36 and viceversa. (All our plugins are 0.22

    * Some kind of user interface (UI): 
          such as Multisync or  Kitchensync for KDE. Multisync contains both a command line tool (osynctool) and a GUI written in GTK. Note that multisync versions older than 0.90 are not relying on OpenSync and won't work''

(We do not have either of these nor are they offered by YaST. Multisync-GUI is available, but as noted yesterday it is only a text editor for the configuration file. The notes on this state "This package is independent from the various multisync-* packages which will be obsoleted once OpenSync has left the beta phase." It would seem that this has already occurred if none of the mulitsync-* packages are offered. gives the latest (0.22) resources for Gentoo, Mandriva, and OpenSuSE. Since our present install is not working there is no harm in nuking it and downloading the Factory package for OpenSuSE. This detail is available on request, but suffice it to say we have the latest and all seem to by in sync among themselves.

But these do not include KitchenSync. offers an UNSTABLE version for OpenSuSE, so we give it a try. But it conflicts with the gnokii plug in, so we let it deinstall that plugin, we can always add it later. But then it wants to wipe the entire opensync install, so we say fuggedabout kitchensync for now.

And that is where the guidance stops.

So other than having replaced the software with slightly newer versions, we are where we ended yesterday.


So OK, we've done due diligence by going to the OpenSync source and RTFM. It's just that the manual is a bit short.

Nuke the old configuration files, reboot, and start again.

OK, from the top:
1. Download files        Done

2. Test if everything went right:
    msynctool --listplugins    Result:
    Available plugins:
We did not get syncml-http-server suggested by the ubuntu site.

All the following are done as user, not root:

3 Create a directory to store your files:
    mkdir ~/files_from_nokia
4. Add a group to sync your nokia to Evolution as user:
    msynctool --addgroup nokia2evo
5. Add members
    msynctool --addmember nokia2evo evo2-sync
    msynctool --addmember nokia2evo syncml-obex-client

6. Detect your phone over bluetooth:
    hcitool scan    This returns
        Scanning ...
                E0:A6:70:FE:9B:DC       Andy's N8

7. Get all services available on this phone:
    sdptool browse E0:A6:70:FE:9B:DC | less    This returns a very long list (253 lines in my case) of services, listed in the sub-tab Services.
    The |less pipe lets you scroll up and down the list using up and down arrows.

    Of particular interest is:
        Service Name: Nokia SyncML Server
        Channel: 10

8. Find the USB services offered by the phone. Plug in the USB cable first  and do
    syncml-obex-client -u    If you don't plug in the cable you will get
        Found 0 USB OBEX interfaces    With the USB cable connected you will get
    Found 4 USB OBEX interfaces
    Interface 0:
            Manufacturer: Nokia
            Product: N8-00
            Interface description: SYNCML-SYNC
    Interface 1:
            Manufacturer: Nokia
            Product: N8-00
            Interface description: PC Suite Services
    Interface 2:
            Manufacturer: Nokia
            Product: N8-00
            Interface description: SYNCML-DM
    Interface 3:
            Manufacturer: Nokia
            Product: N8-00
            Interface description: Haptics Bridge
    Use '-u interface_number' to connect

    The SYNCML-SYNC interface is of particular interest.

9. Configure client 1 evo2-sync:
     msynctool --configure nokia2evo 1    This creates the configuration file and opens it in vi. For this member nothing needs to be done, so just quit (:q[Enter])

10. Configure client 2 syncml-obex-client:
     msynctool --configure nokia2evo 2    Again, this creates the configuration file and opens it in vi. For this member much needs to be done, and done so much more easily in kate or some other GUI text editor so just quit (:q[Enter]) then open the file in your favorite editor. The file to open is:
    /home/$user/.opensync/group1/2/syncmember.conf    where $user is your user name.

    + Bluetooth MAC address: E0:A6:70:FE:9B:DC (yours from the hcitool scan above)

    + Bluetooth channel:
        There is some confusion. Yesterday's work indicated it should be the Syncml Client channel, while today says to set it to the channel being used  by SyncML Server from step 7. above, which returns this as channel 10.

    + The usb interface number of the SYNCML-SYNC target:
        This is the interface number (0) from step 8 above.

    + Set the connection type to use. 5 means obex over usb, 2 means obex over bluetooth

    + The string that the plugin will use to identify itself. suggests PC Suite.
        The phone itself at Settings > Connectivity > Data Transfer > Sync is titled the same.

    + Other settings: suggests:
            * version: 1
            * wbxml: 1
            * usestringtable: 1
            * recvLimit: 10000    Default is 0
            * maxObjSize: 10000     Default is 0
        Don't change contact_db, calendar_db or note_db, and don't put in a username or password
            (perhaps unless you have one set up in the phone).

    + Additional settings not in the default .conf file suggests additional settings for

            You'll need to fix permissions for your USB device. First you should connect your device with the usb cable. Then make sure that the lsusb command lists your device:
            returns a bunch, including
            Bus 001 Device 003: ID 0421:0302 Nokia Mobile Phones
        Now they want us to change some rules, but first let's just see if it flies as is.
        But the response is
                 Error while synchronizing: Invalid answer from plugin process            Bluetooth:
                Member 2 of type syncml-obex-client had an error while connecting: Bluetooth connect error
11. OK, change the rules:
    + Unplug the phone
    + Use kate as root to modify /etc/udev/rules.d/40-nokia-mobiles.rules. The file does not exist. Write it as
        BUS=="usb", SYSFS{idVendor}=="0421", SYSFS{idProduct}=="*", MODE="0660", GROUP="dialout"
        # This might work if the above doesn't :-( (substitutes ATTR for SYSFS)
        # SUBSYSTEM=="usb", ATTR{idVendor}=="0421", ATTR{idProduct}=="*", MODE="0660", GROUP="dialout"
    + Run as root:
        /etc/init.d/boot.udev reload    + Replug the phone

12. Make sure the configuration has been updated using the command below as user:
    msynctool --showgroup nokia2evo    This prints out the configuration file

13. Run the sync:
    msynctool --sync nokia2evo
But no joy:
         Error while synchronizing: Invalid answer from plugin process
        Member 2 of type syncml-obex-client had an error while connecting: Bluetooth connect error

So tomorrow is yet another day...

No comments: