[NBLUG/talk] HP 5200c scanner, Fedora Core 2, 2.6.5 kernel

Dave Sisley dsisley at arczip.com
Wed Jun 16 05:52:15 PDT 2004


[I am resending this response to Mark since I originally sent it
Tuesday evening and 8 hours later it has not shown up at the mailing
list.  If it ends up appearing 2x, I apologize.- dave.]

Ok, dude - here's some more...

On Tue, Jun 15, 2004 at 10:29:51AM -0700, Mark Street wrote:
> On Monday 14 June 2004 18:09, Dave Sisley wrote:
> > No problem, Mark.  Really.  A botched system is not to steep a price
> > to pay for the advancement of linux. (cough!)
> 
> hehehe, cough cough cough, sure is smokey in here.
> 
> OK, so no remnants of the old way of doing things seems to be left.  I have 
> noticed that after 2.6.3 most all USB device drivers have been removed from 
> the kernel.  Everything is now accessed through libusb.  So now we hark back 
> to the original post where you had permission problems with the scanner and 
> no I/O when run as root.

I get that error whether or not I am root.  I got a "can't detect
scanner" (or similar) error when running as joeUser.

> 
> I mentioned hotplug previously as a possible problem in this saga.  Here is a 
> a thread that may shed some light on some your problem, 
> http://www.linuxquestions.org/questions/showthread.php?s=&threadid=157385

Okay.  I gave that thread (as well as another thread referenced
within) a quick read and I see people who sound like they know what
they are talking about talking gibberish and making sounds like the
adults in a Peanuts special.  I will read them again soon.  In the
meantime...

> 
> Since we are trying to solve this in a public forum let's keep learning.

Let's!

> 
> Let's have a little more info with a running system, scanner plugged in;
> 
> ls -la /proc/bus/usb/
> 

total 0
drwxr-xr-x  6 root root 0 Jun 15 05:49 .
dr-xr-xr-x  5 root root 0 Jun 15 05:49 ..
dr-xr-xr-x  2 root root 0 Jun 15 05:49 001
dr-xr-xr-x  2 root root 0 Jun 15 05:49 002
dr-xr-xr-x  2 root root 0 Jun 15 05:49 003
dr-xr-xr-x  2 root root 0 Jun 15 05:49 004
-r--r--r--  1 root root 0 Jun 15 05:49 devices

> and from your output;
> >"found USB scanner (vendor=0x03f0, product=0x0401) at libusb:002:002"
> 
> ls /proc/bus/usb/002

[dsisley at jupiter tmp]$ ls /proc/bus/usb/002
001  002

> 
> And I think you should be able to get more info by executing
> 
> cat /proc/bus/usb/002/002

hmm... with cat I get some weird gobbledygook and with less I get it
"may be a binary file...". 
> 
> Let's see the config for HP printers for sane-backends just for giggles
> 
> cat /etc/sane.d/hp.conf
> 

scsi HP
# Uncomment the following if you have "Error during device I/O" on SCSI
#   option dumb-read
#
# The usual place for a SCSI-scanner on Linux
/dev/scanner
#
# USB-scanners supported by the hp-backend
# HP ScanJet 4100C
usb 0x03f0 0x0101
# HP ScanJet 5200C
usb 0x03f0 0x0401
# HP ScanJet 62X0C
usb 0x03f0 0x0201
# HP ScanJet 63X0C
usb 0x03f0 0x0601
#
# Uncomment the following if your scanner is connected by USB,
# but you are not using libusb
# /dev/usb/scanner0
#   option connect-device



> Now let's run some scans as a regular user
> 
> What does scan the command 'scanimage -L'  show as a regular user from a fresh 
> boot?  

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).

[Note - I tried this earlier and thought the command had hung, but
someone on the thread you referenced said that it just takes a
while. this time I ran it and left it for a minute and finally got the
above.]

> Now do the same command as root, what do you see?

device `hp:libusb:002:002' is a Hewlett-Packard ScanJet 5200C flatbed
scanner

> 
> Now UNplug the scanner and run scanimage -L as a regular user, no reboot 
> required.  What do you see??

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).

[hey! I got the above much quicker this time]

> 
> There is an interesting post in the link I mentioned above that manipulates 
> the hotplug utility.  It bears mentioning at this point.
> 
> >  Additional Comment #19 From W. Michael Petullo  on 2004-05-03 10:23 -------
> > 
> > From bug #121893:
> > 
> > Hotplug correctly sets the permissions of USB devices (ie:
> > /proc/bus/usb/001/*) when I plug in my digital camera.  Hotplug gives
> > read and write permissions to the console owner.
> > 
> > However, the same is not true for scanners.  Since the USB scanner
> > kernel module was dropped some time ago in favor of libusb, scanners
> > should be handled like digital cameras.
> > 
> > This is how I got my scanner to work right:
> > 
> > I added the following two lines to /etc/hotplug/usb.usermap (copied
> > from /etc/hotplug/usb.distmap -- the map for old kernel modules):
> > 
> > # Umax Astra 2200
> > scanner              0x0003 0x1606   0x0230    0x0000       0x0000   
> >    0x00       0x00            0x00            0x00            0x00   
> >         0x00       0x00000000
> > 

I found the following in usb.distmap and copied it to /usb.usermap

scanner              0x0003 0x03f0   0x0401    0x0000       0x0000
0x00         0x00            0x00            0x00            0x00
0x00            0x00000000

[that's all one line...]

> > Then I copied /etc/hotplug/usb/usbcam to /etc/hotplug/scanner and
> > modified the script to reference scanners instead of cameras (actually
> > a slight modification of the same script could probably be used in
> > both cases).

hmmm... I did this, but the only reference to cameras is in the
comments section at the beginning of the rather short script.  Also:
Notice that the above says to put the new, copied script in
/etc/hotplug, not /etc/hotplug/usb.  Is that right?

> 
> The line for your HP scanner can be found in the usb.distmap file referenced 
> above.
> 
> scanner              0x0003 0x03f0   0x0401    0x0000       0x0000       0x00         
> 0x00            0x00
>      0x00            0x00            0x00            0x00000000

Right.  See above.

> 
> This may help get you working.  It may not solve all over your permission 
> problems though.  I think I have another lead on another forum that may shed 
> more light on this.  Let's see what this does for you first.
> 
> Unplug your scanner and try the scanimage command again as described above.
> 

Again, see above.  Plugging it back in, I get the "no scanners"
message as user, but I get 
'device `hp:libusb:002:004' is a Hewlett-Packard ScanJet 5200C flatbed
scanner' as root.  (note that those usb numbers are a bit off from
before - it was 002:002 before, but I tried putting it in all 4 holes
behind the computer and none of them gave me 002 & 002.  Does that
matter?

In any case, running xsane as root gives me the same old (and
frustrating) I/O error.  

What do you think?

-dave.

-- 
Dave Sisley
dsisley at arczip.com
roth-sisley.net





More information about the talk mailing list