LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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-12-2012, 05:16 AM   #1
gonesouthwest
LQ Newbie
 
Registered: Jan 2006
Posts: 6

Rep: Reputation: 0
Scanner has stopped working - Xsane reports 'no devices found'


This issue is similar to several previous threads, which did not have a solution for me.

I'm using Debian Squeeze, kept bang up to date with patches. I have two scanners, my original Canon N670U, and a later Epson SX425W, either of which can be connected to a USB port.

The Canon worked reliably for several years with XSane. Then I replaced it when I changed my printer for the Epson 'all in one' printer/scanner. That prints and for a while also scanned with XSane. However a few days ago I found Xsane wouldn't recognise it, with the "no devices found" message. So I swapped it out with the original, previously reliable, Canon, and now I get the same message!

When the Canon is plugged in, dmesg shows:

[ 3298.312069] usb 6-1: new full speed USB device using uhci_hcd and address 7
[ 3298.487725] usb 6-1: New USB device found, idVendor=04a9, idProduct=220d
[ 3298.487732] usb 6-1: New USB device strings: Mfr=64, Product=77, SerialNumber=0
[ 3298.487736] usb 6-1: Product: CanoScan
[ 3298.487739] usb 6-1: Manufacturer: Canon
[ 3298.487976] usb 6-1: configuration #1 chosen from 1 choice

/etc/sane.d/plustek.conf has the following (abridged):

[usb]
device auto

Result from "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)......

Result from "sane-find-scanner":

found USB scanner (vendor=0x04a9, product=0x220d, chip=LM983x?) at libusb:006:007

I've changed /etc/sane.d/plustek.conf to

[usb] 0x04a9 0x220d
device libusb:006:007

as suggested in the comment, with no improvement. I've also changed USB ports, changed to an old USB1.1 port. None of this makes any difference.

The experience is no different when run as root.

I am currently using kernel "Linux debian 2.6.32-5-686 #1 SMP Mon Jan 16 16:04:25 UTC 2012 i686 GNU/Linux"

One thing I have noticed is that /proc/bus/usb has no entries (I was looking for /proc/bus/usb/006/007).

Can anyone help me through this problem?

Last edited by onebuck; 11-28-2012 at 12:45 PM. Reason: correct title
 
Old 02-12-2012, 09:10 PM   #2
frankbell
LQ Guru
 
Registered: Jan 2006
Location: Virginia, USA
Distribution: Slackware, Ubuntu MATE, Mageia, and whatever VMs I happen to be playing with
Posts: 19,307
Blog Entries: 28

Rep: Reputation: 6136Reputation: 6136Reputation: 6136Reputation: 6136Reputation: 6136Reputation: 6136Reputation: 6136Reputation: 6136Reputation: 6136Reputation: 6136Reputation: 6136
I see you tested the ports and the machine is seeing the scanner, which were my two first thoughts. Have you swapped out the cable?

I would suggest booting to a Live CD of something and seeing whether you can use the scanner. If you can, that would narrow it to your software load. If you can't, it's likely a hardware problem of some sort.
 
Old 02-16-2012, 10:05 AM   #3
hpfeil
Member
 
Registered: Nov 2010
Location: Tucson, Arizona US
Distribution: Slackware Current
Posts: 354
Blog Entries: 1

Rep: Reputation: Disabled
(There have been lots of similar problems reported elsewhere [https://duckduckgo.com]. This could be a rough draft for a tutorial.)
The usual suspects, `sane-find-scanner -q` and `scanimage -L` produce the correct results for root, but not for anyone else. Usbfs, which used to be mounted in /proc/bus/usb, is now deprecated; hotplug is deprecated, devfs is deprecated; HAL is deprecated. The kernel developers have been migrating to udev for device detection and initialization for nearly a decade. Udev now populates /dev, which is mounted as filetype tempfs during startup and vanishes upon power-off. Things that used to be in procfs are now in sysfs, which is mounted as /sys and populated by udev. Udev rules are in /lib/udev/rules.d and /etc/udev/rules.d. Scanner manufacturers send their scanner <mfg>.desc description files to the sane folks, who add those descriptions the sane db, then scripts which run as part of the makefile/compile process, like tools/sane-desc, reference those <mfg>.desc files to populate /etc/sane.d with <backend>.conf files and create /lib/udev/rules.d/xx-libsane.rules.
Although it may seem that somewhere along the way things kind of went haywire, once the migration to udev and dracut is complete, such matters will be a lot easier to manage.

I'll use my HP Scanjet 5307C as an example, hoping that someone will write a script that does all this setup automagically.
I looked in /etc/sane.d, but found no custom conf file dedicated to that model. I eventually discovered that the avision backend includes my scanner, with no configuration options needed, that is, leave all the lines in avision.conf commented out.
The default rule for the Avision back-end (most HP flatbed scanners) creates the device links either during startup or when the scanner is turned on and/or the usb cable is plugged into a usb port.
First invoke `lsusb` to get the bus and id assignments: "Bus 002 Device 002: ID 03f0:0701 Hewlett-Packard ScanJet 5300c/5370c" for my scanner. When I invoked `ls -l /dev/bus/usb/002/002`, I discovered that root:root owned it with mode 0664 permissions, which explains the fact that when logged in as root, `scanimage -L` finds the scanner, but not using my user account.
While getting lost among the recursive loops in /sys, I learned that `udevadm info` is your friend.
There is probably a more elegant way to do this, but I dumped the entire udev dabase into a pipe, then grepped the device ID using the `less` command :/3f0.
`udevadm info --export-db | less`
Copy/paste everything from the parent node {P:} to the last environment attribute {E:}, I had everything needed for the next step.
If you create a file in /etc/udev/rules.d with the same name as the scanner rules file in /lib/udev/rules.d, the one in /etc/udev takes precedence. I copied 65-libsane.rules from /lib/udev to /etc/udev, opened /etc/udev/rules.d/65-libsane.rules in a convenient text editor, deleted the entries for other usb and all the scsi devices, uncommented the ENV line because the distribution /boot/config file had commented out the usb device class (#CONFIG_USB_DEVICE_CLASS=n), then created a rule to let me scan.

The extracted udev database entry for my libusb:002:002 device contains attribue-value pairs. I added a line above the libsane_matched rule using idVendor and ifProduct:

ATTRS{manufacturer}=="Hewlett Packard", ATTRS{product}=="Hewlett Packard ScanJet 5300C/5370C ", OWNER="root", GROUP="scanner"

Now all I had to do was create a group named "scanner" and add my user name to that group. I rebooted, (there's a more elegant way to update udev's rules.d) and started scanning, from the command line, then xsane and gimp.
If you are brave of heart, you might proceed as outlined, or just wait for an update that includes a udev rule that changes the scanner group from root. Meanwhile, you can `chmod o+w` the /dev/bus/usb entry for your scanner every startup.

Last edited by hpfeil; 02-16-2012 at 10:06 AM.
 
Old 02-17-2012, 06:40 AM   #4
gonesouthwest
LQ Newbie
 
Registered: Jan 2006
Posts: 6

Original Poster
Rep: Reputation: 0
Thanks for that, but:

>>I discovered that root:root owned it with mode 0664 permissions, which explains the fact that when logged in as root, `scanimage -L` finds the scanner, but not using my user account.

For me the experience is no different when run as root, so it doesn't look like a simple permissions issue.
 
Old 02-26-2012, 11:10 AM   #5
hpfeil
Member
 
Registered: Nov 2010
Location: Tucson, Arizona US
Distribution: Slackware Current
Posts: 354
Blog Entries: 1

Rep: Reputation: Disabled
Forget sane for a bit. Does the output from `lsusb` match dmesg? Can you find the /dev/bus/usb/006/001 file? If udev doesn't add it to devfs, nothing will work. BTW, mounting usbfs in /proc is deprecated. Everything is now in sysfs mounted under /sys, which is populated by udev. That's why you need udevadm to find it, not /proc/bus/usb. Once you get the attributes from /sys, then you can add a new rule under /etc/udev/rules.d. Poke around /lib/systemd/system using `systemctl` to make sure your uhci driver is loaded into ram.

There's a lot of obsolete info that will turn up in search engines. As soon as you get up to speed so you don't have to read the manual, they change everything so you have to start over. Sysadmin job security. (Check out dice.com, there's a strong demand for linux sysadmins, programmers and all.)
 
Old 11-28-2012, 12:05 PM   #6
hpfeil
Member
 
Registered: Nov 2010
Location: Tucson, Arizona US
Distribution: Slackware Current
Posts: 354
Blog Entries: 1

Rep: Reputation: Disabled
The information I posted works for systems that do not use systemd. Ever since systemd took over, my scanner no longer works. I had to hack the cupsd service to get my network printer working, since systemd sits there and waits for someone to plug in a printer before activating cups. But, I digress. My scanner works fine when I boot into my home-grown system that still uses /etc/rc.d scripts. Systemd didn't break sane-find-scanner, lsusb, or the sysfs entries, but scanimage eventually times out, and front-ends like xsane or gimp don't know where the scanner went. No worries, I drop into a virtual machine whenever I need to scan images, 35mm slides, and all. I'll start a new thread if I ever get around to debugging systemd's ability to baffle my usb scanner.
 
  


Reply

Tags
debian, usb, xsane


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



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] X suddenly stopped working - Failed to activate core devices spoovy Slackware 13 02-24-2019 06:12 PM
Auto-mounting USB devices stopped working satinet Slackware 1 03-30-2010 08:36 AM
USB devices stopped working ... sort of Tino27 Slackware 4 02-02-2007 09:51 AM
USB devices stopped working dormant Linux - Hardware 1 09-12-2005 08:13 AM
xsane stopped working with Epson Perfection 1650 after earlier success acampbell Linux - Hardware 6 02-11-2005 05:05 AM

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

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