Subject: USB scanner problems
To: None <netbsd-help@netbsd.org>
From: None <brook@biology.nmsu.edu>
List: netbsd-help
Date: 05/24/2004 08:38:15
I am trying to get an Epson scanner to work on a netbsd (NetBSD 1.6ZK
(GENERIC_LAPTOP) #0: Tue Mar 16 11:08:36 MST 2004) box using the sane
package (v.1.0.12).  From the logs it looks like I may have a problem
with the USB communications.

The program 'sane-find-scanner' attempts to probe for scanner devices.
The following is its output, which seems to indicate success in the
sense that it finds the scanner correctly.  However, I am unsure about
the significance of the control message I/O error.

     [sanei_debug] Setting debug level of sanei_usb to 255.
     [sanei_usb] sanei_usb_init: couldn't open /dev/uscanner0: Device not configured
     [sanei_usb] sanei_usb_init: couldn't open /dev/uscanner1: Device not configured
     usb_set_debug: Setting debugging level to 255 (on)
     usb_os_find_busses: Found /dev/usb0
     usb_os_find_busses: Found /dev/usb1
     usb_os_find_devices: Found /dev/ugen0 on /dev/usb1
     usb_control_msg: 128 6 512 0 0xbfbff640 8 1000
     usb_control_msg: 128 6 512 0 0x8052100 32 1000
     [sanei_usb] sanei_usb_init: found libusb device (0x04b8/0x011b) interface 0  at libusb:/dev/usb1:/dev/ugen0
     [sanei_usb] sanei_usb_init: found 1 devices
     usb_control_msg: 128 6 769 0 0x805a000 100 1000
     USB error: error sending control message: Input/output error
     usb_control_msg: 128 6 770 0 0x805a080 100 1000
     USB error: error sending control message: Input/output error

       # No SCSI scanners found. If you expected something different, make sure that
       # you have loaded a SCSI driver for your SCSI adapter.

     found USB scanner (vendor=0x04b8, product=0x011b) at libusb:/dev/usb1:/dev/ugen0
       # Your USB scanner was (probably) detected. It may or may not be supported by
       # SANE. Try scanimage -L and read the backend's manpage.

       # Scanners connected to the parallel port or other proprietary ports can't be
       # detected by this program.

The program 'scanimage -L' attempts to list all available, supported
scanners.  Its output follows.  Again, it seems to detect the scanner
correctly via libusb.  Then it tries to reset it by sending 'ESC \0'
and request its capabilities by sending 'ESC I'.  At that point it
hangs indefinitely.  Presumably, this is related to the connection
timed out error below.

     [sanei_debug] Setting debug level of sanei_usb to 255.
     [sanei_usb] sanei_usb_init: couldn't open /dev/uscanner0: Device not configured
     [sanei_usb] sanei_usb_init: couldn't open /dev/uscanner1: Device not configured
     usb_set_debug: Setting debugging level to 255 (on)
     usb_os_find_busses: Found /dev/usb0
     usb_os_find_busses: Found /dev/usb1
     usb_os_find_devices: Found /dev/ugen0 on /dev/usb1
     usb_control_msg: 128 6 512 0 0xbfbfecf0 8 1000
     usb_control_msg: 128 6 512 0 0x80521a0 32 1000
     [sanei_usb] sanei_usb_init: found libusb device (0x04b8/0x011b) interface 0  at libusb:/dev/usb1:/dev/ugen0
     [sanei_usb] sanei_usb_init: found 1 devices
     [sanei_usb] sanei_usb_find_devices: vendor=0x1606, product=0x0010, attach=0x4815dd64
     [sanei_usb] sanei_usb_find_devices: vendor=0x1606, product=0x0030, attach=0x4815dd64
     [sanei_usb] sanei_usb_find_devices: vendor=0x1606, product=0x0130, attach=0x4815dd64
     [sanei_debug] Setting debug level of sanei_usb to 255.
     [sanei_usb] sanei_usb_init: couldn't open /dev/uscanner0: Device not configured
     [sanei_usb] sanei_usb_init: couldn't open /dev/uscanner1: Device not configured
     usb_set_debug: Setting debugging level to 255 (on)
     [sanei_usb] sanei_usb_init: found libusb device (0x04b8/0x011b) interface 0  at libusb:/dev/usb1:/dev/ugen0
     [sanei_usb] sanei_usb_init: found 1 devices
     [sanei_usb] sanei_usb_find_devices: vendor=0x1606, product=0x0230, attach=0x48172e2c
     [sanei_usb] sanei_usb_open: trying to open device `/dev/usbscanner'
     [sanei_usb] sanei_usb_open: can't find device `/dev/usbscanner' in list
     [sanei_debug] Setting debug level of sanei_usb to 255.
     [sanei_usb] sanei_usb_init: couldn't open /dev/uscanner0: Device not configured
     [sanei_usb] sanei_usb_init: couldn't open /dev/uscanner1: Device not configured
     usb_set_debug: Setting debugging level to 255 (on)
     [sanei_usb] sanei_usb_init: found libusb device (0x04b8/0x011b) interface 0  at libusb:/dev/usb1:/dev/ugen0
     [sanei_usb] sanei_usb_init: found 1 devices
     [sanei_usb] sanei_usb_find_devices: vendor=0x04a5, product=0x1a20, attach=0x481becb4
     [sanei_usb] sanei_usb_find_devices: vendor=0x04a5, product=0x2022, attach=0x481becb4
     [sanei_usb] sanei_usb_find_devices: vendor=0x04a5, product=0x1a2a, attach=0x481becb4
     [sanei_usb] sanei_usb_find_devices: vendor=0x04a5, product=0x2040, attach=0x481becb4
     [sanei_usb] sanei_usb_find_devices: vendor=0x04a5, product=0x2060, attach=0x481becb4
     [sanei_usb] sanei_usb_find_devices: vendor=0x04a5, product=0x207e, attach=0x481becb4
     [sanei_usb] sanei_usb_find_devices: vendor=0x04a5, product=0x20c0, attach=0x481becb4
     [sanei_usb] sanei_usb_find_devices: vendor=0x04a5, product=0x20b0, attach=0x481becb4
     [sanei_usb] sanei_usb_find_devices: vendor=0x04a5, product=0x20de, attach=0x481becb4
     [sanei_usb] sanei_usb_find_devices: vendor=0x04a5, product=0x20fc, attach=0x481becb4
     [sanei_usb] sanei_usb_find_devices: vendor=0x04a5, product=0x20fe, attach=0x481becb4
     [sanei_usb] sanei_usb_find_devices: vendor=0x06bd, product=0x0002, attach=0x481becb4
     [sanei_usb] sanei_usb_find_devices: vendor=0x06bd, product=0x0001, attach=0x481becb4
     [sanei_usb] sanei_usb_find_devices: vendor=0x06bd, product=0x2061, attach=0x481becb4
     [sanei_usb] sanei_usb_find_devices: vendor=0x06bd, product=0x2093, attach=0x481becb4
     [sanei_usb] sanei_usb_find_devices: vendor=0x06bd, product=0x2091, attach=0x481becb4
     [sanei_usb] sanei_usb_find_devices: vendor=0x06bd, product=0x2095, attach=0x481becb4
     [sanei_usb] sanei_usb_find_devices: vendor=0x06bd, product=0x2097, attach=0x481becb4
     [sanei_usb] sanei_usb_find_devices: vendor=0x06bd, product=0x208d, attach=0x481becb4
     [sanei_usb] sanei_usb_find_devices: vendor=0x06bd, product=0x20ff, attach=0x481becb4
     [sanei_usb] sanei_usb_find_devices: vendor=0x06bd, product=0x208f, attach=0x481becb4
     [sanei_usb] sanei_usb_find_devices: vendor=0x06bd, product=0x20fd, attach=0x481becb4
     [sanei_usb] sanei_usb_find_devices: vendor=0x04b8, product=0x0114, attach=0x481becb4
     usb_os_find_busses: Found /dev/usb0
     usb_os_find_busses: Found /dev/usb1
     usb_os_find_devices: Found /dev/ugen0 on /dev/usb1
     [sanei_debug] Setting debug level of sanei_usb to 255.
     [sanei_usb] sanei_usb_init: couldn't open /dev/uscanner0: Device not configured
     [sanei_usb] sanei_usb_init: couldn't open /dev/uscanner1: Device not configured
     usb_set_debug: Setting debugging level to 255 (on)
     [sanei_usb] sanei_usb_init: found libusb device (0x04b8/0x011b) interface 0  at libusb:/dev/usb1:/dev/ugen0
     [sanei_usb] sanei_usb_init: found 1 devices
     [sanei_usb] sanei_usb_find_devices: vendor=0x07b3, product=0x0010, attach=0x4820aad4
     [sanei_usb] sanei_usb_find_devices: vendor=0x07b3, product=0x0011, attach=0x4820aad4
     [sanei_usb] sanei_usb_find_devices: vendor=0x07b3, product=0x0017, attach=0x4820aad4
     [sanei_usb] sanei_usb_find_devices: vendor=0x07b3, product=0x0015, attach=0x4820aad4
     [sanei_usb] sanei_usb_find_devices: vendor=0x07b3, product=0x0017, attach=0x4820aad4
     [sanei_usb] sanei_usb_find_devices: vendor=0x07b3, product=0x0013, attach=0x4820aad4
     [sanei_usb] sanei_usb_find_devices: vendor=0x07b3, product=0x0013, attach=0x4820aad4
     [sanei_usb] sanei_usb_find_devices: vendor=0x07b3, product=0x0011, attach=0x4820aad4
     [sanei_usb] sanei_usb_find_devices: vendor=0x07b3, product=0x0010, attach=0x4820aad4
     [sanei_usb] sanei_usb_find_devices: vendor=0x07b3, product=0x0014, attach=0x4820aad4
     [sanei_usb] sanei_usb_find_devices: vendor=0x07b3, product=0x0015, attach=0x4820aad4
     [sanei_usb] sanei_usb_find_devices: vendor=0x07b3, product=0x0014, attach=0x4820aad4
     [sanei_usb] sanei_usb_find_devices: vendor=0x07b3, product=0x0016, attach=0x4820aad4
     [sanei_usb] sanei_usb_find_devices: vendor=0x07b3, product=0x0017, attach=0x4820aad4
     [sanei_usb] sanei_usb_find_devices: vendor=0x07b3, product=0x0017, attach=0x4820aad4
     [sanei_usb] sanei_usb_find_devices: vendor=0x07b3, product=0x0007, attach=0x4820aad4
     [sanei_usb] sanei_usb_find_devices: vendor=0x07b3, product=0x000f, attach=0x4820aad4
     [sanei_usb] sanei_usb_find_devices: vendor=0x07b3, product=0x000f, attach=0x4820aad4
     [sanei_usb] sanei_usb_find_devices: vendor=0x07b3, product=0x0005, attach=0x4820aad4
     [sanei_usb] sanei_usb_find_devices: vendor=0x07b3, product=0x0014, attach=0x4820aad4
     [sanei_usb] sanei_usb_find_devices: vendor=0x07b3, product=0x0012, attach=0x4820aad4
     [sanei_usb] sanei_usb_find_devices: vendor=0x0400, product=0x1000, attach=0x4820aad4
     [sanei_usb] sanei_usb_find_devices: vendor=0x0400, product=0x1001, attach=0x4820aad4
     [sanei_usb] sanei_usb_find_devices: vendor=0x0458, product=0x2007, attach=0x4820aad4
     [sanei_usb] sanei_usb_find_devices: vendor=0x0458, product=0x2008, attach=0x4820aad4
     [sanei_usb] sanei_usb_find_devices: vendor=0x0458, product=0x2009, attach=0x4820aad4
     [sanei_usb] sanei_usb_find_devices: vendor=0x0458, product=0x2013, attach=0x4820aad4
     [sanei_usb] sanei_usb_find_devices: vendor=0x0458, product=0x2015, attach=0x4820aad4
     [sanei_usb] sanei_usb_find_devices: vendor=0x0458, product=0x2016, attach=0x4820aad4
     [sanei_usb] sanei_usb_find_devices: vendor=0x03f0, product=0x0505, attach=0x4820aad4
     [sanei_usb] sanei_usb_find_devices: vendor=0x03f0, product=0x0605, attach=0x4820aad4
     [sanei_usb] sanei_usb_find_devices: vendor=0x04b8, product=0x010f, attach=0x4820aad4
     [sanei_usb] sanei_usb_find_devices: vendor=0x04b8, product=0x011d, attach=0x4820aad4
     [sanei_usb] sanei_usb_find_devices: vendor=0x1606, product=0x0060, attach=0x4820aad4
     [sanei_usb] sanei_usb_find_devices: vendor=0x1606, product=0x0160, attach=0x4820aad4
     [sanei_usb] sanei_usb_find_devices: vendor=0x049f, product=0x001a, attach=0x4820aad4
     [sanei_usb] sanei_usb_find_devices: vendor=0x04a9, product=0x2206, attach=0x4820aad4
     [sanei_usb] sanei_usb_find_devices: vendor=0x04a9, product=0x2207, attach=0x4820aad4
     [sanei_usb] sanei_usb_find_devices: vendor=0x04a9, product=0x220d, attach=0x4820aad4
     [sanei_usb] sanei_usb_find_devices: vendor=0x04a9, product=0x220e, attach=0x4820aad4
     [sanei_debug] Setting debug level of sanei_usb to 255.
     [sanei_usb] sanei_usb_init: couldn't open /dev/uscanner0: Device not configured
     [sanei_usb] sanei_usb_init: couldn't open /dev/uscanner1: Device not configured
     usb_set_debug: Setting debugging level to 255 (on)
     [sanei_usb] sanei_usb_init: found libusb device (0x04b8/0x011b) interface 0  at libusb:/dev/usb1:/dev/ugen0
     [sanei_usb] sanei_usb_init: found 1 devices
     [sanei_usb] sanei_usb_find_devices: vendor=0x055f, product=0x0006, attach=0x4828e2e4
     [sanei_usb] sanei_usb_find_devices: vendor=0x055f, product=0x0001, attach=0x4828e2e4
     [sanei_usb] sanei_usb_find_devices: vendor=0x055f, product=0x0008, attach=0x4828e2e4
     [sanei_usb] sanei_usb_find_devices: vendor=0x055f, product=0x0002, attach=0x4828e2e4
     [sanei_usb] sanei_usb_find_devices: vendor=0x055f, product=0x0873, attach=0x4828e2e4
     [sanei_debug] Setting debug level of sanei_usb to 255.
     [sanei_usb] sanei_usb_init: couldn't open /dev/uscanner0: Device not configured
     [sanei_usb] sanei_usb_init: couldn't open /dev/uscanner1: Device not configured
     usb_set_debug: Setting debugging level to 255 (on)
     [sanei_usb] sanei_usb_init: found libusb device (0x04b8/0x011b) interface 0  at libusb:/dev/usb1:/dev/ugen0
     [sanei_usb] sanei_usb_init: found 1 devices
     [sanei_usb] sanei_usb_find_devices: vendor=0x055f, product=0x0010, attach=0x482f2f4c
     [sanei_debug] Setting debug level of sanei_usb to 255.
     [sanei_usb] sanei_usb_init: couldn't open /dev/uscanner0: Device not configured
     [sanei_usb] sanei_usb_init: couldn't open /dev/uscanner1: Device not configured
     usb_set_debug: Setting debugging level to 255 (on)
     [sanei_usb] sanei_usb_init: found libusb device (0x04b8/0x011b) interface 0  at libusb:/dev/usb1:/dev/ugen0
     [sanei_usb] sanei_usb_init: found 1 devices
     [sanei_usb] sanei_usb_find_devices: vendor=0x03f0, product=0x1005, attach=0x483136e0
     [sanei_usb] sanei_usb_find_devices: vendor=0x03f0, product=0x1105, attach=0x483136e0
     [sanei_debug] Setting debug level of sanei_usb to 255.
     [sanei_usb] sanei_usb_init: couldn't open /dev/uscanner0: Device not configured
     [sanei_usb] sanei_usb_init: couldn't open /dev/uscanner1: Device not configured
     usb_set_debug: Setting debugging level to 255 (on)
     [sanei_usb] sanei_usb_init: found libusb device (0x04b8/0x011b) interface 0  at libusb:/dev/usb1:/dev/ugen0
     [sanei_usb] sanei_usb_init: found 1 devices
     [sanei_usb] sanei_usb_find_devices: vendor=0x03f0, product=0x0101, attach=0x4832150c
     [sanei_usb] sanei_usb_find_devices: vendor=0x03f0, product=0x0401, attach=0x4832150c
     [sanei_usb] sanei_usb_find_devices: vendor=0x03f0, product=0x0201, attach=0x4832150c
     [sanei_usb] sanei_usb_find_devices: vendor=0x03f0, product=0x0601, attach=0x4832150c
     [sanei_debug] Setting debug level of sanei_usb to 255.
     [sanei_usb] sanei_usb_init: couldn't open /dev/uscanner0: Device not configured
     [sanei_usb] sanei_usb_init: couldn't open /dev/uscanner1: Device not configured
     usb_set_debug: Setting debugging level to 255 (on)
     [sanei_usb] sanei_usb_init: found libusb device (0x04b8/0x011b) interface 0  at libusb:/dev/usb1:/dev/ugen0
     [sanei_usb] sanei_usb_init: found 1 devices
     [sanei_usb] sanei_usb_find_devices: vendor=0x05d8, product=0x4002, attach=0x483472a8
     [sanei_usb] sanei_usb_find_devices: vendor=0x055f, product=0x021e, attach=0x483472a8
     [sanei_usb] sanei_usb_find_devices: vendor=0x055f, product=0x0218, attach=0x483472a8
     [sanei_usb] sanei_usb_find_devices: vendor=0x055f, product=0x0219, attach=0x483472a8
     [sanei_usb] sanei_usb_find_devices: vendor=0x055f, product=0x021d, attach=0x483472a8
     [sanei_usb] sanei_usb_find_devices: vendor=0x055f, product=0x021c, attach=0x483472a8
     [sanei_usb] sanei_usb_find_devices: vendor=0x055f, product=0x0210, attach=0x483472a8
     [sanei_usb] sanei_usb_find_devices: vendor=0x043d, product=0x002d, attach=0x483472a8
     [sanei_usb] sanei_usb_find_devices: vendor=0x07b3, product=0x0401, attach=0x483472a8
     [sanei_usb] sanei_usb_find_devices: vendor=0x07b3, product=0x0400, attach=0x483472a8
     [sanei_usb] sanei_usb_find_devices: vendor=0x07b3, product=0x0403, attach=0x483472a8
     [sanei_usb] sanei_usb_find_devices: vendor=0x0458, product=0x2011, attach=0x483472a8
     [sanei_usb] sanei_usb_find_devices: vendor=0x0458, product=0x2017, attach=0x483472a8
     [sanei_debug] Setting debug level of sanei_usb to 255.
     [sanei_usb] sanei_usb_init: couldn't open /dev/uscanner0: Device not configured
     [sanei_usb] sanei_usb_init: couldn't open /dev/uscanner1: Device not configured
     usb_set_debug: Setting debugging level to 255 (on)
     [sanei_usb] sanei_usb_init: found libusb device (0x04b8/0x011b) interface 0  at libusb:/dev/usb1:/dev/ugen0
     [sanei_usb] sanei_usb_init: found 1 devices
     [sanei_debug] Setting debug level of epson to 255.
     [epson] sane_init: sane-backends 1.0.12
     [sanei_debug] Setting debug level of sanei_usb to 255.
     [sanei_usb] sanei_usb_init: couldn't open /dev/uscanner0: Device not configured
     [sanei_usb] sanei_usb_init: couldn't open /dev/uscanner1: Device not configured
     usb_set_debug: Setting debugging level to 255 (on)
     [sanei_usb] sanei_usb_init: found libusb device (0x04b8/0x011b) interface 0  at libusb:/dev/usb1:/dev/ugen0
     [sanei_usb] sanei_usb_init: found 1 devices
     [epson] sane_init, ># epson.conf<
     [epson] sane_init, >#<
     [epson] sane_init, ># here are some examples for how to configure the EPSON backend<
     [epson] sane_init, >#<
     [epson] sane_init, ># SCSI scanner:<
     [epson] sane_init, ># scsi EPSON<
     [epson] sane_init, >#<
     [epson] sane_init, ># Parallel port scanner:<
     [epson] sane_init, >#pio 0x278<
     [epson] sane_init, >#pio 0x378<
     [epson] sane_init, >#pio 0x3BC<
     [epson] sane_init, >#<
     [epson] sane_init, ># USB scanner - only enable this if you have an EPSON scanner. It could<
     [epson] sane_init, >#               otherwise block your non-EPSON scanner from being<
     [epson] sane_init, >#               recognized.<
     [epson] sane_init, >#		Depending on your distribution, you may need either the<
     [epson] sane_init, >#		first or the second entry.<
     [epson] sane_init, >#usb /dev/usbscanner0<
     [epson] sane_init, >#usb /dev/usb/scanner0<
     [epson] sane_init, >usb libusb:/dev/usb1:/dev/ugen0<
     [epson] attach_one_usb(libusb:/dev/usb1:/dev/ugen0)
     [epson] SANE Epson Backend v0.2.36 - 2003-03-26
     [epson] attach(libusb:/dev/usb1:/dev/ugen0, 3)
     [epson] attach: opening libusb:/dev/usb1:/dev/ugen0
     [sanei_usb] sanei_usb_open: trying to open device `libusb:/dev/usb1:/dev/ugen0'
     [sanei_usb] sanei_usb_open: found bulk-in endpoint (address 1)
     [sanei_usb] sanei_usb_open: found bulk-out endpoint (address 2)
     [sanei_usb] sanei_usb_open: opened usb device `libusb:/dev/usb1:/dev/ugen0' (*dn=0)
     [sanei_usb] sanei_usb_get_vendor_product: device 0: vendorID: 0x04b8, productID: 0x011b
     [epson] Found valid EPSON scanner: 0x4b8/0x11b (vendorID/productID)
     [epson] send buf, size = 2
     [epson] buf[0] 1b .
     [epson] buf[1] 40 @
     [sanei_usb] sanei_usb_write_bulk: trying to write 2 bytes
     [sanei_usb] 0000: 1B 40                                           .@..............
     [sanei_usb] sanei_usb_write_bulk: wanted 2 bytes, wrote 2 bytes
     [sanei_usb] sanei_usb_read_bulk: trying to read 1 bytes
     USB error: error reading from bulk endpoint /dev/ugen0.01: Connection timed out
     [sanei_usb] sanei_usb_read_bulk: read failed: Connection timed out
     USB error: usb_clear_halt called, unimplemented on BSD
     [epson] receive buf, expected = 1, got = 0
     [epson] get_identity_information()
     [epson] send buf, size = 2
     [epson] buf[0] 1b .
     [epson] buf[1] 49 I
     [sanei_usb] sanei_usb_write_bulk: trying to write 2 bytes
     [sanei_usb] 0000: 1B 49                                           .I..............

For reference, the following is a portion of the kernel boot probe
that relates to the USB devices:

     pci0 at mainbus0 bus 0: configuration mode 1
     pci0: i/o space, memory space enabled, rd/line, rd/mult, wr/inv ok
     uhci0 at pci0 dev 29 function 0: Intel 82801CA/CAM USB Controller (rev. 0x02)
     uhci0: interrupting at irq 11
     usb0 at uhci0: USB revision 1.0
     uhub0 at usb0
     uhub0: Intel UHCI root hub, class 9/0, rev 1.00/1.00, addr 1
     uhub0: 2 ports with 2 removable, self powered
     uhci1 at pci0 dev 29 function 2: Intel 82801CA/CAM USB Controller (rev. 0x02)
     uhci1: interrupting at irq 11
     usb1 at uhci1: USB revision 1.0
     uhub1 at usb1
     uhub1: Intel UHCI root hub, class 9/0, rev 1.00/1.00, addr 1
     uhub1: 2 ports with 2 removable, self powered
     uhidev0 at uhub0 port 1 configuration 1 interface 0ugen0 at uhub1 port 1
     ugen0: EPSON EPSON Scanner, rev 2.00/1.00, addr 2

     uhidev0: Logitech USB-PS/2 Optical Mouse, rev 2.00/11.10, addr 2, iclass 3/1
     ums0 at uhidev0: 3 buttons and Z dir.
     wsmouse1 at ums0 mux 0

Is anyone familiar enough with NetBSD, libusb, or sane to give some
clues about what is going on and how to fix it?

Thanks alot for your help.

Cheers,
Brook