Friday, March 4, 2011

Phew...

Note to reader: This is now 6 March 2011. I have learned more, so am editing this post to change things that no longer are correct. If you have saved information earlier than today then please review this article.
======================================================
What a day... Indeed, what a number of days...

I have spent the last several days trying to get a top down view of OpenSync.

Below is my first take, my gleanings from the zillions of postings on the subject. I will be ecstatic if someone would post comments directing me to the contrary:

Point one:

+ Everything I have found is at the warp and weft level
          http://en.wikipedia.org/wiki/Weaving

The postings address the finest details of the most lowly elements of the architecture, but I have not found anything that offers a top-down description of the architecture. Not even from the source...

 So as a result, there seems not to exist any source that describes in a single document on a macro level how to integrate the architecture with the remainder of the computer world. It seems to be an own-self-navel-contemplating structure in an ivory tower impervious to the forces of reality... :-(

-----
OK, dude, here is some reality, below.

Point two:

+ Great idea, but to date, poor execution. Aside from the relevance and context issue above, there is the issue of functionality. Guess what: it is broken.

At least it is broken on OpenSuSE 11.3.

=====
Look: here's the deal:

OpenSync is a great idea. You have a central engine that can translate from X to Y. X can be any of a zillion of different modules referred to as "plugins" that the user can choose among. Y can be any of a zillion same or different modules ("plugins") among which the user can choose.

This reminds me of the project for which I was a program manager at a large company once upon a time. Take X, translate it to a common  format (XML?) and then translate it to Y.

Great Idea.

=====
Howevah, Poor Execution:

+ Lots of people seem to be working on the intimate details of all the possible X and Y variations.

+ But THE WHOLE SYSTEM depends on access to hardware, that is on Bluetooth and USB interfaces. And there seems to be precious little effort there.

I'm on OpenSuSE 11.3. It seems by allegation that its default Bluetooth interface (kbluetooth) for the underlying protocol stack (bluez) is broken.

However, if you upgrade KDE to 4.5.5 or install KDE 4.4.4 development files (as posted later) then you can get Bluedevil to work, so far to the extent that I can now both receive AND SEND files between laptop and Bluetooth device. The strikethrough fonts below demonstrate the deprecated remarks.
 
Indeed, irrespective of OpenSync I can transfer data from a remote Bluetooth device to the bluez-equipped computer using the remote device's software. But I cannot transfer data from the computer to the device, despite kbluetooth's offering to do so. It doesn't work

So what alternatives exist?

bluedevil (http://www.afiestas.org/bluedevil-the-new-kde-bluetooth-stack-is-here/) is widely touted as the solution. But actually installing it is dependency hell. I have spent the entire day trying different combinations of RPMs, YMPs  (YaST Meta Packages), git streams, and tarballs. All fail in one or another way, one way in particular wiping my KDE 4.4 installation (cannot start kmserver) requiring a system reinstall ("update"). The solution appears to install devel packages for ALL of KDE, OpenSuSE, and bluedevil (libbluedevil1). So while it isn't presently easy, it is  doable.So yet another Great Idea But Poor Execution. The developers are not on the bleeding edge, they are on the hemorrhaging edge of the latest KDE variation (4.5.5) and installation techniques (CMAKE) for which little or no documentation exist.


How the heck do you use cmake anyhow? The source says just do ccmake but that crashes...

-----

OK, next rant. If Bluetooth won't work, how about USB, hmmm?

Well, it turns out that "OpenSync does not currently support accessing the raw USB device" or words to that effect.

In other words, it doesn't work on USB.

=====

So OK, kwitcherbichingnobodypromisedyouarosegarden, ok.

You can't make a case. It is free and open software, you get what you pay for.

But it would be nice if someone, in the course of doing the best that they can do, were to post a list of the things we are trying to do, each with an annotation of where we stand. A "todo" list so that at once:
+ A newbie can know where the project is along its trajectory
+ A supporter can see where he can apply his efforts to best solve the issue.

My contribution is in general providing the top down view posted below, and today getting my arms around the bluetooth/bluedevil part of it, contacting the developers and asking for information so I can make it better.

But we ain't there yet. The following is what I have figured out so far, I'll make it pretty tomorrow:

===========================================
http://en.opensuse.org/OpenSync
OVERALL ARCHITECTURE
Opensync software comprises a main engine and "plugins".

There are two version sets: STABLE (v. 0.22 series) and UNSTABLE (v.0.39 series)

The  STABLE main engine is libopensync. The UNSTABLE main engine is libopensync1.

The STABLE plugins are libopensync-plugin-(suffix).
The UNSTABLE plugins are opensync-plugin-(suffix).
 (suffix) is, for both versions:
      Suffix        Syncs to and from
    -evolution2         Evolution
    --file              files on the computer
    -gnokii             older non-OBEX Nokia phones
    -kdepim             KDE3/4 PIMs (kontact, kaddress)
    -syncml             OBEX supporting platforms
    -python-module      Allows python plugins to be used
    -google-calendar    Google calendar
    -gpe                GPE handhelds
    -irmc               IrMC (Sony Ericsson, Siemens) handhelds
    -moto               Motorola handhelds
    -opie               Opie/OpenZaurus handhelds
    -palm               Palm devices
    -sunbird            Mozilla Sunbird calendar

Media
The architecture is designed to be implemented on both bluetooth and USB connections.

http://en.opensuse.org/OpenSync/SyncML-OBEX-Client
In openSUSE 10.2 Beta 2 there is no permission for the desktop user to access the USB raw interface by default. When we receive lots of USB Products and Vendor IDs of mobile phones, from the community then we can provide a hal-resmgr fdi file which grants access to the USB RAW interface of your mobile phone.

This implies that except for testing, syncml-obex-client does not function on USB.

http://wiki.wireshark.org/CaptureSetup/USB:
This page is about capturing raw USB traffic, e.g. the packets a USB mouse will generate on the Universal Serial Bus.
To dump USB traffic on Linux, you need the usbmon module. Load it with the command
      modprobe usbmon

Implementation: Sets, Groups, and Members
http://en.opensuse.org/OpenSync
Implementation requires establishing a synchronization set, containing several groups. Each group contains several members.

Establishing the Set
The set is established by the existence of a group and its configuration. The set is identified by a field common to all the group and member configuration files. The most common set for Nokia devices is PC Suite

Adding Groups

Groups are created by the command
    msynctool --addgroup $groupname
    The group name can be any single alphanumeric word, e.g., nokia2evo, nokia2file, and so forth.

    Creating a group creates two subdirectories
        ~/.opensync/engines
        ~/.opensync/groupn
    where n is the next sequential number 1...n that has not previously been used for a group.

Adding Members
Members are added to the group by the command
    msynctool --addmember $groupname $membername
    The member name must be the name of the function in the desired plugin:

      Plugin        Membername
    -evolution2    evo2-sync
    --file         file-sync
    -gnokii        gnokii-sync
    -kdepim        kdepim-sync
    -syncml        syncml-obex-client Currently only Bluetooth?
                   syncml-http-server
    -python-module Allows python plugins to be used
    -google-calendar    google-calendar-sync
    -gpe           gpe-sync
    -irmc          irmc-sync
    -moto          moto-sync
    -opie          opie-sync
    -palm          palm-sync
    -sunbird       sunbird-sync

    Adding a member creates a subdirectory
        ~/.opensync/groupn/m
    where m is the next sequential number 1...n that has not previously been used for a member.

Viable group membership include:
 

    nokia2file           
        file-sync
        syncml-obex-client

    nokia2evo
        evo2-sync
        syncml-obex-client


Configuration
For each group configure each client by invoking
     Configure client 2 syncml-obex-client:
     msynctool --configure $groupname $membernumber

    This creates the configuration file and opens it in vi.

    For  some members nothing needs to be done, so just issue the vi command:

        :q[Enter]

    For other members much needs to be done but is 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/$groupnumber/$membernumber/syncmember.conf

    where

     $user is your user name,  
     $groupnumber is the sequential number for the group, and
     $membernumber is the sequential number for the member, obtained from the -addgroup and -addmember actions described above.


Testing
Testing involves giving commands and recording the results.

    syncml-obex-client
    http://en.opensuse.org/OpenSync/SyncML-OBEX-Client#Testcase_Basics
        This URL discusses a number of tests. Essentially they are setting the parameters of the syncml-obex-client configuration file and testing its response. All are invoked with the following command:

        syncml-obex-client --$testtype [$test parameters]

            where $testtype [$test parameters] can be any of the following:

--sync $type $database   Set data types to be synched
--identifer $name        Set syncronization set identifier
--wbxml                  Sets use of wbxml format 
                         (WAP Binary XML instead of 
                         plain XML)
 -u             With no id it will list all available
                interfaces
                With id it will ????
 -b             Bluetooth configuration

         syncml-obex-client --sync $type $database

        where:
            * type: stands for the mimetype -
                  o text/x-vcard - for contacts
                  o text/x-vcalendar - for events
                  o text/plain - for notes

            * database: is the name of the database in the device which stores the entries. Known database names:
                  o contacts
                  o calendar
                  o notes
                  o tasks
                  o agenda (on some Sony Ericsson, for W800i both calendar as well as agenda work)

    hcitool
        hcitool is a tool for testing bluetooth connections. It currently has only one option:
            hcitool scan
                Scans for Bluetooth devices and list the name of the device and the MAC address.
                Ensure your Bluetooth is enable on your mobile phone and is discoverable.

    sdptool
        sdptool is a tool for exploring Bluetooth connections. It currently has only one option:
            sdptool browse
                returns the Bluetooth service of the device and their channel numbers.
                The Nokia N8 returns a very long list of available Bluetooth services. The literature
                is unclear on which channel to use. This source suggests using the channel for
                    SyncMLClient         6
                 while others suggest
                    SyncMLServer         10
                Also plausible are
                    OBEX File Transfer    7
                    OBEX PC Suite Services    8
                So further explanation or testing is required to resolve this parameter.

================
Next, what I've gleaned as a step-by-step installation process, assuming you can get past the USB and bluetooth issues that I'm having on OpenSuSE 11.3.

Saturday, February 26, 2011

Nokia Frustration, cont'd

http://www.opensync.org/ 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.

http://www.opensync.org/wiki/GettingStarted
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.

http://www.opensync.org/wiki/download 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.

     http://kde-apps.org/content/show.php/KitchenSync?content=132538 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:
    syncml-obex-client
    evo2-sync
    gnokii-sync
    file-sync
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.

    Now:
    + 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 https://help.ubuntu.com/community/NokiaEvolutionSyncing/Opensync 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.
        https://help.ubuntu.com/community/NokiaEvolutionSyncing/Opensync suggests PC Suite.
        The phone itself at Settings > Connectivity > Data Transfer > Sync is titled the same.

    + Other settings:
        https://help.ubuntu.com/community/NokiaEvolutionSyncing/Opensync 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
        https://help.ubuntu.com/community/NokiaEvolutionSyncing/Opensync suggests additional settings for

        USB:
            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:
            lsusb
            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
            USB:
                 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:
    USB:
         Error while synchronizing: Invalid answer from plugin process
    Bluetooth:
        Member 2 of type syncml-obex-client had an error while connecting: Bluetooth connect error


So tomorrow is yet another day...

Friday, February 25, 2011

Woohoo! A simple keylogger!

After a full day of work (below) and a good meal it was time to play.

I enjoyed Jono Bacon's distinction between systematic and opportunistic developers (Linux Format 140 January 2011 Get developing ):
     http://www.linuxformat.com/archives?issue=140


This is me.

Everything I do I do intensely. Document it, analyse it, etc. And I get tired like everyone else, and sometimes just stretch out on the sofa and go to sleep.

So I would like to know when all that intense activity ceased.

Solution? A keylogger. Something that will record any keyboard activity with a time stamp.

I tried inotify. A great program, but much more complex than I need. I just want to know when I checked out.


Tonight I came across logkeys:


http://code.google.com/p/logkeys/downloads/detail?name=logkeys-0.1.1a.tar.gz&can=2&q=

Easy install:
     Untar it then (as root)
     ./configure
     make
     make check
     make install

Very simple, very cool, very minimalist, very high entropy. Simply records keystrokes to a log file with a time stamp.

Awesome.

My command is (as root):

     logkeys -s -o /Desktop/logkeys.log &

Doing this as root makes the file unreadable by the user, so again as root:
     cd /Desktop
     chown -R $user:users *
     chmod -R 0755 *

A sample output:

2011-02-25 23:43:27-0500 > doing this as root makes the file unreadable by the user, so again as root:b     b     cd /desktop
2011-02-25 23:44:17-0500 >      chown -r andy"$user:users
2011-02-25 23:44:36-0500 >      chmod -r 0755 *<#+3> *b
2011-02-25 23:45:03-0500 > bvery bcool.
2011-02-25 23:45:15-0500 > <#+67>
2011-02-25 23:45:27-0500 > a sample output:
2011-02-25 23:45:33-0500 >

Very cool.

So it is now late (as shown by the log) but not too late. Tomorrow I'll bet it can be tweaked. For example, I don't really need the time zone and we could do without the scrolling and navigation records.

But all in all very cool for what I want.

Well done.

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.

:-(

Thursday, February 24, 2011

I surrender - Nokia Ovi Suite - Windows XP

+ The Cable Connectivity Driver is hosed. Removing it allows the device to be recognized the first time, except that its mode (which is recognized by Windows) is not recognized by Ovi, which declares that the device is not in Ovi Suite mode, even though it is.

+ The typical mantra (uninstall, reboot all devices, reinstall) does not work.

+ Plugging in the phone gets a report of Bad CDC descriptors. We haven't figured out what that means.

+ Windows recognizes the phone as a Digital Still Camera but also as N8-00 in Ovi Suite mode on occasion.


+ But Ovi will not connect to it.

========== Details ==========  
Ovi Suite is installed. Reboot.
+ Plug in and connect the phone before starting Ovi: not possible since Ovi starts on boot and resides in the system tray.
+ Plug in and connect the phone after disk thrashing subsides. dmesg reports bad CDC descriptors.
+ Click left, right and double on the system tray icon: Nothing
+ Right click the desktop icon: we get and hour glass for a while, then nothing. Correction: after several minutes it starts loading, very slowly.
    Windows Task Manager reports Ovi Suite 3.0.0.290 not responding. Highlight it and click End Task. Then it appears! But shortly after crashes and disappears.
+Reboot without the phone plugged in.
+ Right click Ovi in the system tray. After fifteen seconds it offers
    - Open Ovi Suite
    - Exit
+ Click the desktop icon. Ovi comes up. dmesg has no odd registrations.
+ Plug in the phone. Same as before. Windows recognizes it in the Ovi mode (not storage) but Ovi hangs at a very low rate. I did try touching the USB icon on the phone and reselecting Ovi Suite in case perhaps this had gotten lost, but there is no change. The only choice is to reboot.
+ Reboot, delete the Cable Connectivity Driver, try one more time.
+ Plug in the phone. Now it is recognized. Minor problem: USB Controller Bandwidth exceeded. The USB controller does not have enough bandwidth for the Digital Still Camera. The USB controller wants 95%, the System reserve is reserving 10%. We'll deal with that later.
+ Select the Nokia N8-00. The program responds that it is not in the PC Suite USB mode. YES IT IS! But I reset it in that mode just the same.
No joy, but progress. So reboot, and reboot the phone.
+ Start Ovi, plug in the phone. Same message about USB Controller bandwidth. This time Ovi does not recognize the phone. Shut it down and restart. Still no recognition. Disconnect the phone and replug.
+ Still no joy. Go to Device Manager and uninstall the Digital Still Camera, which is how it is being recognized... No joy.
+ Disconnect, reconnect. No joy.
+ Remove all Nokia software except the Ovi Suite. Click Repair on Ovi Suite. It takes forever, during which I prepare dinner. But eventually it announces that it has been repaired. It has not replaced any of the drivers I had deleted. So start it up and...
    - Windows recognizes both Digital Still Camera and N8-00 Phone Parent
    - Ovi recognizes N8-00
But then slows to a crawl. Windows is now totally frozen. There is not a lot of disk activity, but the CPU is flying.. htop shows it eating 98% of CPU time.

OK enough for today.

Wednesday, February 23, 2011

Nokia Frustration, cont'd

OK. We've been struggling for several days to install a functional version of one or another of the Nokia Suites: Ovi or PC on Windows XP (Service pack 3).

They grind and grind and nothing happens.

So finally we nuke the session, reboot, nuke the software, and try a different iteration.

Then today it occured to me: maybe it is trying to phone home and my (excellent) firewall is not allowing this?

So tonight we try again: delete all traces of Nokia anything, reboot, and restart installation, this time of Ovi Suite, and monitor the firewall log:

+ Ovi Suite itself progresses (slowly) without any firewall activity. But then complains Minimal memory 256 MB . So shut down, adjust memory, reboot, restart the installation.

Yes, indeedy. It is trying to phone home. The firewall reports (dmesg):

[12735.781008] ABORTED IN=wlan0 OUT= MAC=00:24:d2:2b:e1:52:94:44:52:78:f0:28:08:00 SRC=62.70.27.118 DST=192.168.5.7 LEN=40 TOS=0x00 PREC=0x00 TTL=47 ID=0 DF PROTO=TCP SPT=80 DPT=2398 SEQ=3165126420 ACK=0 WINDOW=0 RES=0x00 RST URGP=0

To which I respond:
     P1630:~ # whois 62.70.27.118and receive:
netname:        TROLLTECH-NET1-OSL-NO

So TrollTech (QT) is trying to read me because OVI is built on QT. But my firewall is blocking this.

Is this why the app won't install? Why didn't they tell me beforehand?

But before I open the firewall port I want to try all other available options:

OVI Suite has installed successfully, it wants me to do all kinds of things, but gracefully gives me the option of "doing this later".

OK, nevermind, continue. Reboot WinXP, and continue to try to install the phone, this time monitoring the firewall.

First, Ovi asks me to plug in the device. I do.

dmesg reports discovery
    [14282.120826] usb 1-3: Product: N8-00

but also reports a fault:
    [14282.124194] usb 1-3: bad CDC descriptors
    [14282.125721] cdc_phonet: probe of 1-3:1.14 failed with error -22

This is troublesome (probe failed) but Windows XP recognizes the phone in the tray.
    Found new hardware... etc.
Ovi says Please wait while USB drivers are installed on your computer but then freezes.

Firewall log does not show any blocking. But now Ovi is completely frozen. Fortunately WinXP is not, so we shutdown and reboot.

Once again, start up Ovi Suite. No firewall messages, but the above cited bad CDC descriptors complaint. But Ovi never restarts.

OK, shutdown, reboot.

Ooops, black screen of death. Once again, shut down. Period.

Start again.

OK, this time we get a warning about WinXP not having started correctly, we choose Start Normally and up it comes.

Now the test: wait for all the disk thrashing to stop and then try to start Ovi. The thrashing goes on for about one minute (timed).

Plug in the phone. dmesg reports

[16009.828303] usb 1-3: bad CDC descriptors
[16009.830473] cdc_phonet: probe of 1-3:1.14 failed with error -22

and indeed Ovi fails to see the phone.

So there is something in the CDC descriptors that is preventing Ovi (or, I'll bet I get the same result tomorrow from PC Suite) from finding the phone.

Time for bed.

dmesg and kernel hacking

I came across a lot of interesting stuff on kernel hacking:
http://www.linuxtopia.org/online_books/linux_kernel/kernel_configuration/ch09s07.html

It says:
     To enable timestamp options on kernel messages:
     Kernel hacking
         [*] Show timing information on printks

But it doesn't say where these [bracketed] options are being set.

It turns out that they are set with
    cd /usr/src/linux
    make menuconfig

and this particular option is already set. So this does not help, but the rest is interesting:

http://help.soft30.com/manual/SUSE-Linux-Administration-Guide/ch11s03.html
gives details on kernel configuration for SuSE.

    To configure the kernel, change to /usr/src/linux and enter the command make config. Choose the features you want supported by the kernel.

So out of curiosity I did that.

Woh! I hope I haven't done myself in, as this responded with:

  HOSTCC  scripts/basic/fixdep
  HOSTCC  scripts/basic/docproc
  HOSTCC  scripts/basic/hash
  HOSTCC  scripts/kconfig/conf.o
  HOSTCC  scripts/kconfig/kxgettext.o
  SHIPPED scripts/kconfig/zconf.tab.c
  SHIPPED scripts/kconfig/lex.zconf.c
  SHIPPED scripts/kconfig/zconf.hash.c
  HOSTCC  scripts/kconfig/zconf.tab.o
  HOSTLD  scripts/kconfig/conf
scripts/kconfig/conf arch/x86/Kconfig
#
# using defaults found in /boot/config-2.6.34.7-0.7-desktop
#
*
* Linux Kernel Configuration
*

at which point I bailed out.

So I better go back and finish it, perhaps by hitting return at each prompt unless I want to change it...

Uggh!.

It's all coming back to me, kernel hacking back in 2002. And making a mess and having to reinstall...

But wait! It goes on:

“menuconfig” is a more comfortable way to configure the kernel. If necessary, install ncurses-devel with YaST. Start the kernel configuration with the command make menuconfig.

This does indeed require ncurses-devel. So we install that and try again.

Aha! Now this shows the options in the [*] and [ ] formats. The Kernel Hacking option (highlight and hit Enter) is where we want to go.

So we check it all out, exit without saving changes, and (fingers crossed) reboot.

It comes back up just fine.

Whew.

=====
All this occurred while trying to figure out how to convert the dmesg timestamp to real time.
/var/log/messages has system events that may be able to be correlated with dmesg output. There are allusions to a /var/log/kern.log having real times, but I don't have such a file.

So tomorrow is another day.