gnome-pilot needs to be ported to new udev world order

Bug #25653 reported by Murray Cumming
28
Affects Status Importance Assigned to Milestone
Gnome-Pilot
Fix Released
Medium
gnome-pilot (Ubuntu)
Fix Released
Medium
Ubuntu Desktop Bugs

Bug Description

Using Evolution's Edit/Synchronization Preferences menu item, I can't get Ubuntu
Breezy to recognize my Palm, either on /dev/pilot, or ttyUSB0 or ttyUSB1 (the
last 2 show up in dmesg). I've had this working in Fedora Core 3.

Systems/Administration/Device Manager shows 2 devices when the hotsync key is
pressed (dmesg shows that the Palm disconnects itself after the timeout): "Palm
Handheld" on ttyUSB0, and PalmOS PDA on ttyUSB1.

This didn't work for me in Hoary either, even when I made the change in this bug
(now fixed):
https://bugzilla.ubuntu.com/show_bug.cgi?id=3329

This is a different laptop than I was using with Hoary.

Revision history for this message
Daniel Holbach (dholbach) wrote :

Thanks for the bug report. What happens if you plug it in, anything interesting
in dmesg?

Revision history for this message
jon latorre (moebius-etxea) wrote :

Similar problem here with a Palm Z22. It works fine with jpilot, but gnome-pilot cannot communicate with it. The gpilotd daemon dosn't get que hotsync event or someting similar.

I uploaded the dmes output when I connect a push the hotsync button in the PDA.

Revision history for this message
jon latorre (moebius-etxea) wrote : dmesg output

dmesg output when Plam Z22 is connected and hotsync button is pressed.

Revision history for this message
jon latorre (moebius-etxea) wrote : lsusb output

relevant part of the lsusb output

Revision history for this message
Martin Ammermüller (martin-ammermueller) wrote : Re: Synchronization with Palm Zire31 not working.

Same here with Zire 72. Syncing works perfectly with jpilot when i use /dev/ttyUSB1 and partly with kpilot.

Revision history for this message
Martin Ammermüller (martin-ammermueller) wrote : lsusb output for zire 72

why does an attachment require a comment if the comment is short enough to be included in the attachment's title?

Revision history for this message
Martin Ammermüller (martin-ammermueller) wrote : dmesg output for zire 72

foo

Revision history for this message
Daniel Holbach (dholbach) wrote : Re: Synchronization with Palm Zire31 not working.

"cannot read device status, Operation not permitted (1)" seems to indicate a problem with device permissions.

Revision history for this message
jon latorre (moebius-etxea) wrote :

At the beginning I think so. But I've checked the permissions os /dev/ttyUSB1 and are ok and the fact that jpilot works well make me think that it's a gpilotd bug.

Revision history for this message
Martin Pitt (pitti) wrote :

Can you please show us the actual device permissions? I. e. give us the output of the following commands:

  ls -l /dev/ttyUSB* /dev/pilot
  id

Maybe gnome-pilot does some weird ioctl()s which jpilot doesn't do...

Revision history for this message
Martin Pitt (pitti) wrote :

Oh, wait, gpilotd? Then I also need the output of

  grep Groups /proc/`gpilotd`/status

Maybe gpilotd accidentially drops auxiliary groups, so that it is not in the 'dialout' group any more.

Revision history for this message
Martin Pitt (pitti) wrote :

Sorry, instead of the previous grep command, just do the following:

  cat /proc/`gpilotd`/status

Revision history for this message
jon latorre (moebius-etxea) wrote : permisses of /dev/ttyUSB* and /dev/pilot

Output of "ls -l /dev/ttyUSB* /dev/pilot" and "id" commands

Revision history for this message
jon latorre (moebius-etxea) wrote : gpilotd status

Status of the gpilotd process

Revision history for this message
jon latorre (moebius-etxea) wrote : Re: Synchronization with Palm Zire31 not working.

And the dialout group has the GID 20. So it seems that gpilotd keeps the goups

Revision history for this message
Martin Pitt (pitti) wrote :

Thanks. Ok, it was worth a try... :)

So, this now requires the following:

  strace -o gpilotd.trace -p `pidof gpilotd`
  try to use gpilot to do stuff
  press Control+C to stop the strace command
  attach gpilotd.trace here

Revision history for this message
jon latorre (moebius-etxea) wrote : gpilotd trace

Trace of gpilotd while trying to syncronize the palm Z22

Revision history for this message
jon latorre (moebius-etxea) wrote : Re: Synchronization with Palm Zire31 not working.

Finally I found the problem watching the trace log. The problem was that usbfs wasn't mounted on /proc/bus/usb. Doing a google search reveals that it is been discused in the ubuntu forums http://ubuntuforums.org/showthread.php?t=128603

Revision history for this message
Martin Pitt (pitti) wrote :

Aah, that explains a lot. Indeed /proc/bus/usb is deprecated. The USB devices are now managed with udev, and thus /dev/bus/usb (which should be fully compatible) should be used.

Revision history for this message
Martin Pitt (pitti) wrote :

Argh, it additionally scans /proc/bus/usb/devices, how ugly.

Thus, the visor_devices_timeout() function needs to be rewritten to parse sysfs instead to find out about devices; or even better, use /dev/tty* instead of the raw devices. Too bad that gnome-pilot is not maintained upstream any more. :/

Revision history for this message
Martin Ammermüller (martin-ammermueller) wrote :

why not maintained? The last commit to CVS for gnome-pilot is just a day ago.

Revision history for this message
Martin Ammermüller (martin-ammermueller) wrote :

current CVS uses hal callbacks to handle VISOR_USB_DEVICES. But i don't know how functional that already is. Unfortunately i was unable to compile from CVS :-(

Revision history for this message
Martin Ammermüller (martin-ammermueller) wrote : visor_devices_timeout() ported to sysfs

With this patch, gpilotd now scans /sys/bus/usb/devices for new devices which match an entry in devices.xml.

I was able to sync my Zire 72 with this modified gpilotd.
I synced by using the device /dev/pilot since this is automagically made a symlink to /dev/ttyUSB? if it has a visor device attached to it.

         !!!WARNING!!!
Since this my very first patch i submit and my coding experience isn't that good,

SOMEONE REALLY SHOULD CHECK IF THIS PATCH IS SANE!!!

Revision history for this message
jon latorre (moebius-etxea) wrote :

Hey, great job tenco! The patch works fine in my ppc laptop. The Z22 syncronizes like a charm.

Revision history for this message
Daniel Holbach (dholbach) wrote :

Martin, thanks for the amazing work on the patch. We need really need to stress test this patch and I encourage everybody to test it extensively, I therefore sent a call for judgement to Upstream as well: http://bugzilla.gnome.org/show_bug.cgi?id=336473

Changed in gnome-pilot:
assignee: debzilla → desktop-bugs
status: Needs Info → Confirmed
Revision history for this message
Murray Cumming (murrayc) wrote :

Is this in the Ubuntu package, or do I need to build it from source?

Revision history for this message
Daniel Holbach (dholbach) wrote :

Upstream seems to like the patch:

"Many thanks for this patch. I'd stumbled across the patch while helping
diagnose the missing usbfs issue for some ubuntu users, and put it on my todo
list.

It looks likely that the next release of gnome-pilot will offer HAL/DBUS
support, which will avoid the use of usbfs. The above sysfs patch is likely to
be used as a compile-time option if a suitable HAL/DBUS environment is not
available."

As I'm not familiar with the codebase at all, I (for my part) would wait until it is in CVS, somebody else might see this differently.

Revision history for this message
Daniel Holbach (dholbach) wrote :

I put up packages for dapper i386 and dapper amd64, please test and report back: http://daniel.holba.ch/ubuntu/gnome-pilot/

Revision history for this message
dguido (dguido) wrote :

A hotsync with my Tungsten E2 times out with the above packages. I installed both with dpkg and restarted. The pilot-applet appeared black and white as soon as I entered it into my tray and never changed colors through this whole process.

I put the following in /etc/udev/rules.d/10-custom.rules:
BUS="usb", SYSFS{product}="Palm Handheld*", KERNEL="ttyUSB*", NAME{ignore_remove}="pilot", MODE="666"

A second time around I tried mounting /proc/bus/usb and got a really screwed up error message in gnome. It went something like this.
Warning (gpilotd)
The base directory ?^(bleh)(bleh)u?(bleh)(bleh)?^...
...
...
Please fix it or use gnomecc to choose another directory

The (bleh)'s are what I think are international characters that don't show up correctly. It's a box with 4 hex digits inside them.

Thank you for your effort, please keep going! I'd love to get my palm sync'ing to Ubuntu.

Revision history for this message
Martin Ammermüller (martin-ammermueller) wrote :

Does your Tungsten E2 appear in /sys/bus/usb/devices ? Have a look files called "product" & "manufacturer" in subdirectories named $number-$number[.$number][...]. e.g. at the moment my zire shows up in /sys/bus/usb/devices/2-2

Have you a kernel module called "visor" loaded?

Revision history for this message
Martin Ammermüller (martin-ammermueller) wrote :

I was not able to spot a "Tungsten E2" in /usr/share/gnome-pilot/devices.xml , only Tungsten Z and T.

Can you please retrieve the vendor and product ids from files called "idVendor" and "idProduct" in /sys/bus/usb/devices/$subdirectory/ and look them up in /usr/share/gnome-pilot/devices.xml ? The last is a file which contains a list of product/vendor combinations of devices recognised by gnome-pilot.

Revision history for this message
dguido (dguido) wrote :

You don't have to add it to devices.xml. It has the same ID's as a Zire 72. Off the top of my head, I believe it is 80 for vendor and 61 for product.

Yes the visor is loaded.

I'll check if it appears in /sys/bus/usb/devices when I get home, I'm currently at work. Thanks for the quick response.

Revision history for this message
jon latorre (moebius-etxea) wrote :

I have a similar error "Please fix it or use gnomecc to choose another directory" when i was trying to sincronize my z22 aganist a directory that doesn't exit.

If you click on the gnome-pilot applet icon do yo have any pilots defined? If so, in the edit windows the dir of the local base does exits?

Revision history for this message
Daniel Holbach (dholbach) wrote :

All other bugs and nuisances aside, please let's get other bug reports for those issues.

Does connecting with the packages mentioned in the link work?

Changed in gnome-pilot:
status: Confirmed → Needs Info
Revision history for this message
dguido (dguido) wrote :

I created a new bug for Jon Latorre's issue as I'm experiencing it as well: <a href="https://launchpad.net/distros/ubuntu/+source/gnome-pilot/+bug/38622">Bug 38622</a>

Revision history for this message
Dennis Kaarsemaker (dennis) wrote : Re: [Bug 25653] Re: gnome-pilot needs to be ported to new udev world order

Hi <email address hidden>,

Pretty unrelated but did you use a mailclient to comment? Or did you
paste HTML in the comment manually?

Revision history for this message
Daniel Holbach (dholbach) wrote :

Upstream comment: "Update: the HAL/DBUS support in CVS is still experimental. It seems that the palm/pda rules supplied with libhal are not able to match robustly.
For one thing, they require the visor module, which is likely to be unnecessary once pilot-link 0.12. with libusb support is released and working well. Secondly, at least on my fc5 system, the match rules had trouble matching the usbserial device - perhaps due to slowness in the creation of the devices.

So, CVS may change, so that the HAL callback just matches on USB vendor/product
IDs from devices.xml."

Revision history for this message
roastpork (mcolligan) wrote :

Pathed rpm files by Daniel do not help in my case. Zire 31.

Revision history for this message
Olivier Cortès (olive) wrote :

Hi,
surrely related to this bug, i can't hotsync with an IBM WorkPad c505 (rebranded Palm m505c, Palm OS 4.0), connected with USB cradle on up-to-date Dapper. When I press HotSync button on cradle, dmesg reports :

[4300354.008000] usb 2-2: new full speed USB device using uhci_hcd and address 12
[4300354.140000] visor 2-2:1.0: Handspring Visor / Palm OS converter detected
[4300354.140000] usb 2-2: Handspring Visor / Palm OS converter now attached to ttyUSB0
[4300354.140000] usb 2-2: Handspring Visor / Palm OS converter now attached to ttyUSB1

When The device reports "failed connection", the usb device disapear.

After many try-and-failures, one of my attempts to connect succeded (when the pilot applet was launched from Evo 2.6 if that matters), gnome-pilot was able to get my HandHeld Name and ID, but no more... Since then I hadn't be able to sync, even one time.

Should i add that under WinXP it works, i used the Palm app to put my Handheld name and ID in the device. (not synched because no data on any side at this time, i just used windows to verify the hardware was not broken since this is a second hand device).

If that matters too, the successfull connection occured on ttyUSB1 (the handheld creates 0 & 1).

I tried Daniel's packages, with no luck.

Revision history for this message
wastrel (wastrel) wrote : gpilotd crash

I'm unable to sync my Clie with gpilotd, typically it hangs until Palm OS times out. gpilotd spits out a bunch of these errors:

(gnome-pilot:6045): gpilotd-WARNING **: pi_accept_to: Connection timed out

(gnome-pilot:6045): gpilotd-WARNING **: pi_accept_to: timeout was 2 secs

Sometimes gpilotd hangs completely and I have to kill -9 it.
Sometimes the sync actually works (rarely).
Sometimes gpilotd crashes and I get interesting stuff in /var/log/messages about it (see attachment.)

It seems to be related to this bug, apologies if I'm wrong.

I have installed Daniel's packages but they don't have any effect, as far as I was able to determine.

Revision history for this message
wastrel (wastrel) wrote : Another crash

After more tests, it seems that Daniel's packages have increased the number of successful sync attempts, but gpilotd still hangs and also crashes. Attached is a log of another crash, which occurred after several successful syncs, a hang, and another success.

Revision history for this message
Matt Davey (mcdavey) wrote :

see also #38574. It appears that the current 2.6.15 kernel is causing the problems. There have been success stories after upgrading to 2.6.17.1, and one poster suggested a workaround is to start gpilotd a second or two after initiating the sync. (open a terminal, do 'killall gpilotd', start the sync, wait, then do '/usr/libexec/gpilotd' (sorry, that path might be wrong on Ubuntu, try 'locate gpilotd' if it isn't there).

Revision history for this message
Dan Trevino (dantrevino) wrote :

I'm unable even to do the workaround.

First, my Treo 600 is reporting id 0830:0100 which is different from what is in devices.xml. Fine, I can change it, but still when I sync dmesg only shows:

                    [17267901.752000] usb 1-1: new full speed USB device using ohci_hcd and address 13

obviously no /dev/ttyUSB* or /dev/pilot exist

If I start gpilotd from the command line, and try to sync, I get:

                  (gnome-pilot:10532): gpilotd-WARNING **: Unable to bind to pilot
                  gpilotd-Message: setting PILOTRATE=57600

And no sync.

Not sure if this adds anything to the discussion, but....

Revision history for this message
Daniel Holbach (dholbach) wrote :
Revision history for this message
Olivier Blanc (olivier-blanc) wrote :

I managed to run one (but only one) sync with Daniel's patch on my edgy. but since, it wont sync anymore :
            gpilotd-WARNING **: pi_accept_to returned -1

/dev/ttyUSB* and /dev/pilot exist and seems to be OK

When I start gpilotd from command line with debug infos, I get :
gpilotd-Message: gnome-pilot 2.0.14pre5 starting...
gpilotd-Message: compiled for pilot-link version 0.11.8
gpilotd-Message: compiled with [VFS] [USB] [IrDA] [Network]
gpilotd-Message: Activating CORBA server
gpilotd-Message: bonobo_activation_active_server_register = 0
gpilotd-Message: Regarde Cradle (/dev/pilot)
gpilotd-Message: Found 4766, 0001
gpilotd-Message: Using net TRUE
...gpilotd-Message: setting PILOTRATE=9600

(gnome-pilot:8846): gpilotd-WARNING **: pi_accept_to returned -1: Connexion terminée par expiration du délai d'attente (connexion closed due to timeout)

(gnome-pilot:8846): gpilotd-WARNING **: pi_accept_to: timeout was 10 secs

Anything else I can check or try ?

Revision history for this message
Daniel Holbach (dholbach) wrote :

I'll update the packages to the 2.0.14 release hopefully soon - hopefully that fixes it.

Revision history for this message
Daniel Holbach (dholbach) wrote :

A new version (2.0.14) was uploaded to Edgy. It'd be nice if you had a chance to test this and report back, if the problem still persists.

Revision history for this message
Olivier Blanc (olivier-blanc) wrote :

I gave a try to the new version :

It doesn't start automatically through the applet.

I tried to run gpilotd from the shell.
I looks like if it's working sometimes :
First fime, it worked properly

Second time :
gpilotd-Message: setting PILOTRATE=115200
(gnome-pilot:22093): gpilotd-WARNING **: pi_accept_to returned -202: Aucun fichier ou répertoire de ce type (no file or directory of this type)
(gnome-pilot:22093): gpilotd-WARNING **: pi_accept_to: timeout was 10 secs

third time :
gpilotd-Message: setting PILOTRATE=115200
gpilotd-Message: Device Cradle has 0 events
gpilotd-Message: Instanciation de 5 conduites...
and it started...

fourth time : same messages as second time
gpilotd-Message: setting PILOTRATE=115200
(gnome-pilot:22093): gpilotd-WARNING **: pi_accept_to returned -202: Aucun fichier ou répertoire de ce type
(gnome-pilot:22093): gpilotd-WARNING **: pi_accept_to: timeout was 10 secs

and fifth time : same error messages.

Let me know if I can go further in testing.

Revision history for this message
Daniel Holbach (dholbach) wrote :

I doubt that that's the same bug. Can you file a new bug on gnome-pilot and run
    LC_ALL=C gpilotd

Revision history for this message
Daniel Holbach (dholbach) wrote :

Ok, this bug is about gnome-pilot using udev and hal, which it does in Edgy right now - as the code has pretty much changed in the meantime, I recommend filing new bug reports with the Edgy version.

Changed in gnome-pilot:
status: Needs Info → Fix Released
Changed in gnome-pilot:
importance: Unknown → Medium
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.