Ok, I got my usb scanner to work first time ever in Linux using sane-backends. I also installed xsane frontend, but i can only run it when su'd or logged in as root. How do I fixed that? I looked at man usb-sane, but it was of a little help for me.
Also now I get an error during boot up while theres "usb hotplugging" being done. (i use udev).

Code:

chown: cannot access "/proc/bus/usb/002/004" No such file or directory
chmod: cannot access "/proc/bus/usb/002/004" No such file or directory

Thank you._________________There is, a not-born, a not-become, a not-made, a not-compounded. If that unborn, not-become, not-made, not-compounded were not, there would be no escape from this here that is born, become, made and compounded. - Gautama Siddharta

Ok, I got my usb scanner to work first time ever in Linux using sane-backends. I also installed xsane frontend, but i can only run it when su'd or logged in as root. How do I fixed that? I looked at man usb-sane, but it was of a little help for me.
Also now I get an error during boot up while theres "usb hotplugging" being done. (i use udev).

Code:

chown: cannot access "/proc/bus/usb/002/004" No such file or directory
chmod: cannot access "/proc/bus/usb/002/004" No such file or directory

The thing is, those paths don't even exist
Theres no such thing as /proc/bus/usb/002/004, the highest number is 002/003 which is the scanner._________________There is, a not-born, a not-become, a not-made, a not-compounded. If that unborn, not-become, not-made, not-compounded were not, there would be no escape from this here that is born, become, made and compounded. - Gautama Siddharta

How about the following /etc/hotplug/usb/libusbscanner that comes with the latest sane-backends (1.0.14-r3)

Code:

#!/bin/sh

# This file is part of sane-backends.
#
# This script changes the permissions and ownership of a USB device under
# /proc/bus/usb to grant access to this device to users in the scanner group.
#
# Ownership is set to root:scanner, permissions are set to 0660.
#
# Arguments :
# -----------
# ACTION=[add|remove]
# DEVICE=/proc/bus/usb/BBB/DDD
# TYPE=usb

Ive read the script, its same as the one you posted, but I can see a resolution in it. The question is, why is hotplug trying to access files 002/004 when they dont exist, clearly there is no device on it. _________________There is, a not-born, a not-become, a not-made, a not-compounded. If that unborn, not-become, not-made, not-compounded were not, there would be no escape from this here that is born, become, made and compounded. - Gautama Siddharta

The script above is indeed a verbatim copy of the one included in the latest sane-backends. I did not write it.
Could it be that

Code:

DEV=$(expr $DEV + 1)

should have been

Code:

DEV=$(expr $DEV - 1)

in your case, or in all cases? In your case at least, it looks very much like 004 should become 003, not 005. My guess is this check (-z) has been added for udev systems. All it does is increase the device number when /proc/bus/usb/BBB/DDD does not exist. Decreasing DDD should solve your problem. If it does, could you please file a bug on bugs.gentoo.org to let our devs know about this issue? Thanks.

The script above is indeed a verbatim copy of the one included in the latest sane-backends. I did not write it.
Could it be that

Code:

DEV=$(expr $DEV + 1)

should have been

Code:

DEV=$(expr $DEV - 1)

in your case, or in all cases? In your case at least, it looks very much like 004 should become 003, not 005. My guess is this check (-z) has been added for udev systems. All it does is increase the device number when /proc/bus/usb/BBB/DDD does not exist. Decreasing DDD should solve your problem. If it does, could you please file a bug on bugs.gentoo.org to let our devs know about this issue? Thanks.

I'll try to do as you have told me to do now and come and post results._________________There is, a not-born, a not-become, a not-made, a not-compounded. If that unborn, not-become, not-made, not-compounded were not, there would be no escape from this here that is born, become, made and compounded. - Gautama Siddharta

Yes, changing the plus sign into minus solved it as well. Thanks a lot!
Im gonna fill the bug report now._________________There is, a not-born, a not-become, a not-made, a not-compounded. If that unborn, not-become, not-made, not-compounded were not, there would be no escape from this here that is born, become, made and compounded. - Gautama Siddharta

# This file is part of sane-backends.
#
# This script changes the permissions and ownership of a USB device under
# /proc/bus/usb to grant access to this device to users in the scanner group.
#
# Ownership is set to root:scanner, permissions are set to 0660.
#
# Arguments :
# -----------
# ACTION=[add|remove]
# DEVICE=/proc/bus/usb/BBB/DDD
# TYPE=usb

In petrjanda's case it turned out the device number had to be decreased and not increased. It has to do with udev and I have no idea whether it is generic or specific to his setup.

I added some tracing to find out if the script is actually called and what input it receives and what is does.

I just found out that the script does not receive the same input when hotplug is restarted and when the scanner is switched back on.
When I do /etc/init.d/hotplug restart, the script is called three times and does not work. I get

I have no idea what DEVPATH=bus/usb/devices/2-1 means. I guess 2 is the bus and 1 the device. Or is it 1 for first device. I have to do +2 because my scanner starts as /proc/bus/usb/002/003. Or maybe 2-1 is the other way around and should become /proc/bus/usb/{1++}/{2++} ?

But when I switched my scanner on, script is called once and works. I get

I had some craziness like that when I upgraded to sane-backends 1.0.14, lots of errors in the start of hotplug, and usb hotplugging would just fail. I had to remove the "scanner" script I had included when I upgraded to the 2.6.5 kernel, it was getting the way of the libusbscanner which came with sane-backends 1.0.14.

But I still could see the scanner, and my usb card reader wouldn't work either. It turns out the libusbscanner script was setting up the card reader as scanner, because of the line:

Code:

DEV=$(expr $DEV + 1)

I commented this line out of the script, and now the scanner and the card reader work again. It is good that sane-backends took care the usb usermap and the libusbscanner script, but why is there this $DEV + 1 part of the script? And why do some people need to to be +1, some -1 and some +2?

Getting this scanner to work with kernel 2.6.5 has been a surreal experience.

I had an interesting time getting xsane to open and access my scanner (canon lide 50) as a user (I was alway able to access the scanner as root). As everything in this thread, and numerous others, failed me, I tried something I didn't recall noticing. I created a group called scanner and added myself to it. After doing so, I installed

Code:

emerge libusb hotplug xsane sane-frontends sane-backends

.....After installing I started hotplug, exited my su environment, opened xsane and it gave me the choice of device (I also have a 3com usb webcam).

Since I had modified files and wanted a fresh start, before installing the above packages, I made sure they were all uninstalled and I removed 2 directories. In addition, I stopped hotplug and deleted it from startup. I probably over did it, but whatever.

I laughed at myself at how simple it was in the end. Granted this might not be everyone's solution, but it IS practical. xsane wants to access the scanner using group root or scanner scanner by default.

I had an interesting time getting xsane to open and access my scanner (canon lide 50) as a user

Are you really impying here, that you have the "Canon LiDE 50" working with sane? If so, what did you do? I'm just now doing research on wich scanner to buy. And apart from the fact that (until just now) everybody says that this scanner just "won't work", it has exactly the features, I want to have. So, could you clarify that for me, please?

Though only when the scanner is plugged IN; if I unplug the scanner and restart hotplug then plug the scanner again there is no error when I restart hotplug.
Changing DEV=$(expr $DEV + 1) from +1 to -1 or +2 does not help_________________#Thelma