Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux? |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
04-23-2009, 01:38 AM
|
#1
|
Member
Registered: Oct 2004
Location: Tartu, Århus,Nürnberg, Europe
Distribution: Debian, Ubuntu, Puppy
Posts: 619
Rep:
|
only can scan as root: usb scanner & ubuntu 8.10
Hi,
I have seen many similar complaints around on the web but no suggestion which actually works.
I have ubuntu 8.10 amd64 2.6.27-11 kernel, xsane & friends installed. Everything works perfectly when I scan as root. Scanner is detected as non-root as well:
Code:
siim@Shiva:~$ sane-find-scanner
# sane-find-scanner will now attempt to detect your scanner. If the
# result is different from what you expected, first make sure your
# scanner is powered up and properly connected to your computer.
# No SCSI scanners found. If you expected something different, make sure that
# you have loaded a kernel SCSI driver for your SCSI adapter.
found USB scanner (vendor=0x04a9, product=0x2213, chip=GL841?) at libusb:002:010
# Your USB scanner was (probably) detected. It may or may not be supported by
# SANE. Try scanimage -L and read the backend's manpage.
# Not checking for parallel port scanners.
# Most Scanners connected to the parallel port or other proprietary ports
# can't be detected by this program.
# You may want to run this program as root to find all devices. Once you
# found the scanner devices, be sure to adjust access permissions as
# necessary.
but scanimage does not work:
Code:
siim@Shiva:~$ scanimage -L
No scanners were identified. If you were expecting something different,
check that the scanner is plugged in, turned on and detected by the
sane-find-scanner tool (if appropriate). Please read the documentation
which came with this software (README, FAQ, manpages).
when i strace the process, I see a lot of messages like:
Code:
open("/dev/bus/usb", O_RDONLY|O_NONBLOCK|O_DIRECTORY|0x80000) = 4
open("/dev/bus/usb/002", O_RDONLY|O_NONBLOCK|O_DIRECTORY|0x80000) = 4
open("/dev/bus/usb/002/010", O_RDWR) = -1 EACCES (Permission denied)
open("/dev/bus/usb/002/010", O_RDONLY) = 6
open("/dev/bus/usb/002/006", O_RDWR) = -1 EACCES (Permission denied)
open("/dev/bus/usb/002/006", O_RDONLY) = 6
open("/dev/bus/usb/002/001", O_RDWR) = -1 EACCES (Permission denied)
open("/dev/bus/usb/002/001", O_RDONLY) = 6
open("/dev/bus/usb/002/010", O_RDWR) = -1 EACCES (Permission denied)
open("/dev/bus/usb/002/010", O_RDONLY) = 4
open("/dev/bus/usb/002/006", O_RDWR) = -1 EACCES (Permission denied)
open("/dev/bus/usb/002/006", O_RDONLY) = 4
open("/dev/bus/usb/002/001", O_RDWR) = -1 EACCES (Permission denied)
open("/dev/bus/usb/002/001", O_RDONLY) = 4
ie I have read-only access to usb, usb belongs to root:
Code:
siim@Shiva:~$ ll /dev/bus/usb/002/
kokku 0
crw-rw-r-- 1 root root 189, 128 2009-04-20 08:44 001
crw-rw-r-- 1 root root 189, 133 2009-04-20 08:44 006
crw-rw-r-- 1 root root 189, 137 2009-04-23 09:26 010
I am member of the scanner group if this means anything. I am user #2 (id 1001) on this computer.
lsusb:
Code:
Bus 002 Device 010: ID 04a9:2213 Canon, Inc. CanoScan LiDE 50/LiDE 35/LiDE 40
Ideas?
|
|
|
04-23-2009, 04:06 AM
|
#2
|
Member
Registered: Jul 2005
Location: Manchester (UK)
Distribution: Fedora CentOS
Posts: 132
Rep:
|
There is a letter about something very similar in this months Linux Format. My copy is at home at the moment, I can post their reply tonight though.
|
|
|
04-29-2009, 04:26 PM
|
#3
|
Member
Registered: Jul 2005
Location: Manchester (UK)
Distribution: Fedora CentOS
Posts: 132
Rep:
|
Here is the letter from Linux Format May 2009 Issue 118:
"It sounds like your scanner device is being created with unsuitable permissions A simple test is to run these two commands, both as root and a normal user.
sane-find-scanner -q
scanimage -L
The first should discover the scanner no matter who runs it, whereas the second can only access the scanner if it has permission. If this one fails as your user, you definatly have a permission problem.
With USB scanners, the device name varies each time you connect it, so you cannot simply run a chown or chmod command from your startup scripts. You'll have to get dirty with udev, but its not really that hard. First you need to identify your scanner - you can do this with dmesg, which will include something like this:
usb 2-1: New USB device found,
idVendor=04a9, idProduct=221c
usb 2-1: New USB device strings: Mfr=1,
Product=2, SerialNumber=0
usb 2-1: Product: CanoScan
usb 2-1: Manufacturer: Canon
Or you can use lsusb
Bus 002 Device 002: ID 04a9:221c Canon, Inc.
CanoScan LiDE 60
Or the tool that comes with Sane
sane-find-scanner -q
All of these will give you the vendor and product codes of the scanner. These examples are with a Canon scanner, so you should expect to get different values with your HP. Now you create a udev rule in /etc/udev/rules.d/10-scanner.rules
The name must end in .rules and the leading 10 ensures its processed before default rules. Substitute your own numbers in here:
ATTR{idVendor}=="04a9",
ATTR{idProduct}=="221c",
GROUP:="scanner", Mode:="660"
This makes the scanner device node readable and writeable by members of the scanner group. You then need to create the group and add yourself to it, as root, with:
groupadd -r scanner
gpasswd -a YOUR_USERNAME scanner
Alternatively, if you're the only user of the computer, put your own group name in the udev rule instead of scanner. Udev will pick up the changes immediatly; you only need to reconnect or power-cycle your scanner. If you made group changes you will need to logout and back in."
Hope that helps, that was a lot of typing, many thanks to Linux Format, if it works, why not buy their next issue 
|
|
|
05-06-2009, 04:42 AM
|
#4
|
Member
Registered: Jul 2005
Location: Manchester (UK)
Distribution: Fedora CentOS
Posts: 132
Rep:
|
What a miserable bugger, don't expect me to copy that amount of data for you again.
|
|
|
05-06-2009, 12:07 PM
|
#5
|
LQ 5k Club
Registered: May 2003
Location: London, UK
Distribution: Fedora40
Posts: 6,156
|
Quote:
don't expect me to copy that amount of data for you again.
|
We all (and I certainly include myself!) have our off-days
Copying all of that stuff was thoughtful of you, but if you click otoomet's link at left and "Search for more posts by otoomet", you'll see he hasn't been back to LQ since his OP to this thread.
It's possible he is busy with that annoying thing called "real life"
So, don't be too dispirited, I'm sure he'll be back to say "thanks" sometime.
|
|
|
09-02-2009, 11:37 AM
|
#6
|
Member
Registered: Oct 2004
Location: Tartu, Århus,Nürnberg, Europe
Distribution: Debian, Ubuntu, Puppy
Posts: 619
Original Poster
Rep:
|
Oh, man, it works!! Thanks!!
There were left a few annoying messages like 'cannot create file' or like that, probably related to stuff in ~/.sane/xsane/ belonging to root. I removed those but did not test later.
And sorry for the long delay, I was working elsewhere, were on holiday, and cannot test the scanner.
Best,
Ott
|
|
|
09-04-2009, 03:24 AM
|
#7
|
Member
Registered: Jul 2005
Location: Manchester (UK)
Distribution: Fedora CentOS
Posts: 132
Rep:
|
Don't worry, I think my fingers were still sore after the typing
Glad it worked though, was worthwhile. Apologies for the moodyness, my gf would vouch for that.
|
|
|
10-22-2009, 03:36 AM
|
#8
|
Member
Registered: Oct 2004
Location: Tartu, Århus,Nürnberg, Europe
Distribution: Debian, Ubuntu, Puppy
Posts: 619
Original Poster
Rep:
|
Hmm...
seems like there is a bit more than that. After a reboot I started to get weird errors, related to wrong device permissions (e.g. /dev/null was owned by scanner and not allowed to write to for the world). So I modified the rules
Code:
# scanners
ACTION!="add", GOTO="iscan_rules_end"
SUBSYSTEM!="usb_device", GOTO="iscan_rules_end"
ATTR{idVendor}=="04a9",
ATTR{idProduct}=="2213",
GROUP:="scanner", Mode:="660"
LABEL="iscan_rules_end"
I also renamed it to '50-scanner.rules' instead of '10-scanner.rules'.
Seems like the device ownership is OK now, but I still cannot log on via nx... We'll see.
|
|
|
11-15-2020, 05:45 PM
|
#9
|
LQ Newbie
Registered: Nov 2020
Posts: 1
Rep: 
|
Another Thank You and It's Now November 2020
Your letter from Linux Format May 2009 Issue 118, was most helpful today. I recently moved to near a carbon copy of a working Linux machine from back in 2009. I have one of the Artec 48U scanners which has been most useful for many years. The near replica of this old Linux Hardy is now running under VMware player, and would only work for the Root user account, and not my regular limited user account. I was doing quite a bit research and ran across info on UDEV which seemed pretty advanced without having specific knowledge for how its used.
Your article spelled out exactly how to do it, and I thank you for that. I realize I'm writing a message to the distant past, but here I am in the present and it's working now.
Thanks again for having taken the time to create such a detailed post, and fix the issue for me.
You have been most helpful sir. 
|
|
|
11-16-2020, 01:30 PM
|
#10
|
LQ 5k Club
Registered: May 2003
Location: London, UK
Distribution: Fedora40
Posts: 6,156
|
ftspampi
First, welcome to LQ!
"Resurrected" old threads are generally frowned upon here, but I am very pleased that LQ could still help you 11 years later!!
The OP, otoomet, hasn't visited here for 5 years, so I'm saying thanks for your update on this problem.
The "distant past" thanks you.
You should probably update your linux installation but meanwhile,
Best wishes,
Tred.
|
|
|
All times are GMT -5. The time now is 06:44 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|