|
From: Benjamin G. <Be...@gm...> - 2008-02-09 00:01:05
|
Hi,
This is a reply to the post of Christoph Blank on Feb 08, 2008
I have subscribed to this list only after having read this message in the
archives, so i have to apologize for not being able to reply directly
inside his thread.
> Hi,
>
> I'm using version 0.22 with the evolution and IRMC plugins.
> I'm trying to sync my SE w810i via USB (cable) but always
> receive this error either in multisync-gui or msynctool:
>
> Member 1 of type irmc-sync had an error while connecting: Cannot
> connect via OBEX.
> Member 2 of type evo2-sync just connected
> Member 2 of type evo2-sync just disconnected
> All clients have disconnected
> The sync failed: Unable to connect one of the members
Until a few hours ago, I had the same problem with my new SonyEricsson
K550i. However I did some experimental research and managed to make it
work, although it includes some very specific hack with the source code and
is surely not applicable to the average user nor intended by the developer
of the software.
First, you have to make sure, that obex is working fine. Make sure
permissions on the USB device are properly set. I may be wrong, the method
I describe here does not access /dev/ttyACM0 but a more lowlevel usb
device. On my gentoo system this is for example /dev/bus/usb/001/008 the
latter numbers varying accordng to usb bus and time of plugging in. Check
that file for permissions.
Test obex with:
-------------------------------
$ obex_test -u
Using USB transport, querying available interfaces
Interface 0: Sony Ericsson Sony Ericsson K550 Sony Ericsson Device 069 USB
WMC OBEX Interface
Use 'obex_test -u interface_number' to run interactive OBEX test client
$ obex_test -u 0
Using USB transport
OBEX Interactive test client/server.
> c
Tx: 80 00 10 10 00 FF FF 4A 00 09 4C 69 6E 75 78 00
Connect OK!
Version: 0x10. Flags: 0x00
> d
Tx: 81 00 03
Disconnect done!
> q
------------
If this is all fine, but the irmc-plugins still shows an error, it seems
that the plugin does not access the right device. Since there is absolutely
no documentation on irmc-plugin using cable, I did not manage to find out
what to write into <cabledev>
So I read the source code of obex_test an realized that it uses a different
method of connecting to the USB device than the opensync irmc-plugin. I
modified the source code of irmc-plugin to use the same method -- and there
it worked! Now you have to write the interface number printed by obex_test
into <cabledev> instead of a device file
Of course this is a ugly hack and I did not test whats going on if you enter
non-digits into the field or if you specify the wrong interface. Also you
have to recompile the plugin from source by yourself (which is no problem
for me since I use gentoo)
> The config for IRMC is as follows (note is disabled since I read this
> causes problems)
I dont know any details but on my machine it did only work if I disable it
directly on the command line
msynctool --sync SE-sync --filter-objtype note
filter.conf created by kitchensync did not work or was not properly
configured. (?)
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE Filter>
<filter>
<contact/>
<event/>
<todo/>
<data/>
</filter>
>
> <config>
> <connectmedium>cable</connectmedium>
> <irname></irname>
> <irserial></irserial>
> <cabletype>0</cabletype>
> <cabledev>/dev/ttyACM0</cabledev>
> </config>
my irmc-sync.conf:
<config>
<connectmedium>cable</connectmedium>
<cabletype>0</cabletype>
<cabledev>0</cabledev>
</config>
> Calender settings should work too.
>
> I tried to use an older version (debian unstable) of multisync,
> which worked in one direction (phone to evolution) but not the
> other, so I upgraded to 0.22.
>
> Now I always get this obex message and I'm stuck, can't find any
> resources about it.
>
> Can anyone please give me a hint? Unfortunately I have no Infrared
> or Bluetooth on this machine.
>
Pleas note, that I am not an experienced C coder. So please does anyone
improve and strengthen the new code. Also I did not look at the 0.3x
branch. Maybe this issue is already solved there.
> Thank you,
> Christoph
Regards,
Ben
diff -uar libopensync-plugin-irmc-0.22.orig/src/irmc_obex.c
libopensync-plugin-irmc-0.22/src/irmc_obex.c
--- libopensync-plugin-irmc-0.22.orig/src/irmc_obex.c 2007-03-27
13:49:52.000000000 +0200
+++ libopensync-plugin-irmc-0.22/src/irmc_obex.c 2008-02-09
00:52:08.000000000 +0100
@@ -523,9 +523,14 @@
#endif
break;
case MEDIUM_CABLE:
- if (!(handle = OBEX_Init(OBEX_TRANS_CUST, obex_event, 0)))
- return(0);
- OBEX_RegisterCTransport(handle, &cabletrans);
+ //if (!(handle = OBEX_Init(OBEX_TRANS_CUST, obex_event, 0)))
+ // return(0);
+ //OBEX_RegisterCTransport(handle, &cabletrans);
+
+ if(! (handle = OBEX_Init(OBEX_TRANS_USB, obex_event, 0))) {
+ osync_error_set(userdata->error, OSYNC_ERROR_GENERIC, "OBEX_Init
failed.");
+ return(0);
+ }
break;
}
OBEX_SetUserData(handle, (gpointer) userdata);
@@ -539,6 +544,8 @@
obexdata_t *userdata;
struct sockaddr_un addr;
+ obex_interface_t *obex_intf;
+ int intf_num, interfaces_number;
userdata = (obexdata_t*) OBEX_GetUserData(handle);
userdata->connected = 0;
@@ -556,11 +563,18 @@
ret=OBEX_TransportConnect (handle, (struct sockaddr*) &addr, 0);
break;
case MEDIUM_CABLE:
- ret=OBEX_TransportConnect (handle, (struct sockaddr*) &addr, 0);
+ intf_num=atoi(userdata->cabledev);
+ interfaces_number = OBEX_FindInterfaces(handle, &obex_intf);
+ if (intf_num >= interfaces_number) {
+ osync_error_set(error, OSYNC_ERROR_GENERIC, "Invalid interface
number");
+ return(0);
+ }
+ obex_intf += intf_num;
+ ret=OBEX_InterfaceConnect (handle, obex_intf);
break;
}
if (ret < 0) {
- osync_error_set(error, OSYNC_ERROR_GENERIC, "Cannot connect via
OBEX.");
+ osync_error_set(error, OSYNC_ERROR_GENERIC, "Cannot connect to USB via
OBEX (Patched Version).");
return FALSE;
}
userdata->connected = 1;
|