LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian
User Name
Password
Debian This forum is for the discussion of Debian Linux.

Notices

Reply
 
LinkBack Search this Thread
Old 10-17-2005, 04:46 AM   #1
mtb
Member
 
Registered: Nov 2002
Location: Italy
Distribution: Debian Etch
Posts: 260

Rep: Reputation: 30
usb powered scanner problem


I have recently bought a canon lide 20 scanner.

I have anyway some problems with the permissions:

Note that i am in both saned and scanner groups.

this scanner is powered only throught USB.

lsusb output is like:

Code:
Bus 002 Device 001: ID 0000:0000  
Bus 001 Device 002: ID 04a9:220d Canon, Inc. CanoScan N670U/N676U/LiDE 20
Bus 001 Device 001: ID 0000:0000
sane-find-scanner output:

Code:
found USB scanner (vendor=0x04a9 [Canon], product=0x220d [CanoScan], chip=LM9832/3) at libusb:001:002
If i type:

chown root.scanner /proc/bus/usb/001/002
chmod 0660 /proc/bus/usb/001/002

Then the scanner works well.

1) If i turn on the debian sarge system, hotplug does nothing and i have no permission ( and i don't know how to fix this )

2) If i unplug the usb cable from the scanner and after this step i reinsert it, then launch xsane, the first time it hangs looking for devices.

3) Killing it and reloading xsane, i obtain the scanner working.

What can i do in order to have the scanner working without unplugging and replugging it, and considering that maybe i have to unplug it from the pc in order to have a spare usb port for digital camera [ changing maybe also the port ]?

I have recently tried fedora 4 and it solves the problem, but i don't understand how ( and anyway i have already removed it ).

A really unclean way to have the scanner working is this script i have wrote and i call from .xsession, but there MUST be a better and safer way...

Code:
#!/bin/sh
# You need sudo without password for that commands
SCANNERPOS=$(sane-find-scanner |grep "found USB" | sed "s/.*[libusb]//" |sed "s/\:/\//g")
sudo chown root.scanner /proc/bus/usb"$SCANNERPOS"
sudo chmod 0660 /proc/bus/usb"$SCANNERPOS"
Thank you in advance.
 
Old 10-17-2005, 08:48 AM   #2
jlinkels
Senior Member
 
Registered: Oct 2003
Location: Bonaire
Distribution: Debian Etch/Lenny/Squeeze
Posts: 3,477

Rep: Reputation: 308Reputation: 308Reputation: 308Reputation: 308
mtb,

I am running Debian Sarge, with a LIDE 20 scanner as well.

I don't know how your computer starts up, so there is little to say why your scanner is not seen. Can you do
Code:
dmesg | grep usb
and see what the output is?

My /var/log/messages gives this:
Code:
Sep 19 08:07:22 localhost kernel: usb.c: registered new driver usbdevfs
Sep 19 08:07:22 localhost kernel: usb.c: registered new driver hub
Sep 19 08:07:22 localhost kernel: usb-uhci.c: $Revision: 1.275 $ time 19:47:10 Dec  1 2004
Sep 19 08:07:22 localhost kernel: usb-uhci.c: High bandwidth mode enabled
Sep 19 08:07:22 localhost kernel: usb-uhci.c: USB UHCI at I/O 0xd800, IRQ 10
Sep 19 08:07:22 localhost kernel: usb-uhci.c: Detected 2 ports
Sep 19 08:07:22 localhost kernel: usb.c: new USB bus registered, assigned bus number 1
Sep 19 08:07:22 localhost kernel: usb-uhci.c: USB UHCI at I/O 0xd400, IRQ 10
Sep 19 08:07:22 localhost kernel: usb-uhci.c: Detected 2 ports
Sep 19 08:07:22 localhost kernel: usb.c: new USB bus registered, assigned bus number 2
Sep 19 08:07:22 localhost kernel: usb-uhci.c: USB UHCI at I/O 0xd000, IRQ 10
Sep 19 08:07:22 localhost kernel: usb-uhci.c: Detected 2 ports
Sep 19 08:07:22 localhost kernel: usb.c: new USB bus registered, assigned bus number 3
Sep 19 08:07:22 localhost kernel: usb-uhci.c: v1.275:USB Universal Host Controller Interface driver
Sep 19 08:07:22 localhost kernel: usb.c: USB device 2 (vend/prod 0x45e/0x39) is not claimed by any
Sep 19 08:07:22 localhost kernel: usb.c: new USB bus registered, assigned bus number 4
Sep 19 08:07:22 localhost kernel: usb.c: USB disconnect on device 00:10.0-1 address 2
Sep 19 08:07:22 localhost kernel: usb.c: USB device 3 (vend/prod 0x45e/0x39) is not claimed by any
Sep 19 08:07:22 localhost kernel: usb.c: USB device 4 (vend/prod 0x4a9/0x220d) is not claimed by an
Sep 19 08:07:22 localhost kernel: usb.c: registered new driver hiddev
Sep 19 08:07:22 localhost kernel: usb.c: registered new driver hid
Sep 19 08:07:22 localhost kernel: usb-uhci.c: interrupt, status 3, frame# 536
Sep 19 08:07:22 localhost kernel: input: USB HID v1.00 Mouse [Microsoft Microsoft IntelliMouseX Opt
Sep 19 08:07:22 localhost kernel: usb.c: registered new driver usbscanner
(dmesg does not contain this messages anymore, it is almost a month ago I started my system )

Since you can use your scanner when you change the permissions to 0660, it means that you are a member of the scanner group, and that authorization as such works. The question is: why is this not arranged by the hotplug script.

When you plug in a USB device, "something" happens which eventually calls the correct script. Unfortunately I forgot what that "something" is. (Maybe you can check he man page for "hotplug") The script which eventually is called, is /etc/hotplug/usb/libusbscanner.
Is it there? Does this file have the correct permissions? (0755). Does it contain a statement to change permissions of your device to 0660?

I am not physically near my machine, so I cannot replug the scanner. Hopefully this afternoon I will be there, and I'll do that, and record the log for you. That may help in finding out how the libusbscanner script is called.

How did you install sane? Using the debian package? (good!) Or compiled sane from source? (bad!)

Sorry that I cannot provide you with the complete information, but maybe this already helps.

jlinkels
 
Old 10-17-2005, 11:52 AM   #3
mtb
Member
 
Registered: Nov 2002
Location: Italy
Distribution: Debian Etch
Posts: 260

Original Poster
Rep: Reputation: 30
Quote:
Originally posted by jlinkels
[B]mtb,

I am running Debian Sarge, with a LIDE 20 scanner as well.

I don't know how your computer starts up, so there is little to say why your scanner is not seen. Can you do
Code:
dmesg | grep usb
and see what the output is?
here is:

Code:
usbcore: registered new driver usbfs
usbcore: registered new driver hub
usb 1-2: new full speed USB device using address 2
usb 2-1: new full speed USB device using address 2
usb 2-1: USB disconnect, address 2
usb 1-2 is the scanner.

[EDIT] I'm using 2.6 kernel.

Quote:
Since you can use your scanner when you change the permissions to 0660, it means that you are a member of the scanner group, and that authorization as such works. The question is: why is this not arranged by the hotplug script.

When you plug in a USB device, "something" happens which eventually calls the correct script. Unfortunately I forgot what that "something" is. (Maybe you can check he man page for "hotplug") The script which eventually is called, is /etc/hotplug/usb/libusbscanner.
Is it there? Does this file have the correct permissions? (0755). Does it contain a statement to change permissions of your device to 0660?
It is not there, but in /etc/hotplug.d/usb/libsane.hotplug script.
Code:
#!/bin/sh
#
# This file is part of the SANE distribution.
# Hotplug USB hook for SANE

if [ "$ACTION" != "add" ]; then
    exit 0
fi

DEVVID=$(printf %4s $(echo $PRODUCT | cut -d'/' -f1) | tr ' ' 0)
DEVPID=$(printf %4s $(echo $PRODUCT | cut -d'/' -f2) | tr ' ' 0)

DEVCONF=$(grep -i "^0x$DEVVID[[:space:]]\+0x$DEVPID" /etc/sane.d/hotplug/*.db 2> /dev/null)

if [ $? != 0 ]; then
    exit 0
fi

set $DEVCONF

chown $3 $DEVICE && chmod $4 $DEVICE

if [ ! -z $5 -a -x $5 ]; then
    export DEVVID
    export DEVPID
    exec $5
fi

exit 0
Should i rename it to your name and copy it there too?

Quote:
I am not physically near my machine, so I cannot replug the scanner. Hopefully this afternoon I will be there, and I'll do that, and record the log for you. That may help in finding out how the libusbscanner script is called.

How did you install sane? Using the debian package? (good!) Or compiled sane from source? (bad!)
Debian package.

Let me know if the script is the same.

Thank you for the help.

Last edited by mtb; 10-17-2005 at 11:56 AM.
 
Old 10-17-2005, 07:47 PM   #4
jlinkels
Senior Member
 
Registered: Oct 2003
Location: Bonaire
Distribution: Debian Etch/Lenny/Squeeze
Posts: 3,477

Rep: Reputation: 308Reputation: 308Reputation: 308Reputation: 308
mtb,

It was downright stupid from me to forget to ask what kernel you were running. There is a huge difference in module detection and loading between 2.4.x and 2.6.x.

Anyway, I haven't been near my computer yet, but I rebooted so I can give you a proper output of dmesg | grep usb. It is this:

Code:
Last login: Mon Oct 17 20:27:54 2005 from donald_pc.megaline.com
jlinkels@jlinkels_pc:~$ dmesg | grep usb
usb.c: registered new driver usbdevfs
usb.c: registered new driver hub
usb-uhci.c: $Revision: 1.275 $ time 19:47:10 Dec  1 2004
usb-uhci.c: High bandwidth mode enabled
usb-uhci.c: USB UHCI at I/O 0xd800, IRQ 10
usb-uhci.c: Detected 2 ports
usb.c: new USB bus registered, assigned bus number 1
usb-uhci.c: USB UHCI at I/O 0xd400, IRQ 10
usb-uhci.c: Detected 2 ports
usb.c: new USB bus registered, assigned bus number 2
usb-uhci.c: USB UHCI at I/O 0xd000, IRQ 10
usb-uhci.c: Detected 2 ports
usb.c: new USB bus registered, assigned bus number 3
usb-uhci.c: v1.275:USB Universal Host Controller Interface driver
usb.c: USB device 2 (vend/prod 0x45e/0x39) is not claimed by any active driver.
usb.c: new USB bus registered, assigned bus number 4
usb.c: USB disconnect on device 00:10.0-1 address 2
usb.c: USB device 3 (vend/prod 0x45e/0x39) is not claimed by any active driver.
usb.c: USB device 4 (vend/prod 0x4a9/0x220d) is not claimed by any active driver.
usb.c: registered new driver hiddev
usb.c: registered new driver hid
usb-uhci.c: interrupt, status 3, frame# 530
input: USB HID v1.00 Mouse [Microsoft Microsoft IntelliMouse® Optical] on usb1:3.0
usb.c: registered new driver usbscanner
jlinkels@jlinkels_pc:~$
All my remarks might be invalidated by the fact that I use a different kernel version, but I find it highly sucpicous that you don't get any output from usb-uhci. If it is true that there is something wrong with loading that module, it doesn't make sense to look at scripts in /etc/hotplug.d. Then it is at a different level.

You don't have blacklisted the usb-uhci module, did you?

Time permitting I can try Tuesday to connect the scanner to a machine running 2.6.12 and give you that output of dmesg.

jlinkels
 
Old 10-22-2005, 07:43 AM   #5
mtb
Member
 
Registered: Nov 2002
Location: Italy
Distribution: Debian Etch
Posts: 260

Original Poster
Rep: Reputation: 30
uhci is called with 2.6, not usb-uhci

dmesg |grep -i 'uhc\|usb'
Code:
usbcore: registered new driver usbfs
usbcore: registered new driver hub
USB Universal Host Controller Interface driver v2.2
uhci_hcd 0000:00:1f.2: Intel Corp. 82801BA/BAM USB (Hub #1)
uhci_hcd 0000:00:1f.2: irq 5, io base 0000b000
uhci_hcd 0000:00:1f.2: new USB bus registered, assigned bus number 1
hub 1-0:1.0: USB hub found
uhci_hcd 0000:00:1f.4: Intel Corp. 82801BA/BAM USB (Hub #2)
uhci_hcd 0000:00:1f.4: irq 11, io base 0000b800
uhci_hcd 0000:00:1f.4: new USB bus registered, assigned bus number 2
hub 2-0:1.0: USB hub found
usb 1-2: new full speed USB device using address 2
usb 2-2: new full speed USB device using address 2
Initializing USB Mass Storage driver...
scsi0 : SCSI emulation for USB Mass Storage devices
USB Mass Storage device found at 2
usbcore: registered new driver usb-storage
USB Mass Storage support registered.
usb 2-2: USB disconnect, address 2
 
Old 10-25-2005, 02:18 PM   #6
jlinkels
Senior Member
 
Registered: Oct 2003
Location: Bonaire
Distribution: Debian Etch/Lenny/Squeeze
Posts: 3,477

Rep: Reputation: 308Reputation: 308Reputation: 308Reputation: 308
mtb,

I connected the scanner to my laptop with kernel 2.6.12 running.

To my surprise I see the same messages as you do. No vendor/product id like in kernel 2.4.x.

I don't have SANE installed, but that should not be necessary for this detection.

For the moment I cannot spend the time to track down where the USB detection went, so I am not able to help you further for the moment. I am sorry about this.

If I have to install SANE anyway, I'll post my findings here.

jlinkels
 
Old 10-26-2005, 11:09 PM   #7
kmoffat
Member
 
Registered: Jul 2003
Location: near Seattle
Distribution: Debian/Ubuntu/Suse
Posts: 240
Blog Entries: 2

Rep: Reputation: 30
I, too, am running 2.6.12 (installed debian package) on a debianpure install updated to testing, and my epson perfection 1660 photo is only detected as root.
 
  


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 Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Do you think it's possible to make a USB Linux powered can opener? t3gah General 19 04-24-2005 09:11 AM
USB Scanner problem: usb 1-2: device not accepting address 3, error -71 lagartoflojo Slackware 1 11-13-2004 04:26 PM
USB, scanner problem. Likosin Linux - Hardware 1 05-22-2004 09:29 AM
USB Scanner problem again phil81 Linux - Hardware 5 04-09-2004 08:59 AM
USB Powered ZIP250 possible? scgadgets Linux - General 3 02-07-2002 10:36 AM


All times are GMT -5. The time now is 12:27 PM.

Main Menu
 
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
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration