Discussion:
progress on synce-hal
Mark Ellis
2008-04-14 20:04:32 UTC
Permalink
Hi All

Quick heads up, I've now got access to a WM5 device to test on :) Many
thanks to Gavin Hamill and his upgrade project.

Anyway, after some more flailing around in python, synce-hal will now
connect to a WM5 device using dhcp, if any one wants to play.

Next step will be getting sync-engine to work with hal.

Mark
Mark Ellis
2008-04-16 16:17:07 UTC
Permalink
Post by Mark Ellis
Hi All
Quick heads up, I've now got access to a WM5 device to test on :) Many
thanks to Gavin Hamill and his upgrade project.
Anyway, after some more flailing around in python, synce-hal will now
connect to a WM5 device using dhcp, if any one wants to play.
Next step will be getting sync-engine to work with hal.
Mark
Ok, I just committed a patch to sync-engine to recognise a device
connected through hal, quite a small change. Works fine for me, odccm
also still works fine.

Mark
Ilya Bakulin
2008-04-16 18:08:49 UTC
Permalink
On Wed, 16 Apr 2008 17:17:07 +0100
Post by Mark Ellis
Ok, I just committed a patch to sync-engine to recognise a device
connected through hal, quite a small change. Works fine for me, odccm
also still works fine.
Mark
Just did some testing.
1. When device is NOT connected, running sync-engine goes perfectly: it finds device when it is plugged in and sends required data.
2. When device is connected when I start sync-engine, nothing happens.

%uname -a
FreeBSD kibab.ht-systems.ru 7.0-STABLE FreeBSD 7.0-STABLE #1: Tue Mar 25 17:39:00 MSK 2008 ***@kibab.ht-systems.ru:/usr/_OBJDIR/usr/src/sys/KIBAB_WORK i386
%pkg_info |grep hal
hal-0.5.11.r2_5 Hardware Abstraction Layer for simplifying device access
--
Ilya Bakulin <***@kibab.com>
Mark Ellis
2008-04-16 18:42:42 UTC
Permalink
Post by Ilya Bakulin
On Wed, 16 Apr 2008 17:17:07 +0100
Post by Mark Ellis
Ok, I just committed a patch to sync-engine to recognise a device
connected through hal, quite a small change. Works fine for me, odccm
also still works fine.
Mark
Just did some testing.
1. When device is NOT connected, running sync-engine goes perfectly: it finds device when it is plugged in and sends required data.
2. When device is connected when I start sync-engine, nothing happens.
%uname -a
%pkg_info |grep hal
hal-0.5.11.r2_5 Hardware Abstraction Layer for simplifying device access
Can't think off the top of my head why that would be. Sync-engine looks
for devices with property pda.platform = pocketpc, which I know yours
does from the hal dump you sent. And it works on mine.

Can you try putting in some prints amongst the hal startup section in
kernel.py to see where it fails ?

Mark
Ilya Bakulin
2008-04-17 11:34:57 UTC
Permalink
On Wed, 16 Apr 2008 19:42:42 +0100
Post by Mark Ellis
Can't think off the top of my head why that would be. Sync-engine looks
for devices with property pda.platform = pocketpc, which I know yours
does from the hal dump you sent. And it works on mine.
Can you try putting in some prints amongst the hal startup section in
kernel.py to see where it fails ?
Mark
Tried again this morning. Don't know why it failed yesterday, but now everything works OK. Sorry :-(

Now there is an issue with WM6 password protection.
Scenario: WM6 device connects to PC when sync-engine is already running. The following output occures:
=============================================
./sync-engine
SynCE sync-engine starting up
2008-04-17 15:10:11,254 DEBUG syncengine : running main loop
2008-04-17 15:10:11,255 DEBUG syncengine : creating SyncEngine object
2008-04-17 15:10:11,274 DEBUG syncengine : installing signal handlers
2008-04-17 15:10:27,030 INFO engine.syncengine.kernel : _CBHalDeviceConnected: device connected at udi /org/freedesktop/Hal/devices/usb_device_bb4_a51_noserial
2008-04-17 15:10:27,036 INFO engine.syncengine.kernel : device Pocket_PC connected
2008-04-17 15:10:27,036 INFO engine.syncengine.kernel : ProcessAuth : processing authorization for device 'Pocket_PC'
2008-04-17 15:10:27,038 INFO engine.syncengine.kernel : ProcessAuth: authorization not required for device 'Pocket_PC'
2008-04-17 15:10:27,039 DEBUG engine.syncengine.kernel : OnConnect: setting up RAPI session

** (process:25097): CRITICAL **: synce_info_from_hal: Failed to get a connection for /org/freedesktop/Hal/devices/usb_device_bb4_a51_noserial: Pocket_PC: Not yet connected.

** (process:25097): WARNING **: synce_info_from_odccm: Failed to get devices: The name org.synce.odccm was not provided by any .service files
[synce_info_from_file:69] unable to open file: /home/kibab/.synce/active_connection

** (process:25097): CRITICAL **: synce_info_from_hal: Failed to get a connection for /org/freedesktop/Hal/devices/usb_device_bb4_a51_noserial: Pocket_PC: Not yet connected.

** (process:25097): WARNING **: synce_info_from_odccm: Failed to get devices: The name org.synce.odccm was not provided by any .service files
[synce_info_from_file:69] unable to open file: /home/kibab/.synce/active_connection
[rapi_context_connect:173] Failed to get connection info
2008-04-17 15:10:27,110 ERROR dbus.connection : Exception in handler for D-Bus signal:
Traceback (most recent call last):
File "/usr/local/lib/python2.5/site-packages/dbus/connection.py", line 214, in maybe_handle_message
self._handler(*args, **kwargs)
File "/home/kibab/etc/synce/synce-svn/trunk/sync-engine/SyncEngine/kernel.py", line 272, in _CBHalDeviceConnected
self.OnConnect()
File "/home/kibab/etc/synce/synce-svn/trunk/sync-engine/SyncEngine/kernel.py", line 415, in OnConnect
self.rapi_session = rapicontext.RapiContext(pyrapi2.SYNCE_LOG_LEVEL_DEFAULT)
File "/home/kibab/etc/synce/synce-svn/trunk/sync-engine/SyncEngine/rapicontext.py", line 29, in __init__
pyrapi2.RAPISession.__init__(self,loglevel)
File "pyrapi2.pyx", line 413, in pyrapi2.RAPISession.__init__
RAPIError: -2147467259

=============================================

As you remember, WM6 device requires entering password on device, so when Sync-engine tries to setup RAPI session (and it does immediately), device is NOT yet connected to PC.

I've attached a small patch to fix this problem. Now, when device is connected, I see the following:
=============================================
./sync-engine
SynCE sync-engine starting up
2008-04-17 15:30:01,300 DEBUG syncengine : running main loop
2008-04-17 15:30:01,301 DEBUG syncengine : creating SyncEngine object
2008-04-17 15:30:01,320 DEBUG syncengine : installing signal handlers
2008-04-17 15:30:15,144 INFO engine.syncengine.kernel : _CBHalDeviceConnected: device connected at udi /org/freedesktop/Hal/devices/usb_device_bb4_a51_noserial
2008-04-17 15:30:15,149 INFO engine.syncengine.kernel : device Pocket_PC connected
2008-04-17 15:30:15,150 INFO engine.syncengine.kernel : ProcessAuth : processing authorization for device 'Pocket_PC'
2008-04-17 15:30:15,360 INFO engine.syncengine.kernel : Failed to authorize - disconnect and reconnect device to try again
=============================================

On device I see password prompt at this moment.

When I enter password on device, output is:
=============================================
2008-04-17 15:32:49,133 INFO engine.syncengine.kernel : _CBHalDeviceAuthStateChanged: device authorization state changed: reauthorizing
2008-04-17 15:32:49,134 INFO engine.syncengine.kernel : ProcessAuth : processing authorization for device 'Pocket_PC'
2008-04-17 15:32:49,135 INFO engine.syncengine.kernel : ProcessAuth: authorization not required for device 'Pocket_PC'
2008-04-17 15:32:49,135 DEBUG engine.syncengine.kernel : OnConnect: setting up RAPI session
2008-04-17 15:32:49,545 DEBUG engine.syncengine.kernel : OnConnect: Attempting to bind partnerships
[....and as usual...]
=============================================

Please test it with WM5-devices.
--
Ilya Bakulin <***@kibab.com>
Mark Ellis
2008-04-21 18:28:32 UTC
Permalink
Post by Ilya Bakulin
On Wed, 16 Apr 2008 19:42:42 +0100
Post by Mark Ellis
Can't think off the top of my head why that would be. Sync-engine looks
for devices with property pda.platform = pocketpc, which I know yours
does from the hal dump you sent. And it works on mine.
Can you try putting in some prints amongst the hal startup section in
kernel.py to see where it fails ?
Mark
Tried again this morning. Don't know why it failed yesterday, but now everything works OK. Sorry :-(
That's life !
Post by Ilya Bakulin
Now there is an issue with WM6 password protection.
You're not wrong, in fact sync-engine appears to not be set up to deal
with locked WM6 in general, this is not just on hal. Your patch is on
the right lines, but I've got a nasty feeling it wont work in all cases,
I just need to think about it.

With any luck Guido or John are reading and may be able to pitch in.
Post by Ilya Bakulin
=============================================
./sync-engine
SynCE sync-engine starting up
2008-04-17 15:10:11,254 DEBUG syncengine : running main loop
2008-04-17 15:10:11,255 DEBUG syncengine : creating SyncEngine object
2008-04-17 15:10:11,274 DEBUG syncengine : installing signal handlers
2008-04-17 15:10:27,030 INFO engine.syncengine.kernel : _CBHalDeviceConnected: device connected at udi /org/freedesktop/Hal/devices/usb_device_bb4_a51_noserial
2008-04-17 15:10:27,036 INFO engine.syncengine.kernel : device Pocket_PC connected
2008-04-17 15:10:27,036 INFO engine.syncengine.kernel : ProcessAuth : processing authorization for device 'Pocket_PC'
2008-04-17 15:10:27,038 INFO engine.syncengine.kernel : ProcessAuth: authorization not required for device 'Pocket_PC'
2008-04-17 15:10:27,039 DEBUG engine.syncengine.kernel : OnConnect: setting up RAPI session
** (process:25097): CRITICAL **: synce_info_from_hal: Failed to get a connection for /org/freedesktop/Hal/devices/usb_device_bb4_a51_noserial: Pocket_PC: Not yet connected.
** (process:25097): WARNING **: synce_info_from_odccm: Failed to get devices: The name org.synce.odccm was not provided by any .service files
[synce_info_from_file:69] unable to open file: /home/kibab/.synce/active_connection
** (process:25097): CRITICAL **: synce_info_from_hal: Failed to get a connection for /org/freedesktop/Hal/devices/usb_device_bb4_a51_noserial: Pocket_PC: Not yet connected.
** (process:25097): WARNING **: synce_info_from_odccm: Failed to get devices: The name org.synce.odccm was not provided by any .service files
[synce_info_from_file:69] unable to open file: /home/kibab/.synce/active_connection
[rapi_context_connect:173] Failed to get connection info
File "/usr/local/lib/python2.5/site-packages/dbus/connection.py", line 214, in maybe_handle_message
self._handler(*args, **kwargs)
File "/home/kibab/etc/synce/synce-svn/trunk/sync-engine/SyncEngine/kernel.py", line 272, in _CBHalDeviceConnected
self.OnConnect()
File "/home/kibab/etc/synce/synce-svn/trunk/sync-engine/SyncEngine/kernel.py", line 415, in OnConnect
self.rapi_session = rapicontext.RapiContext(pyrapi2.SYNCE_LOG_LEVEL_DEFAULT)
File "/home/kibab/etc/synce/synce-svn/trunk/sync-engine/SyncEngine/rapicontext.py", line 29, in __init__
pyrapi2.RAPISession.__init__(self,loglevel)
File "pyrapi2.pyx", line 413, in pyrapi2.RAPISession.__init__
RAPIError: -2147467259
=============================================
As you remember, WM6 device requires entering password on device, so when Sync-engine tries to setup RAPI session (and it does immediately), device is NOT yet connected to PC.
=============================================
./sync-engine
SynCE sync-engine starting up
2008-04-17 15:30:01,300 DEBUG syncengine : running main loop
2008-04-17 15:30:01,301 DEBUG syncengine : creating SyncEngine object
2008-04-17 15:30:01,320 DEBUG syncengine : installing signal handlers
2008-04-17 15:30:15,144 INFO engine.syncengine.kernel : _CBHalDeviceConnected: device connected at udi /org/freedesktop/Hal/devices/usb_device_bb4_a51_noserial
2008-04-17 15:30:15,149 INFO engine.syncengine.kernel : device Pocket_PC connected
2008-04-17 15:30:15,150 INFO engine.syncengine.kernel : ProcessAuth : processing authorization for device 'Pocket_PC'
2008-04-17 15:30:15,360 INFO engine.syncengine.kernel : Failed to authorize - disconnect and reconnect device to try again
=============================================
On device I see password prompt at this moment.
=============================================
2008-04-17 15:32:49,133 INFO engine.syncengine.kernel : _CBHalDeviceAuthStateChanged: device authorization state changed: reauthorizing
2008-04-17 15:32:49,134 INFO engine.syncengine.kernel : ProcessAuth : processing authorization for device 'Pocket_PC'
2008-04-17 15:32:49,135 INFO engine.syncengine.kernel : ProcessAuth: authorization not required for device 'Pocket_PC'
2008-04-17 15:32:49,135 DEBUG engine.syncengine.kernel : OnConnect: setting up RAPI session
2008-04-17 15:32:49,545 DEBUG engine.syncengine.kernel : OnConnect: Attempting to bind partnerships
[....and as usual...]
=============================================
Please test it with WM5-devices.
-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference
Don't miss this year's exciting event. There's still time to save $100.
Use priority code J8TL2D2.
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
Guido Diepen
2008-04-21 20:49:55 UTC
Permalink
Hi,
Post by Mark Ellis
You're not wrong, in fact sync-engine appears to not be set up to deal
with locked WM6 in general, this is not just on hal. Your patch is on
the right lines, but I've got a nasty feeling it wont work in all cases,
I just need to think about it.
With any luck Guido or John are reading and may be able to pitch in.
I am reading this yes and I already found this issue the other day to be the
problem (I had some people on my website that actually had this very
problem).

Unfortunately I don't have too much time to dive into the workings of
sync-engine with regards to the handling of password protected devices.

I did however notify John already about this, so hopefully he has a bit of
time for it.

Guido
--
Aviation is proof that given the will, we have the
capacity to achieve the impossible.
--Eddie Rickenbacker
Dr J A Gow
2008-04-22 21:33:23 UTC
Permalink
Post by Mark Ellis
With any luck Guido or John are reading and may be able to pitch in.
Hmm, I never thought to try the security stuff with locked WM6. Works OK
with locked WM5 though. I have a batch of stuff to do on sync-engine
soon so will have a look at it then.

John.
Vasco Steinmetz
2008-04-21 22:08:05 UTC
Permalink
With the latest SVN commit to Sync-Engine from 16.04.08 it doesn't work
anymore here (T-Mobile MDA Vario II aka HTC TyTN aka Hermes 300 running a
freshly reinstalled WM6 and connected by rndis over USB).

It still says the device is pw-locked, but after unlocking it
list_partnerships.py always fails with a dbus error.

I synced a few days before that patch but since then I simply can't get it
back working.

--- snip ---

$ sync-engine -vDEBUG
SynCE sync-engine starting up
2008-04-22 00:03:59,910 DEBUG syncengine : running main loop
2008-04-22 00:03:59,910 DEBUG syncengine : creating SyncEngine object
2008-04-22 00:03:59,975 INFO engine.syncengine.kernel : __init__: connected
device found
2008-04-22 00:03:59,975 INFO engine.syncengine.kernel : _CBDeviceConnected:
device connected at
path /org/synce/odccm/Device/_9749BE9E_DECB_C4C3_1CD2_48BDAF5E35CD_
2008-04-22 00:03:59,993 INFO engine.syncengine.kernel : device MDA_Vario_II
connected
2008-04-22 00:03:59,994 INFO engine.syncengine.kernel : ProcessAuth :
processing authorization for device 'MDA_Vario_II'
2008-04-22 00:04:00,003 DEBUG syncengine : installing signal handlers


$ list_partnerships.py
Traceback (most recent call last):
File "/usr/bin/list_partnerships.py", line 50, in ?
if
e._dbus_error_name=="org.freedesktop.DBus.Python.SyncEngine.errors.Disconnected":
AttributeError: DBusException instance has no attribute '_dbus_error_name'

--- snap ---

Did I miss something that should've been updated during the package
compilation and installation?

Or is my odccm corrupt? I'm getting a proper rndis iface etc...

And yes... I'm compiling Gentoo Ebuilds directly out of SVN.


Cheers,
Vasco
Guido Diepen
2008-04-24 16:50:07 UTC
Permalink
Hi,
Post by Vasco Steinmetz
$ list_partnerships.py
File "/usr/bin/list_partnerships.py", line 50, in ?
if
e._dbus_error_name=="org.freedesktop.DBus.Python.SyncEngine.errors.Disconne
cted": AttributeError: DBusException instance has no attribute
'_dbus_error_name'
He was using Gentoo also and it turned out that he had the following package
installed: dev-python/dbus-python-0.80.2

It turns out that somehwere in version 0.82.3 the functionality of setting the
_dbus_error_name property was added when you create a subclass of the
DbusException. (See http://dbus.freedesktop.org/doc/dbus-python/NEWS.html)

If you run into the above error, please upgrade your dbus-python to the latest
version and your problems should vanish :)

Guido Diepen
--
Aviation is proof that given the will, we have the
capacity to achieve the impossible.
--Eddie Rickenbacker
Vasco Steinmetz
2008-04-24 17:45:06 UTC
Permalink
Post by Guido Diepen
Post by Vasco Steinmetz
$ list_partnerships.py
File "/usr/bin/list_partnerships.py", line 50, in ?
if
e._dbus_error_name=="org.freedesktop.DBus.Python.SyncEngine.errors.Disconne
cted": AttributeError: DBusException instance has no attribute
'_dbus_error_name'
He was using Gentoo also and it turned out that he had the following package
installed: dev-python/dbus-python-0.80.2
It turns out that somehwere in version 0.82.3 the functionality of setting the
_dbus_error_name property was added when you create a subclass of the
DbusException. (See http://dbus.freedesktop.org/doc/dbus-python/NEWS.html)
If you run into the above error, please upgrade your dbus-python to the latest
version and your problems should vanish :)
Verified.

Issue resolved under Gentoo after upgrading dbus-python.


Thank you very much.


Cheers,
Vasco
Ilya Bakulin
2008-04-22 15:54:15 UTC
Permalink
On Mon, 21 Apr 2008 19:28:32 +0100
Post by Mark Ellis
You're not wrong, in fact sync-engine appears to not be set up to deal
with locked WM6 in general, this is not just on hal. Your patch is on
the right lines, but I've got a nasty feeling it wont work in all cases,
I just need to think about it.
With any luck Guido or John are reading and may be able to pitch in.
OK, I'll continue testing SyncEngine working with this patch. By now I haven't encountered any problems. Perhaps you could advise me what to do to see if it will fail?

As I understand, device lock-state shouldn't change once it's connected and unlocked?
--
Ilya Bakulin <***@kibab.com>
Mark Ellis
2008-04-22 21:39:24 UTC
Permalink
Post by Ilya Bakulin
On Mon, 21 Apr 2008 19:28:32 +0100
Post by Mark Ellis
You're not wrong, in fact sync-engine appears to not be set up to deal
with locked WM6 in general, this is not just on hal. Your patch is on
the right lines, but I've got a nasty feeling it wont work in all cases,
I just need to think about it.
With any luck Guido or John are reading and may be able to pitch in.
OK, I'll continue testing SyncEngine working with this patch. By now I haven't encountered any problems. Perhaps you could advise me what to do to see if it will fail?
As I understand, device lock-state shouldn't change once it's connected and unlocked?
You're right, it shouldn't change, except for the locked to unlocked
changed when you authenticate. The problem is that WM5 can be unlocked
directly by the sync-engine auth procedure (and also indirectly if
something else authenticates) while WM6 is always a more indirect
process.

Mark
Mark Ellis
2008-04-22 21:56:43 UTC
Permalink
Post by Mark Ellis
Post by Ilya Bakulin
On Mon, 21 Apr 2008 19:28:32 +0100
Post by Mark Ellis
You're not wrong, in fact sync-engine appears to not be set up to deal
with locked WM6 in general, this is not just on hal. Your patch is on
the right lines, but I've got a nasty feeling it wont work in all cases,
I just need to think about it.
With any luck Guido or John are reading and may be able to pitch in.
OK, I'll continue testing SyncEngine working with this patch. By now I haven't encountered any problems. Perhaps you could advise me what to do to see if it will fail?
As I understand, device lock-state shouldn't change once it's connected and unlocked?
You're right, it shouldn't change, except for the locked to unlocked
changed when you authenticate. The problem is that WM5 can be unlocked
directly by the sync-engine auth procedure (and also indirectly if
something else authenticates) while WM6 is always a more indirect
process.
Ok, this looks ok, and works with WM5, can you try it with WM6. John,
you're the expert, does this look ok ?

Mark
Dr J A Gow
2008-04-22 22:05:18 UTC
Permalink
Post by Mark Ellis
Post by Mark Ellis
You're right, it shouldn't change, except for the locked to unlocked
changed when you authenticate. The problem is that WM5 can be unlocked
directly by the sync-engine auth procedure (and also indirectly if
something else authenticates) while WM6 is always a more indirect
process.
Ok, this looks ok, and works with WM5, can you try it with WM6. John,
you're the expert, does this look ok ?
I'll have a chance to try this with some hardware tomorrow. It seems to
check everything it needs to before calling OnConnect() and it looks
basically sound. I think it is probably sound enough to commit it for
wider testing.

John.
Mark Ellis
2008-04-23 23:14:53 UTC
Permalink
Post by Dr J A Gow
Post by Mark Ellis
Post by Mark Ellis
You're right, it shouldn't change, except for the locked to unlocked
changed when you authenticate. The problem is that WM5 can be unlocked
directly by the sync-engine auth procedure (and also indirectly if
something else authenticates) while WM6 is always a more indirect
process.
Ok, this looks ok, and works with WM5, can you try it with WM6. John,
you're the expert, does this look ok ?
I'll have a chance to try this with some hardware tomorrow. It seems to
check everything it needs to before calling OnConnect() and it looks
basically sound. I think it is probably sound enough to commit it for
wider testing.
John.
Ok, I've committed this to see how it survives in the world :)

Mark
Ilya Bakulin
2008-04-24 17:45:07 UTC
Permalink
Tested today with synce-hal + WM 6.1; all works OK :-)
One moment: probably the message "Authorization failed, disconnect device and connect again" should be changed for WM6-based devices, because reaching this part of code when working with them means just waiting for password on device, not fatal authorization error. Just to make process flow more clear for new users...
For example, "Waiting for password on device..." or something like that.

--
Regards,
Ilya Bakulin

-----Original Message-----
From: Mark Ellis <***@mpellis.org.uk>
Sent: 24 апреля 2008 г. (четверг) 03:14
To: Dr J A Gow <***@furrybubble.co.uk>
Cc: synce-***@lists.sourceforge.net
Subject: Re: sync-engine password-protected WM6 issue.
Post by Dr J A Gow
Post by Mark Ellis
Post by Mark Ellis
You're right, it shouldn't change, except for the locked to unlocked
changed when you authenticate. The problem is that WM5 can be unlocked
directly by the sync-engine auth procedure (and also indirectly if
something else authenticates) while WM6 is always a more indirect
process.
Ok, this looks ok, and works with WM5, can you try it with WM6. John,
you're the expert, does this look ok ?
I'll have a chance to try this with some hardware tomorrow. It seems to
check everything it needs to before calling OnConnect() and it looks
basically sound. I think it is probably sound enough to commit it for
wider testing.
John.
Ok, I've committed this to see how it survives in the world :)


[The entire original message is not included]

Loading...