LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
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


Reply
  Search this Thread
Old 02-26-2019, 08:11 AM   #1
doublehp
LQ Newbie
 
Registered: May 2005
Location: France
Distribution: Gentoo and Debian
Posts: 12

Rep: Reputation: 0
Question scanner seen by sane-find-scanner but not by scanimage


After boot:

Code:
# lsusb | grep He
Bus 003 Device 002: ID 03f0:0605 Hewlett-Packard ScanJet 2200c

# 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=0x03f0 [Hewlett-Packard], product=0x0605 [HP ScanJet 2200C], chip=LM9832/3) at libusb:003:002
  # 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.

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

$ scanimage -x 10 -y 10 --warmup-time 1 --lamp-off-at-exit=no
scanimage: no SANE devices found
After unpluging and repluging USB cable:

Code:
# lsusb | grep He
Bus 003 Device 005: ID 03f0:0605 Hewlett-Packard ScanJet 2200c
# scanimage -L
device `plustek:libusb:003:005' is a Hewlett-Packard Scanjet 2200c flatbed scanner
$ scanimage -x 10 -y 10 --warmup-time 1 --lamp-off-at-exit=no
P6
# SANE data follows
19 19
255
Is there a soft way to make scanner usable after boot without needing physical action ? For various reasons, my usb-core driver is in kernel, so can't unload it.

Similar issue here:
https://www.linuxquestions.org/quest...age-no-840368/
 
Old 02-26-2019, 01:37 PM   #2
hazel
LQ Guru
 
Registered: Mar 2016
Location: Harrow, UK
Distribution: LFS, AntiX, Slackware
Posts: 7,569
Blog Entries: 19

Rep: Reputation: 4451Reputation: 4451Reputation: 4451Reputation: 4451Reputation: 4451Reputation: 4451Reputation: 4451Reputation: 4451Reputation: 4451Reputation: 4451Reputation: 4451
I had a similar problem with my Canoscan, which also uses the plustek driver. It turned out that the problem was a dicey usb cable, which kept disconnecting and reconnecting; probably there was a physical break somewhere in the cable. Each time it reconnected, it was given a new bus address and this caused problems with both scanimage and xscanimage, which expect to find the correct address in their default device. It worked with xsane, which starts each scan with a fresh search for available scanners.

I used a different cable and everything worked.
 
Old 02-26-2019, 01:51 PM   #3
ferrari
LQ Guru
 
Registered: Sep 2003
Location: Auckland, NZ
Distribution: openSUSE Leap
Posts: 5,800

Rep: Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140
Quote:
Is there a soft way to make scanner usable after boot without needing physical action ? For various reasons, my usb-core driver is in kernel, so can't unload it.
This reads like a power management feature at play...
https://wiki.archlinux.org/index.php...SB_autosuspend
IIRC, some USB scanners have this "power saving" feature built-in.

Another approach may be to reset the USB bus (for the attached device). There are a lot of examples online such as this...
http://billauer.co.il/blog/2013/02/u...ci-uhci-linux/
 
Old 03-03-2019, 03:04 PM   #4
doublehp
LQ Newbie
 
Registered: May 2005
Location: France
Distribution: Gentoo and Debian
Posts: 12

Original Poster
Rep: Reputation: 0
The email notification was sent to spam folder :/

Quote:
Originally Posted by hazel View Post
I used a different cable and everything worked.
I don't think it's a cable issue, because I only need to cycle the scanner once after boot, then I can use the device for several days.

I don't use power management. I don't use any kind of sleep, only proper poweroff. But, maybe USB chain remains supplied by V standby ...

Code:
  while true ; do lsusb ; date ; sleep 1 ; done &

  for i in ????:??:??.? ; do
    echo -n "$i" > unbind
    sleep 5
    echo -n "$i" > bind
  done
seems to disconnect and reconnect all my devices, not exactly what I Asked for, but, had no downside effect for me. Will try it after next reboot.

Last edited by doublehp; 03-03-2019 at 03:07 PM.
 
Old 03-03-2019, 03:39 PM   #5
ferrari
LQ Guru
 
Registered: Sep 2003
Location: Auckland, NZ
Distribution: openSUSE Leap
Posts: 5,800

Rep: Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140
Well, yes that will find all devices and reset accordingly. However you're free to identify and reset only the device of interest eg
Code:
echo -n "0000:03:00.0" | tee /sys/bus/pci/drivers/xhci_hcd/unbind
echo -n "0000:03:00.0" | tee /sys/bus/pci/drivers/xhci_hcd/bind
The general idea is to examine /sys/bus/pci/drivers/xhci_hcd (or the appropriate controller directory for your system) to get the pertinent bus address, then unbind and bind as above.

Reference:
https://techadminlab.com/reset-usb-2...-linux-kernel/

Last edited by ferrari; 03-03-2019 at 05:02 PM. Reason: More info
 
Old 03-03-2019, 05:05 PM   #6
ferrari
LQ Guru
 
Registered: Sep 2003
Location: Auckland, NZ
Distribution: openSUSE Leap
Posts: 5,800

Rep: Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140
Quote:
I don't use power management. I don't use any kind of sleep, only proper poweroff. But, maybe USB chain remains supplied by V standby ...
Just to clarify further here - USB power management is handled at the kernel level, but it can be disabled if necessary. I was also speculating that the USB scanner device may be going into standby mode (and returned to an active state by resetting the USB bus or unplugging and re-plugging physically perhaps).
 
Old 03-06-2019, 06:15 AM   #7
doublehp
LQ Newbie
 
Registered: May 2005
Location: France
Distribution: Gentoo and Debian
Posts: 12

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by ferrari View Post
This reads like a power management feature at play...
https://wiki.archlinux.org/index.php...SB_autosuspend
IIRC, some USB scanners have this "power saving" feature built-in.

Another approach may be to reset the USB bus (for the attached device). There are a lot of examples online such as this...
http://billauer.co.il/blog/2013/02/u...ci-uhci-linux/
Works just fine for me:

Code:
$ 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).
# cd /sys/bus/pci/drivers/?hci_hcd
#   for i in ????:??:??.? ; do
>     echo -n "$i" > unbind
>     sleep 5
>     echo -n "$i" > bind
>   done
$ scanimage -L
device `plustek:libusb:003:004' is a Hewlett-Packard Scanjet 2200c flatbed scanner
Thanks
 
Old 03-06-2019, 11:24 AM   #8
ferrari
LQ Guru
 
Registered: Sep 2003
Location: Auckland, NZ
Distribution: openSUSE Leap
Posts: 5,800

Rep: Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140
Good, but at least you now know you can target just the device concerned if required.
 
  


Reply



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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Simple scan sees scanner, but cant connect? CAN scanimage from terminal though sdowney717 Linux - Software 1 01-22-2019 07:49 PM
find-scanner: yes... scanimage: no rl5 Linux - Hardware 8 10-28-2010 01:37 AM
USB Brother MFC 420CN Scanner - sane/scanimage/error i/o issues NosLycn Linux - Hardware 11 11-14-2009 10:58 PM
scanimage sane xsane inetd gimp scanner situation davearnt Linux - Hardware 2 04-15-2006 08:31 PM
sane: scanimage refuses to use hp sj 2300c Simon Bridge Fedora 3 10-08-2005 11:53 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware

All times are GMT -5. The time now is 01:02 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