You are not logged in.

#1 2009-08-24 12:24:51

milasch
Member
From: Toronto, ON
Registered: 2009-05-21
Posts: 100

Usb scanner with root permissions only

Hello

When I open xsane with regular a user, the scanner does not get detected by it. Only when I open xsane as root.

That's probably a permission issue. My user is added to the scanner group.

How would I correct this?

Thanks

Offline

#2 2009-08-24 12:43:22

brebs
Member
Registered: 2007-04-03
Posts: 3,742

Re: Usb scanner with root permissions only

Write a udev rule to identify the scanner and give it the right user group & permissions. Google search is your friend wink

Just to confuse the hell out of us, different distros use different group names. Some have "scanner", some use "usb", some don't even have "usb".

Example:  In /etc/udev/rules.d/91-local.rules

# Scanner.
# sane-find-scanner ; scanimage -L
# From http://forums.gentoo.org/viewtopic-p-33 … ml#3311185
# udevadm info -a --name /dev/usbdev5.3_ep00
# "libusb:003:015" probably means /dev/bus/usb/003/015
SUBSYSTEM=="usb", ATTRS{product}=="CanoScan", GROUP="usb", MODE="0660", SYMLINK+="lide25"

Offline

#3 2009-08-24 13:51:07

milasch
Member
From: Toronto, ON
Registered: 2009-05-21
Posts: 100

Re: Usb scanner with root permissions only

brebs wrote:

Write a udev rule to identify the scanner and give it the right user group & permissions. Google search is your friend wink

Just to confuse the hell out of us, different distros use different group names. Some have "scanner", some use "usb", some don't even have "usb".

Example:  In /etc/udev/rules.d/91-local.rules

# Scanner.
# sane-find-scanner ; scanimage -L
# From http://forums.gentoo.org/viewtopic-p-33 … ml#3311185
# udevadm info -a --name /dev/usbdev5.3_ep00
# "libusb:003:015" probably means /dev/bus/usb/003/015
SUBSYSTEM=="usb", ATTRS{product}=="CanoScan", GROUP="usb", MODE="0660", SYMLINK+="lide25"

I googled it quite a bit to find out this process is rather difficult for newbies. I even read udev wiki but I can't come up with a rule myself. The gentoo forum post you referenced has udevinfo command while it has been replaced with udevadm and the script wouldn't work.

Would you give me more directions?

Here's the output of sane-find-scanner as root.

[root@myhost ~]# sane-find-scanner 
found USB scanner (vendor=0x03f0 [HP], product=0x2504 [Deskjet F4200 series]) at libusb:001:004
found USB scanner (vendor=0x050d [Belkin], product=0x705c [USB2.0 WLAN]) at libusb:001:003
[root@myhost ~]# scanimage -L
device `hpaio:/usb/Deskjet_F4200_series?serial=CN83I3Y197052D' is a Hewlett-Packard Deskjet_F4200_series all-in-one
device `v4l:/dev/video0' is a Noname Kworld ATSC110/115 virtual device
[root@myhost ~]#

I understand the device would be 001:004, but how would I write a rule for it?

Thanks

Offline

#4 2009-11-22 00:10:32

knedlyk
Member
From: L'viv, Ukraine
Registered: 2009-04-14
Posts: 163
Website

Re: Usb scanner with root permissions only

Create file /etc/udev/rules.d/91-local.rules with the following contest:

SYSFS{idVendor}=="03f0", SYSFS{idProduct}=="2504", MODE="0664", GROUP="scanner", ENV{libsane_matched}="yes"

It solves your problem (and mine wink ).

Offline

#5 2009-11-27 11:18:41

nilesh
Member
From: Pune, Maharashtra, India
Registered: 2009-10-07
Posts: 36
Website

Re: Usb scanner with root permissions only

knedlyk wrote:

Create file /etc/udev/rules.d/91-local.rules with the following contest:

SYSFS{idVendor}=="03f0", SYSFS{idProduct}=="2504", MODE="0664", GROUP="scanner", ENV{libsane_matched}="yes"

It solves your problem (and mine wink ).

This does good if you have scanner and printer independent. If its a multifunction device, it doesn't work.

The solution for this is either change the MODE to 666 or become a member of group lp. In my system, lp is the group for the file without the above rule.

Offline

#6 2009-11-27 19:08:31

knedlyk
Member
From: L'viv, Ukraine
Registered: 2009-04-14
Posts: 163
Website

Re: Usb scanner with root permissions only

Well, I am in group lp and scanner and I had the same problem as milasch has. I also have multifunction printer/scanner/copier device. I tried a different combination, but the only good solution  I found is creating that /etc/udev/rules.d/91-local.rules file.

Offline

Board footer

Powered by FluxBB