Friday, February 25, 2011

Fuggedabout MSWin. How about OpenSync?

Having given up temporarily on MSWin sync for the N8 or N900 we undertake opensync.

http://antoine.ginies.free.fr/syncnokiae70/syncnokia.html 

is an excellent guide for Bluetooth sync with the E70.

We adapt it here for our machines.

+ Download and install:
    - libsyncml
    - libsyncml-tools
    - libopensync
    - libopensync-plugin:
        -evolution2
        --file
        -gnokii
        -kdepim
        -syncml
        -python-module
    - libopensync-tools

libopensync-plugin-kdepim is problematic as it no longer seems to exist.

The multisync-gui is nothing more than a text editor for the configuration files.

+ First create a group to sync your nokia:
    msynctool --addgroup sync_nokia2file

 + List all plugins available to sync your phone:
    msynctool --listplugins

    This returns:
        Available plugins:
            syncml-obex-client
            evo2-sync
            gnokii-sync
            file-sync


+ Now add three members to the group sync_nokia2file:
    msynctool --addmember sync_nokia2file file-sync
    msynctool --addmember sync_nokia2file syncml-obex-client
    msynctool --addmember sync_nokia2file evo2-sync


Clearly this command is in the form of
    msynctool -addmember $groupname $plugin-name

+ Create a directory to store your files:
    mkdir ~/files_from_nokia

+ Set up the phone to sync. My N8 uses
    Settings
        > Connectivity
            > USB > Nokia Ovi Suite
            > Data Transfer
                > Sync
                    x Contacts
                    x Calendar
                    x Notes
                    x Bookmarks


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


+ Now 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 are:

Service Name: SyncMLClient
    Channel: 6


The author states:
Some interesting Nokia code to retrieve information about MAC address:
      #2820#: get the Bluetooth MAC adress
      #62209526#: get the WLAN Mac address


 But at present I do not know how to apply that information.

The service name "SyncMLClient" is the service used for file transfer. It's channel 6 in my case.

http://ubuntuforums.org/showthread.php?t=705103is also helpful in reaffirming that this is the channel of interest:
    Scroll through until you come to the section referring to "SyncMLClient" (NOT the "Nokia SyncML Server" or "SyncML DM Client"). Note down the Channel shown.

+ Now we have to configure all members of the group sync_nokia2file.

+ First is the configuration file that describe the path to future files. Do
    msynctool --configure sync_nokia2file 1

    This should open the vi text editor, where you can enter the configuration data for the member.  
vi isn't very difficult, just arcane.
    http://www.cs.colostate.edu/helpdocs/vi.html
   
is just one of zillions of vi howto URLs. These are the key commands needed to process this:
    i    Insert text
    Esc    Exit insert mode
    u    undo whatever you just did
    ← →    Left, Up, Right, Down moves in those directions
    :wq    The colon indicates a command, so write quit
return

If you'd rather not use vi then this file can be opened with kate or any other text editor at    /home/$user/.opensync/group1/1/file-sync.conf
where $user is your username.

+ Next is to define the channels for a number of services, obviously more difficult.

First, find the available USB services (as root):
    syncml-obex-client -u    This returns:
    Superuser privileges are required to access complete USB information.
    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


Then configure the obex client.
    msynctool --configure sync_nokia2file 2

This step is necessary to create the file, but again, you can avoid vi by exiting and with a text editor modifying
    /home/$user/.opensync/group1/2/syncml-obex-client.conf
 

    This has a large number of parameters. Mine are available on request. Read and follow the prompts in this file. I left most things as the default.

Next configure the evolution client.
    msynctool --configure sync_nokia2file 3    

Again, this is necessary to create the file, but you can avoid vi with a text editor modifying
    /home/$user/.opensync/group1/3/evo2-sync.conf

+ To get a resume of your configuration just do a:
    msynctool --showgroup sync_nokia2file

+ Now all is configured: just sync your date from your phone to your computer:
    msynctool --sync sync_nokia2file

Oops. No joy:

Clients 1 and 3 connect, Client 2 does not.

So tomorrow is another day.

:-(

No comments: