# USB scanner doesn't work with libusb

## samo

Hi,

I have problems with my scanner after I update my kernel from 2.4 to 2.6.9. My scanner is a Epson 1670, which is supported by the snapscan backend.

The scanner is recognized by sane-find-scanner:

```
bash-2.05b# sane-find-scanner

...

found USB scanner (vendor=0x04b8 [EPSON], product=0x011f [EPSON Scanner]) at libusb:001:004

...

```

But scanimage doesn't find the scanner:

```
bash-2.05b# scanimage -L

device `v4l:/dev/video0' is a Noname BT878 video (Hauppauge (bt878)) virtual device

```

/etc/hotplug/usb.usermap looks like this:

```
# Epson Corp.|Perfection 1670

libusbscanner             0x0003      0x04b8   0x011f    0x0000       0x0000       0x00         0x00            0x00            0x00            0x00               0x00               0x00000000

```

/etc/hotplug/usb/libusbscanner contains:

```
if [ -z "${DEVICE}" ] ; then

        IF=$(echo ${DEVPATH} | sed 's:\(bus/usb/devices/\)\(.*\)-\(.*\):\2:')

        if [ -r /sys/${DEVPATH}/devnum ]; then

             DEV=$(cat /sys/${DEVPATH}/devnum)

        else

             DEV=1 # you'll have to adjust this manually for kernel < 2.6.6

        fi

        DEVICE=$(printf '/proc/bus/usb/%.03d/%.03d' ${IF} ${DEV})

fi

if [ "$ACTION" = "add" -a "$TYPE" = "usb" ]; then

  chown root:scanner "$DEVICE"

  chmod 0660 "$DEVICE"

fi

```

/etc/sane.d/snapscan.conf contains:

```
...

firmware /usr/share/sane/gt68xx/esfw30.bin

bus=usb

...

# Epson Perfection 1670

usb 0x04b8 0x011f

...

```

cat /proc/bus/usb/devices outputs:

```
...

T:  Bus=01 Lev=02 Prnt=02 Port=04 Cnt=02 Dev#=  4 Spd=12  MxCh= 0

D:  Ver= 2.00 Cls=ff(vend.) Sub=ff Prot=ff MxPS=64 #Cfgs=  1

P:  Vendor=04b8 ProdID=011f Rev= 1.07

S:  Manufacturer=EPSON

S:  Product=EPSON Scanner

C:* #Ifs= 1 Cfg#= 1 Atr=c0 MxPwr=100mA

I:  If#= 0 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=ff Driver=(none)

E:  Ad=81(I) Atr=02(Bulk) MxPS=  64 Ivl=0ms

E:  Ad=02(O) Atr=02(Bulk) MxPS=  64 Ivl=0ms

E:  Ad=83(I) Atr=03(Int.) MxPS=   8 Ivl=16ms

...

```

Could anybody help me to solve the problem?

Regards

----------

## blotto

Hi,

Dont know if it will help but-

I have an Epson Perfection 1650 and the only thing I did was change /etc/sane.d/epson.conf

```
# epson.conf

#

# here are some examples for how to configure the EPSON backend

#

# SCSI scanner:

#scsi EPSON

#

# Parallel port scanner:

#pio 0x278

#pio 0x378

#pio 0x3BC

#

# USB scanner:

# There are two different methods of configuring a USB scanner: libusb and the kernel module

# For any system with libusb support (which is pretty much any recent Linux distribution) the

# following line is sufficient. This however assumes that the connected scanner (or to be more

# accurate, it's device ID) is known to the backend. 

usb

# For libusb support for unknown scanners use the following command

# usb <product ID> <device ID>

# e.g.:

# usb 0x4b8 0x110

# And for the scanner module, use the following configuration:

#usb /dev/usbscanner0

#usb /dev/usb/scanner0
```

I uncommented the line "usb" and I think the scsi EPSON line was originally uncommented

That was all I did and 

```
$sane-find-scanner
```

and there it was!

After that I ran Kooka and it found the scanner OK

----------

## samo

Thanks,

but the Epson 1670 is supported by the snapscan backend. I modified snapscan.conf like I described in my first message.

sane-find-scanner recognizes my scanner, but scanimage -L doesn't and also xsane, kooka.

Could it be, that scanimage, kooka and xsane are looking for the wrong device? With kernel 2.4 the scanner was supported by the scanner module at /dev/usbscanner.

Regards

----------

## teilo

 *samo wrote:*   

> Thanks,
> 
> but the Epson 1670 is supported by the snapscan backend. I modified snapscan.conf like I described in my first message.
> 
> sane-find-scanner recognizes my scanner, but scanimage -L doesn't and also xsane, kooka.
> ...

 

You didn't mention dll.conf. Did you uncomment snapscan in dll.conf, under /etc/sane.d ? Furthemore, comment out v4l, unless you are intending to use it. It is usally best to comment everything in dll.conf out, except for the driver you are actually using.

You may also wish to change the Epson line in your snapscan.conf file to:

usb libusb:001:004, just to see if this changes anything.

----------

## samo

snapscan was allready uncommented in dll.conf. I commented v4l out and changed snapscan.conf as follow:

```
firmware /usr/share/sane/gt68xx/esfw30.bin

bus=usb

...

usb libusb:001:004
```

But scanimage -L doesn't recognize my scanner.

Any other ideas?

----------

## samo

I modified snapscan.conf as follows:

```
firmware /usr/share/sane/gt68xx/esfw30.bin

libusb:001:004 bus=usb

...

# Epson Perfection 1670

usb 0x04b8 0x011f

```

But it doesn't help.

```
SANE_DEBUG_SNAPSCAN=255 scanimage -L

[sanei_debug] Setting debug level of snapscan to 255.

[snapscan] sane_snapscan_init

[snapscan] sane_snapscan_init: Snapscan backend version 1.4.37

[snapscan] add_usb_device(libusb:001:004 bus=usb)

[snapscan] add_usb_device: Detected (kind of) an USB device

[snapscan] snapscani_usb_open(libusb:001:004)

[snapscan] snapscani_usb_open: Can't get semaphore

[snapscan] add_usb_device: error opening device libusb:001:004: Invalid argument

[snapscan] add_usb_device(libusb:001:004)

[snapscan] add_usb_device: Detected (kind of) an USB device

[snapscan] snapscani_usb_open(libusb:001:004)

[snapscan] snapscani_usb_open: Can't get semaphore

[snapscan] add_usb_device: error opening device libusb:001:004: Invalid argument

[snapscan] sane_snapscan_get_devices (0xbfffe634, 0)

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

[snapscan] sane_snapscan_exit

```

----------

## samo

No other ideas?

----------

## flindt

Its realy no help, but I have the exact same problem - the sane-find-scanner works but scanimage -L does not...

I have tried allmost all suggestions I could find but to no avail   :Crying or Very sad:  My scanner is an HP5400c.

----------

## flindt

Ok, version 1.0.15 of the sane-backends solved my problem    :Smile: 

----------

## lyhana8

I have a espon perfection 1670 too, and manage to make it work, loo on this thread for more info :

https://forums.gentoo.org/viewtopic-t-138862-postdays-0-postorder-asc-start-125.html

----------

