[sane-devel] Hotplug and udev files created automatically now, please test!

Peter Christy christy at attglobal.net
Thu May 4 08:05:38 UTC 2006


On Tuesday 02 May 2006 18:27, Wittawat Yamwong wrote:

> 2. If your libusb doesn't properly open a device node under /dev/bus/usb/
> (like mine; libusb bug?) but works correctly with usbfs in /proc/bus/usb/,
> add the following line to your udev configuration file (It works at least
> on my system):
>
> SUBSYSTEM=="usb", ACTION=="add", ENV{PRODUCT}=="<VID>/<PID>/*",
> RUN+="/bin/sh -c '/bin/chgrp scanner $env{DEVICE}; /bin/chmod 664
> $env{DEVICE}'"
>
> Replace <VID> and <PID> with the correct USBID of your scanner and check
> the group and permission if it matches your system. See udev man page
> and /usr/src/linux/Documentation/usb/hotplug.txt for more info.


This sounds similar to my issue. sane-find-scanner produces:

found USB scanner (vendor=0x04b8, product=0x011d, chip=LM983x?) at 
libusb:001:003 (it often appears at 002:002, but is variable!)

scanimage -L produces:

scanimage: no SANE devices found

so it definitely looks like a permission problem. If I change the permissions 
on /proc/bus/... manually it works! there are devices at 
both /proc/bus/usb/001/003 and /dev/bus/usb/1/3. Both have root/root 
permissions.

I have added your line (slightly amended) to my udev rules:

# permissions for usb scanner
SUBSYSTEM=="usb", ACTION=="add", ENV{PRODUCT}=="04b8/011d/*", 
RUN+="/bin/sh -c '/bin/chgrp scanner $env{DEVICE}; /bin/chmod 664 
$env{DEVICE}'"  (all on one line - its been word-wrapped by my e-mail 
program!)

Even with this line, the permissions on /dev/bus/usb/1/3 remained root-root, 
as did the corresponding lines in /proc/bus/...

I have a feeling that the problem may be $env{DEVICE}. This suggests to me 
(and remember that I'm no programmer!) that there should be an environment 
variable called DEVICE being set somewhere, but there doesn't appear to be.

If I manually change permissions on /dev/bus/usb/1/3, scanimage still doesn't 
pick up my scanner. However, if I change permissions on /proc/bus/usb/001/003, 
then it does.

In other words, it appears to be giving /proc/bus/... priority 
over /dev/bus/...

According to messages elsewhere in this thread, it should use /dev/bus/ if its 
available, and only use /proc/bus if there is no device on /dev/bus/

This doesn't seem to be happening!

Does this help at all?

BTW, I have now removed my line that created /dev/usbscanner.

-- 
Pete
christy at attglobal.net



More information about the sane-devel mailing list