LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 05-06-2011, 09:17 AM   #1
djeeke
LQ Newbie
 
Registered: May 2011
Posts: 12

Rep: Reputation: 0
USB hplip scanner - user permissions issue - only root can scan


Hi all,

First thread here so I hope this is the good subforum, not really hardware related issue as the scanner works (tested as root) and not really software either... My guess it's all about permissions/groups...

I want to share an HP Photosmart C4100 series scanner connected via USB to a server box running ClearOS... (CentOS)

So far I have connected the scanner, installed hplip & sane...
Root user is able to see the scanner... and scan from it...
Sane deamon is installed and running, I can connect to it from a remote system.

Quote:
[root@local ~]# uname -a
Linux local 2.6.18-194.8.1.v5 #1 SMP Thu Jul 15 01:14:04 EDT 2010 i686 i686 i386 GNU/Linux
[root@local ~]# lsusb
Bus 001 Device 004: ID 03f0:5711 Hewlett-Packard PhotoSmart C4100 series
Bus 001 Device 001: ID 0000:0000
Bus 002 Device 001: ID 0000:0000
Bus 003 Device 001: ID 0000:0000
Bus 004 Device 001: ID 0000:0000
Bus 005 Device 001: ID 0000:0000
[root@local ~]# scanimage -L
device `hpaio:/usb/Photosmart_C4100_series?serial=MY71IH724R05J7' is a Hewlett-Packard Photosmart_C4100_series all-in-one
[root@local ~]#
My problem however is that no user apart from root detects the scanner... This Linux distribution has no groups like scanner or usb...

Quote:
djeeke@local:~$ 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).
djeeke@local:~$
Anybody that can point me in a good direction ?
 
Old 05-06-2011, 10:40 AM   #2
tronayne
Senior Member
 
Registered: Oct 2003
Location: Northeastern Michigan, where Carhartt is a Designer Label
Distribution: Slackware 32- & 64-bit Stable
Posts: 3,541

Rep: Reputation: 1062Reputation: 1062Reputation: 1062Reputation: 1062Reputation: 1062Reputation: 1062Reputation: 1062Reputation: 1062
I have a H-P Photosmart C4680, essentially the same thing you've got. The way it seems to want to work is that my user ID is included the these groups:
Code:
fgrep trona /etc/group
lp:x:7:lp,trona
floppy:x:11:root,trona
audio:x:17:root,trona
video:x:18:root,trona
cdrom:x:19:root,trona
plugdev:x:83:root,trona
power:x:84:root,trona
usbfs:x:85:root,trona,vboxusers
netdev:x:86:root,trona
scanner:x:93:root,trona
vboxusers:x:102:trona
cvs:x:103:trona
You won't care about vboxusers and cvs but you do care about lp and scanner. If you don't have a scanner group, add it with a unique GID (you can do that with vi, by the way); 93 in this case. I then use xsane to scan.

Once you've got it going, you'll have a .sane directory in your home directory:
Code:
tree .sane
.sane
`-- xsane
    |-- Hewlett-Packard:Photosmart__C4600__series.drc
    |-- batch-lists
    |-- xsane.mdf
    `-- xsane.rc

2 directories, 3 files
Hope this helps some.
 
Old 05-19-2011, 06:19 AM   #3
djeeke
LQ Newbie
 
Registered: May 2011
Posts: 12

Original Poster
Rep: Reputation: 0
Hi !

Thanks for this info... One step closer...

My test account on the ClearOS box is added to the new 'scanner' group and I do see the scanner !
Quote:
scanner:x:93:root,saned,xinetd,djeeke
Quote:
[djeeke@local ~]$ /sbin/lsusb
Bus 001 Device 010: ID 03f0:5711 Hewlett-Packard PhotoSmart C4100 series
Bus 001 Device 001: ID 0000:0000
Bus 002 Device 001: ID 0000:0000
Bus 003 Device 001: ID 0000:0000
Bus 004 Device 001: ID 0000:0000
Bus 005 Device 001: ID 0000:0000
[djeeke@local ~]$ scanimage -L
device `hpaio:/usb/Photosmart_C4100_series?serial=MY71IH725R04J7' is a Hewlett-Packard Photosmart_C4100_series all-in-one
[djeeke@local ~]$
Next issue is the remote connection...

I have saned running, when connecting from a remote system I see the incoming connection in /var/log/messages :
Quote:
May 19 13:11:52 local xinetd[7860]: START: sane-port pid=27174 from=10.8.0.10
May 19 13:11:52 local xinetd[7860]: EXIT: sane-port status=0 pid=27174 duration=0(sec)
But I do not see the scanner : scanimage -L output from my ubuntu :
Quote:
djeeke@djeeke-laptop:~$ 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).
djeeke@djeeke-laptop:~$
I have tried adding saned and xinetd to the scanner group as well but no luck...
I'm one step away from having this working now !

Can someone push me in the right direction ?
Thanks

Last edited by djeeke; 05-26-2011 at 05:16 AM. Reason: typo
 
Old 05-19-2011, 07:10 AM   #4
djeeke
LQ Newbie
 
Registered: May 2011
Posts: 12

Original Poster
Rep: Reputation: 0
I found some information but it's above my head and I don't know if it's relevant or not ...
Could someone explain what the following file is about ?
/etc/udev/rules.d/60-libsane.rules

It does list some scanners (mine is not included)...

Same with
/etc/udev/rules.d/55-hpmud.rules

I guess I might need a udev crashcourse ;-)

Last edited by djeeke; 05-19-2011 at 07:52 AM. Reason: added some info ...
 
Old 05-19-2011, 07:11 AM   #5
Hangdog42
LQ Veteran
 
Registered: Feb 2003
Location: Maryland
Distribution: Slackware
Posts: 7,803
Blog Entries: 1

Rep: Reputation: 420Reputation: 420Reputation: 420Reputation: 420Reputation: 420
I recently had something similar with my HP OfficeJet 8500. What I found was if I tried to set up the printer directly through CUPS, the scanner wasn't seen by sane/xsane. However, if I set up the printer using hp-setup, that produced the proper configuration in CUPS for the scanner to be seen.
 
Old 05-19-2011, 07:15 AM   #6
djeeke
LQ Newbie
 
Registered: May 2011
Posts: 12

Original Poster
Rep: Reputation: 0
Additionally I tested if user saned can see the scanner :

Quote:
[root@local ~]# su -s /bin/sh - saned
-sh-3.2$ scanimage -L
device `hpaio:/usb/Photosmart_C4100_series?serial=MY71IH725R04J7' is a Hewlett-Packard Photosmart_C4100_series all-in-one
-sh-3.2$
It looks like I'm very close to the answer of the puzzle... I just need some help fitting the last pieces ;-)
 
Old 05-19-2011, 07:19 AM   #7
djeeke
LQ Newbie
 
Registered: May 2011
Posts: 12

Original Poster
Rep: Reputation: 0
Thanks for the hint Hangdog...

I did use hp-setup to install the printer/scanner ...

This must be a permission/ownership issue, I must be overlooking something though...
 
Old 05-19-2011, 08:26 AM   #8
djeeke
LQ Newbie
 
Registered: May 2011
Posts: 12

Original Poster
Rep: Reputation: 0
With regards to my previous questions, as I don't see the scanner in those files, can I easily change the rules and reload udev ???
 
Old 05-25-2011, 04:40 AM   #9
djeeke
LQ Newbie
 
Registered: May 2011
Posts: 12

Original Poster
Rep: Reputation: 0
I unsuccessfully tried a few other things...

Nobody has any idea on what I'm missing here ???
 
Old 05-25-2011, 07:22 AM   #10
Hangdog42
LQ Veteran
 
Registered: Feb 2003
Location: Maryland
Distribution: Slackware
Posts: 7,803
Blog Entries: 1

Rep: Reputation: 420Reputation: 420Reputation: 420Reputation: 420Reputation: 420
What kind of URL is CUPS using to try and connect to the printer? I know it is kind of fishing, but I've never had any problems like this with a HP scanner set up by hp-setup. By the way, I can't imagine that you would have to mess with udev. I may be wrong, but it seems more like a driver-level issue to me.
 
Old 05-25-2011, 07:34 AM   #11
H_TeXMeX_H
LQ Guru
 
Registered: Oct 2005
Location: $RANDOM
Distribution: slackware64
Posts: 12,928
Blog Entries: 2

Rep: Reputation: 1292Reputation: 1292Reputation: 1292Reputation: 1292Reputation: 1292Reputation: 1292Reputation: 1292Reputation: 1292Reputation: 1292
Make sure to be part of the 'scanner' and 'lp' groups.
 
Old 05-26-2011, 05:49 AM   #12
djeeke
LQ Newbie
 
Registered: May 2011
Posts: 12

Original Poster
Rep: Reputation: 0
Well yes I hope I have made 'beginner' error like forgetting to power on the system ;-)
thanks for thinking with me...

CUPS does not seem to be the issue... Printing works fine... It is a sane/saned issue...

On my test ubuntu 'client' system /etc/sane.d/net.conf has 192.168.0.254 as single entry

on the 'server' /var/log/messages shows up the following at each connectivity attempt through 'telnet on port 6566' or 'scanimage -L' from the client system :

Quote:
May 26 12:09:00 local xinetd[30197]: START: sane-port pid=21879 from=10.8.0.10
May 26 12:09:00 local xinetd[30197]: EXIT: sane-port status=0 pid=21879 duration=0(sec)
on the server system, my saned.conf file allows access from three subnets:

Quote:
# saned.conf
192.168.0.0/24
192.168.1.0/24
192.168.2.0/24
Xinetd.conf has the following statements :
Quote:
service sane-port
{
port = 6566
socket_type = stream
wait = no
user = saned
group = saned
server = /usr/sbin/saned
disable = no
}
I checked and my test user djeeke and saned user are part of lp and scanner groups...
from the 'group' file :
Quote:
lp:x:7:daemon,lp,saned,xinetd,djeeke
scanner:x:93:root,saned,xinetd,djeeke
On the server users djeeke and saned see the scanner (through scanimage -L)

Only from the client system I get the dreaded "No scanners were identified" message...

Last edited by djeeke; 05-26-2011 at 05:52 AM. Reason: added some info ...
 
Old 05-26-2011, 07:13 AM   #13
Hangdog42
LQ Veteran
 
Registered: Feb 2003
Location: Maryland
Distribution: Slackware
Posts: 7,803
Blog Entries: 1

Rep: Reputation: 420Reputation: 420Reputation: 420Reputation: 420Reputation: 420
Quote:
CUPS does not seem to be the issue... Printing works fine... It is a sane/saned issue...
Sorry, I should have explained my thinking a bit more. When I was having problems with my Officejet, one of the clues was that CUPS was connecting with the wrong URL. Like you, I could print but not scan. When I dug into it, I found that the setup had been goofed up, and running hp-setup was the key. Now I do realize that you have run hp-setup, but I'm trying to look for clues.

Quote:
I checked and my test user djeeke and saned user are part of lp and scanner groups...
from the 'group' file :
Are you in both groups on both the client and the server?
 
Old 05-26-2011, 10:49 AM   #14
H_TeXMeX_H
LQ Guru
 
Registered: Oct 2005
Location: $RANDOM
Distribution: slackware64
Posts: 12,928
Blog Entries: 2

Rep: Reputation: 1292Reputation: 1292Reputation: 1292Reputation: 1292Reputation: 1292Reputation: 1292Reputation: 1292Reputation: 1292Reputation: 1292
Go:
http://localhost:631/
click printers, then your printer, and look for a 'serial=' on the connection line.
 
Old 05-27-2011, 04:55 AM   #15
djeeke
LQ Newbie
 
Registered: May 2011
Posts: 12

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by Hangdog42 View Post
Sorry, I should have explained my thinking a bit more. When I was having problems with my Officejet, one of the clues was that CUPS was connecting with the wrong URL. Like you, I could print but not scan. When I dug into it, I found that the setup had been goofed up, and running hp-setup was the key. Now I do realize that you have run hp-setup, but I'm trying to look for clues.
No apologies Hangdog, thanks for trying to help !!! I did re-run hp-setup more than once though...
But still, what would be the link between CUPS and saned ? One would expect to be able to run saned and scan from a remote system even without CUPS (printing is another story) What would be the dependencies

Quote:
Originally Posted by Hangdog42 View Post
Are you in both groups on both the client and the server?
OK, user djeeke is in both groups on both systems I have no saned on my client system... I do not get a response even if I'm root on the client system...
Do you think I need to run a server deamon on the client ? As ultimately the client systems will be windows clients and I don't now how the windows 'sanetwain' application manages this...

Quote:
Originally Posted by H_TeXMeX_H View Post
Go:
http://localhost:631/
click printers, then your printer, and look for a 'serial=' on the connection line.
Device URI: hp:/usb/Photosmart_C4100_series?serial=MY71IH725R04J7

Same serial number as I get from 'scanimage -L'
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
only can scan as root: usb scanner & ubuntu 8.10 otoomet Linux - Hardware 9 11-16-2020 01:30 PM
[SOLVED] How to detect that an user has press the Scan button on an Epson Scanner? Xeratul Linux - General 1 12-28-2010 07:51 AM
[SOLVED] User permissions/groups to access USB scanner gauchao Slackware 2 01-17-2010 06:22 AM
[SOLVED] Where to set permissions to getting an USB scanner work for an ordinary user? Olaus Linux - Hardware 2 10-22-2009 10:05 AM
Scanner works only as root - permissions issue jlinkels Linux - Hardware 3 11-29-2008 04:17 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 06:14 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration