You are not logged in.

#1 2008-06-11 16:33:05

jamtat
Member
Registered: 2008-03-13
Posts: 229

initial hurdles in moving to Arch: scanner

Debian/Ubuntu user of some years (ca. 6) thinking of moving over to Arch. Did a test installation of Arch on a 2nd hard drive. Managed to install most basic needed software and configure X. Now, other hardware is hanging things up: the scanner (HP5200C) works fully only for root. This same scanner works fine for my user under the Ubuntu installation I have on the 1st hard drive on this same machine.

I consulted an Arch wiki page devoted to scanners ( http://wiki.archlinux.org/index.php/USB_Scanner_Support ) but it did not help me get it working. Running sane-find-scanner as user brings back results and correctly identifies the scanner. Running scanimage -L as user does not identify any scanner, though if I run that command as root the scanner is correctly identified. Running xsane as user brings up an expected error message that no scanner was found. Running xsane as root the scanner is found and I am able to use xsane to do test scans. I have added my user to the scanner group, incidentally.

This is obviously a permissions problem. In fact, it's a twofold permissions problem, from my perspective: 1) permissions need to be changed; and 2) I am unsure exactly which permissions to change. Then, there is the added problem of how to make the permission changes permanent.

So, an appeal here for some help troubleshooting this problem. I've looked at the wiki, searched and read a bit in the forums, and searched the wider web. I've found various snippets of information and have experimented a bit. But I am now realizing that, because I don't understand exactly where the problem lies, nor do I know for sure how to trace it down, I'm sort of grasping at straws. I don't want to keep hacking away at the system in a half-informed manner, thereby running the risk of screwing things up or spoiling a fresh installation.

I'm hoping there are folks on this forum knowledgeable enough to point to some areas that need checking in order to diagnose this problem. Once the nature of the problem has been clarified, a solution can be implemented. I would be happy, in the context of this thread, to write up some essential procedures for setting up scanners under Arch. It seems from searching I've done so far that such a set of procedures is lacking. Please correct me if I'm wrong about that.

Awaiting input on this issue.

Thanks,
James

Offline

#2 2008-06-11 16:38:49

fwojciec
Member
Registered: 2007-05-20
Posts: 1,411

Re: initial hurdles in moving to Arch: scanner

If it only works as root then it's, most likely, a permissions issue...  I had a similar problem with a Canon LiDE 20 scanner.  The solution, in my case, was to create a udev rule that looks something like this:

$ cat /etc/udev/rules.d/96-scanner.rules 
BUS=="usb", SYSFS{product}=="CanoScan", MODE="664", GROUP="scanner"

You'd obviously need to adjust the rule to work with you scanner; you also need to create a "scanner" group and make sure that your user is in it for this to work.

Offline

#3 2008-06-11 16:44:09

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

Re: initial hurdles in moving to Arch: scanner

Who/what is the 4 in 664 for? wink  Only need 660.

For distros which cut down on the number of user groups, this is convenient:

/etc/udev/rules.d/91-local.rules

# From http://forums.gentoo.org/viewtopic-p-3311185.html#3311185
# udevinfo -a --name /dev/usbdev5.3_ep00
# "libusb:003:015" probably means /dev/bus/usb/003/015
# Fedora doesn't have usb group!
SUBSYSTEM=="usb", ATTR{product}=="CanoScan", GROUP="users", MODE="0660"

Offline

#4 2008-06-11 19:13:29

jamtat
Member
Registered: 2008-03-13
Posts: 229

Re: initial hurdles in moving to Arch: scanner

brebs wrote:

For distros which cut down on the number of user groups, this is convenient:

Is this a reference to Arch? I.e., you're saying that it's one of those distros that cuts down on the number of user groups? And that this may be why the scanner group would need to be created, per the first response in this thread, in order for that first resolution to work?

Thanks,
James

Offline

#5 2008-06-11 23:17:48

jamtat
Member
Registered: 2008-03-13
Posts: 229

Re: initial hurdles in moving to Arch: scanner

According to this documentation http://wiki.archlinux.org/index.php/Groups , Arch already has a scanner group. Do those who contributed to this thread so far maintain that the documentation is wrong? Outdated maybe? If it's not wrong, my supposition is that the first udev rule suggested offers the better resolution. That is, if the key to resolving this problem is to make udev associate the scanner device file with the scanner group. I have yet to test it so I can't confirm whether this is the key to resolving my scanner problem or not. Further input will be appreciated. In any case, it would appear that, if Arch has a comparatively limited number of groups, the scanner group is not one of those missing.

Thanks,
James

Last edited by jamtat (2008-06-11 23:18:55)

Offline

#6 2008-06-11 23:21:18

fwojciec
Member
Registered: 2007-05-20
Posts: 1,411

Re: initial hurdles in moving to Arch: scanner

What group you choose to use, in this particular case, is mostly an aesthetic consideration.

Offline

#7 2008-06-12 12:32:10

jamtat
Member
Registered: 2008-03-13
Posts: 229

Re: initial hurdles in moving to Arch: scanner

fwojciec wrote:

What group you choose to use, in this particular case, is mostly an aesthetic consideration.

"Mostly aesthetic" meaning that it is bound to work whether the scanner device file gets associated by the udev rule with either group? I'm gonna choose the rule that associates the scanner with the scanner group, for reasons that seem obvious to me--assuming I understand what's going on with these udev rules. Here's the way I'd go about this: 1) su to the directory where udev rules are; 2) issue touch myscanner.rules (I assume "my" should be changed to something numerical since rules probably get applied by the system based on numerical sequence of the file's name); 3) change permissions on the newly-created file to match those of other files in that directory; 4) edit the newly created file and add a line something like BUS=="usb", SYSFS{product}=="CanoScan", MODE="664", GROUP="scanner" (edit that line so that it reflects details of your actual scanner) to the file and save it. Reboot and the scanner should work for the unprivileged user--if that user has been made a member of the scanner group.

Wanna add anything more to this anyone? I'm about to do a new, fresh test install to see if it actually works. I'll report back on the results.

Thanks,
James

PS For more on udev, what are udev rules and how to write them see the document "Writing udev rules" at http://www.reactivated.net/writing_udev_rules.html

Last edited by jamtat (2008-06-12 12:41:24)

Offline

#8 2008-06-12 13:28:57

fwojciec
Member
Registered: 2007-05-20
Posts: 1,411

Re: initial hurdles in moving to Arch: scanner

Sounds good.

Offline

#9 2008-06-12 14:42:50

jamtat
Member
Registered: 2008-03-13
Posts: 229

Re: initial hurdles in moving to Arch: scanner

Based on documentation I've been reading and further experimentation (on my Ubuntu system, to which the same scanner is attached and with which it works just fine), the udev rule for my particular scanner should look like this:

BUS=="usb", ATTRS{product}=="HP ScanJet 5200C", MODE="664", GROUP="scanner"

In the documentation they make it sound a bit simpler than it turned out to be (for me) to find the right strings by which to identify the hardware to be specified in the rule. I had to do a fair amount of rooting around in /sys before I could feed udevinfo the right parameters to get the strings for this device. Still have not tried this on a fresh install of Arch but will report back on whether it solves the problem of user not being able to scan, once I get back to setting up that system.

I should also mention that a random sampling of files in the /etc/udev/rules.d directory--on both my Ubuntu and on a recently set up Arch test system--reveals that permissions on files there are set to 644. Also, I think I'll adopt the practice recommended in some of the documentation I've read of creating a file in /etc/udev/rules.d called 10-local.rules and putting the scanner (and other) rules I create into that file.

James

Last edited by jamtat (2008-06-12 14:44:02)

Offline

#10 2008-06-12 18:02:11

jamtat
Member
Registered: 2008-03-13
Posts: 229

Re: initial hurdles in moving to Arch: scanner

I'm happy to report that creating the udev rule worked: my unpriviledged user can now scan. scanimge -L, when invoked by the user, also now reports valid information about the scanner. The basic steps for doing what I've done, then, are as follows. 1) install sane/xsane, which causes Arch to create the scanner group; 2) use documentation that can be found at the link I provided for how to get valid information about your scanner, information you will use to create a udev rule; 3) as root, create a file under /etc/udev/rules.d (I called it 10-local.rules in my case); 4) add to that file strings you found in step 2 that identify your scanner; 5) add your user to the scanner group (gpasswd -a youruser scanner); 6) reboot the system or restart udev for the changes to take effect. These are the basic steps to allow your user to use the scanner under Arch. Unless you have a scanner exactly like mine, they will need to be adapted to suit your system.

Thanks for the help. Now, on to some printing experiments.

James

Last edited by jamtat (2008-06-12 19:44:18)

Offline

Board footer

Powered by FluxBB