Apparently I hadn't done any scanning since my move to centos. hp-scan works for root, but not for me as me. When I try to use xsane, it tells me no device found. When I try to use hp-scan as myself it tells me: error: Unable to locate device hpaio:/usb/Photosmart_C3100_series?serial=CN6ARC321S04KV using SANE backend hpaio:. Please check HPLIP installation.
What do I change to make it let me use xsane or hp-scan as myself?
This is what I get when scanning as root: [root@localhost tmp]# hp-scan -o fred.png warning: hp-scan should not be run as root/superuser.
HP Linux Imaging and Printing System (ver. 3.12.4) Scan Utility ver. 2.2
Copyright (c) 2001-14 Hewlett-Packard Development Company, LP This software comes with ABSOLUTELY NO WARRANTY. This is free software, and you are welcome to distribute it under certain conditions. See COPYING file for more details.
Using device: hpaio:/usb/Photosmart_C3100_series?serial=CN6ARC321S04KV
Using device hpaio:/usb/Photosmart_C3100_series?serial=CN6ARC321S04KV Opening connection to device...
Resolution: 300dpi Mode: gray Compression: JPEG Scan area (mm): Top left (x,y): (0.000000mm, 0.000000mm) Bottom right (x,y): (215.899994mm, 296.925995mm) Width: 215.899994mm Height: 296.925995mm Destination(s): file Output file: /tmp/fred.png
Warming up...
Scanning... Expecting to read 8.5 MB from scanner. Reading data: [******************************************] 100% 8.5 MB Read 8.5 MB from scanner. Closing device.
Outputting to destination 'file': Saving to file /tmp/fred.png
Done.
BTW it lied about the compression. It gave me png.
On Tue, 24 Sep 2013 17:57:12 -0500 (CDT) Michael Hennebry wrote:
What do I change to make it let me use xsane or hp-scan as myself?
You need to set the permission on the scanner device to allow your username to use it, since it's apparently now set to allow root only.
scanimage -L will tell you where it is.
On Tue, 24 Sep 2013, Frank Cox wrote:
On Tue, 24 Sep 2013 17:57:12 -0500 (CDT) Michael Hennebry wrote:
What do I change to make it let me use xsane or hp-scan as myself?
You need to set the permission on the scanner device to allow your username to use it, since it's apparently now set to allow root only.
scanimage -L will tell you where it is.
[root@localhost tmp]# scanimage -L device `hpaio:/usb/Photosmart_C3100_series?serial=CN6ARC321S04KV' is a Hewlett-Packard Photosmart_C3100_series all-in-one
That agrees with the output from hp-scan, but it does not seem to help. What permissions do I change?
root@localhost tmp]# find /dev -name 'Photo*' [root@localhost tmp]# find /usb -name 'Photo*' find: `/usb': No such file or directory [root@localhost tmp]# locate Photosmart_C3100 [root@localhost tmp]#
I used strace on hp-scan. It used every "file" under /dev/bus/usb: [root@localhost tmp]# ls -R /dev/bus/usb /dev/bus/usb: 001 002 003 004 005
/dev/bus/usb/001: 001 006
/dev/bus/usb/002: 001
/dev/bus/usb/003: 001 002
/dev/bus/usb/004: 001
/dev/bus/usb/005: 001 [root@localhost tmp]#
For some reason, hp-scan also opened a lot of sane libraries, mostly for brands other than HP. hp-scan read "Photosmart C3180\n" a lot.
On Wed, 25 Sep 2013, Michael Hennebry wrote:
On Tue, 24 Sep 2013, Frank Cox wrote:
On Tue, 24 Sep 2013 17:57:12 -0500 (CDT) Michael Hennebry wrote:
What do I change to make it let me use xsane or hp-scan as myself?
You need to set the permission on the scanner device to allow your username to use it, since it's apparently now set to allow root only.
scanimage -L will tell you where it is.
[root@localhost tmp]# scanimage -L device `hpaio:/usb/Photosmart_C3100_series?serial=CN6ARC321S04KV' is a Hewlett-Packard Photosmart_C3100_series all-in-one
That agrees with the output from hp-scan, but it does not seem to help. What permissions do I change?
root@localhost tmp]# find /dev -name 'Photo*' [root@localhost tmp]# find /usb -name 'Photo*' find: `/usb': No such file or directory [root@localhost tmp]# locate Photosmart_C3100 [root@localhost tmp]#
This was done as root:
I used strace on hp-scan. It used every "file" under /dev/bus/usb: [root@localhost tmp]# ls -R /dev/bus/usb /dev/bus/usb: 001 002 003 004 005
/dev/bus/usb/001: 001 006
/dev/bus/usb/002: 001
/dev/bus/usb/003: 001 002
/dev/bus/usb/004: 001
/dev/bus/usb/005: 001 [root@localhost tmp]#
I aso strace-d hp-scan as myself and got permission errors: [hennebry@localhost tmp]$ grep ermission trace2.txt | sort -u | grep usb open("/dev/bus/usb/001/001", O_RDWR) = -1 EACCES (Permission denied) open("/dev/bus/usb/001/006", O_RDWR) = -1 EACCES (Permission denied) open("/dev/bus/usb/002/001", O_RDWR) = -1 EACCES (Permission denied) open("/dev/bus/usb/003/001", O_RDWR) = -1 EACCES (Permission denied) open("/dev/bus/usb/003/002", O_RDWR) = -1 EACCES (Permission denied) open("/dev/bus/usb/004/001", O_RDWR) = -1 EACCES (Permission denied) open("/dev/bus/usb/005/001", O_RDWR) = -1 EACCES (Permission denied) [hennebry@localhost tmp]$
Changing the permissions on all of them seems a clunky thing to do. Also, I do not know whether such a change would survive a reboot.
For some reason, hp-scan also opened a lot of sane libraries, mostly for brands other than HP. hp-scan read "Photosmart C3180\n" a lot.
how about using using sudo ?
2013/9/25 Michael Hennebry hennebry@web.cs.ndsu.nodak.edu
On Wed, 25 Sep 2013, Michael Hennebry wrote:
On Tue, 24 Sep 2013, Frank Cox wrote:
On Tue, 24 Sep 2013 17:57:12 -0500 (CDT) Michael Hennebry wrote:
What do I change to make it let me use xsane or hp-scan as myself?
You need to set the permission on the scanner device to allow your
username to
use it, since it's apparently now set to allow root only.
scanimage -L will tell you where it is.
[root@localhost tmp]# scanimage -L device `hpaio:/usb/Photosmart_C3100_series?serial=CN6ARC321S04KV' is a
Hewlett-Packard Photosmart_C3100_series all-in-one
That agrees with the output from hp-scan, but it does not seem to help. What permissions do I change?
root@localhost tmp]# find /dev -name 'Photo*' [root@localhost tmp]# find /usb -name 'Photo*' find: `/usb': No such file or directory [root@localhost tmp]# locate Photosmart_C3100 [root@localhost tmp]#
This was done as root:
I used strace on hp-scan. It used every "file" under /dev/bus/usb: [root@localhost tmp]# ls -R /dev/bus/usb /dev/bus/usb: 001 002 003 004 005
/dev/bus/usb/001: 001 006
/dev/bus/usb/002: 001
/dev/bus/usb/003: 001 002
/dev/bus/usb/004: 001
/dev/bus/usb/005: 001 [root@localhost tmp]#
I aso strace-d hp-scan as myself and got permission errors: [hennebry@localhost tmp]$ grep ermission trace2.txt | sort -u | grep usb open("/dev/bus/usb/001/001", O_RDWR) = -1 EACCES (Permission denied) open("/dev/bus/usb/001/006", O_RDWR) = -1 EACCES (Permission denied) open("/dev/bus/usb/002/001", O_RDWR) = -1 EACCES (Permission denied) open("/dev/bus/usb/003/001", O_RDWR) = -1 EACCES (Permission denied) open("/dev/bus/usb/003/002", O_RDWR) = -1 EACCES (Permission denied) open("/dev/bus/usb/004/001", O_RDWR) = -1 EACCES (Permission denied) open("/dev/bus/usb/005/001", O_RDWR) = -1 EACCES (Permission denied) [hennebry@localhost tmp]$
Changing the permissions on all of them seems a clunky thing to do. Also, I do not know whether such a change would survive a reboot.
For some reason, hp-scan also opened a lot of sane libraries, mostly for brands other than HP. hp-scan read "Photosmart C3180\n" a lot.
-- Michael hennebry@web.cs.ndsu.NoDak.edu "On Monday, I'm gonna have to tell my kindergarten class, whom I teach not to run with scissors, that my fiance ran me through with a broadsword." -- Lily _______________________________________________ CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
On Wed, 25 Sep 2013, Eero Volotinen wrote:
how about using using sudo ?
I'd like to use the scanner through xsane. Also, I expect that there is a reason that hp-scan recommends against using it as root.
Also found: [root@localhost sane.d]# sane-find-scanner ... found USB scanner (vendor=0x03f0 [HP], product=0x5611 [Photosmart C3100 series]) at libusb:001:006 Is that a reference to /dev/bus/usb/001/006 ?
On Wed, 25 Sep 2013 12:35:08 -0500 (CDT) Michael Hennebry wrote:
Also found: [root@localhost sane.d]# sane-find-scanner ... found USB scanner (vendor=0x03f0 [HP], product=0x5611 [Photosmart C3100 series]) at libusb:001:006 Is that a reference to /dev/bus/usb/001/006 ?
Yes.
On Wed, 25 Sep 2013, Frank Cox wrote:
On Wed, 25 Sep 2013 12:35:08 -0500 (CDT) Michael Hennebry wrote:
Also found: [root@localhost sane.d]# sane-find-scanner ... found USB scanner (vendor=0x03f0 [HP], product=0x5611 [Photosmart C3100 series]) at libusb:001:006 Is that a reference to /dev/bus/usb/001/006 ?
Yes.
chmod a+rw /dev/bus/usb/001/006 should do the trick?
On Wed, 25 Sep 2013, Michael Hennebry wrote:
On Wed, 25 Sep 2013, Frank Cox wrote:
On Wed, 25 Sep 2013 12:35:08 -0500 (CDT) Michael Hennebry wrote:
Also found: [root@localhost sane.d]# sane-find-scanner ... found USB scanner (vendor=0x03f0 [HP], product=0x5611 [Photosmart C3100 series]) at libusb:001:006 Is that a reference to /dev/bus/usb/001/006 ?
Yes.
chmod a+rw /dev/bus/usb/001/006 should do the trick?
It did the trick for now. Should I expect it to survive a reboot? Any idea what hp-scan does with the other file under /dev/bus/usb ?
On Wed, 25 Sep 2013 14:27:14 -0500 (CDT) Michael Hennebry wrote:
It did the trick for now. Should I expect it to survive a reboot?
No.
You can either add a file to /etc/security/console.perms.d to set the user permissions just for your scanner, or if you want to make all usb devices available you can just put this into /etc/security/console.perms.d/usb.perms:
<usbdevices>=/dev/bus/usb/*/* <console> 0600 <usbdevices>
You could also use the "big hammer approach and just put the appropriate chmod command into /etc/rc.local
Any idea what hp-scan does with the other file under /dev/bus/usb ?
No idea.
Michael Hennebry wrote:
On Wed, 25 Sep 2013, Michael Hennebry wrote:
On Wed, 25 Sep 2013, Frank Cox wrote:
On Wed, 25 Sep 2013 12:35:08 -0500 (CDT) Michael Hennebry wrote:
Also found: [root@localhost sane.d]# sane-find-scanner ... found USB scanner (vendor=0x03f0 [HP], product=0x5611 [Photosmart C3100 series]) at libusb:001:006 Is that a reference to /dev/bus/usb/001/006
chmod a+rw /dev/bus/usb/001/006 should do the trick?
It did the trick for now. Should I expect it to survive a reboot? Any idea what hp-scan does with the other file under /dev/bus/usb ?
A little googling found this, which should permanently solve your problem. (Yeah, I see the print, I just hit <cancel> and it displays the thread.) https://www.centos.org/modules/newbb/print.php?form=1&topic_id=32920&forum=37&order=DESC&start=0
mark