# USB scanner "half" working....

## iandoug

Hi all

have a Benq 3300U scanner (same drivers as Agfa, snapscan). Have given it the firmware file it wants in snapscan.conf.

sane-find-scanner finds it okay:

found USB scanner (vendor=0x04a5, product=0x20b0) at libusb:002:003

but scanimage -L says:

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

This is running as root.

lsusb:

Bus 002 Device 003: ID 04a5:20b0 Acer Peripherals Inc. (now BenQ Corp.) S2W 3300U/4300U

Bus 002 Device 002: ID 046d:c20c Logitech, Inc. WingMan Precision

so it is there but sane is not finding it...

gentoo 002 # pwd

/proc/bus/usb/002

gentoo 002 # ls -l

total 0

-rw-r--r--  1 root root 43 Apr 15 16:17 001

-rw-r--r--  1 root root 52 Apr 15 16:17 002

-rw-rw-rw-  1 root root 57 Apr 15 13:51 003

Any ideas? Naturally xsane also bombs.

Thanks, Ian

----------

## NeddySeagoon

iandoug,

Have you set snapscan.conf to look on USB?

Some of the defualts in the sane config files are not very useful.

----------

## iandoug

 *NeddySeagoon wrote:*   

> iandoug,
> 
> Have you set snapscan.conf to look on USB?
> 
> Some of the defualts in the sane config files are not very useful.

 

What SHOULD it say?

At present says this:

# For USB scanners also specify bus=usb, e.g.

#/dev/usb/scanner0 bus=usb

/dev/usb bus=usb

which represents my pathetic attempt at trying ANYTHING to make it work.. since there is no scanner0 under /dev/usb

Since my first post, I unplugged the scanner and plugged it back in.

Then got this:

gentoo 002 # ls -l

total 0

-rw-r--r--  1 root root    43 Apr 15 16:30 001

-rw-r--r--  1 root root    52 Apr 15 16:30 002

-rw-rw-rw-  1 root scanner 57 Apr 15 16:36 004

(after changing the permissions on 004)

scanimage -L actually WORKED then as root, but starting xsane broke it again...

So I unplug it again and get:

gentoo 002 # scanimage -L

device `snapscan:libusb:002:005' is a Acer FlatbedScanner22 flatbed scanner

which is progress of sorts I suppose..  :Smile:    This also works for my user as well as root.

But starting xsane produces the dialogues and then after a while comes back with the error message

about failing to open the device snapscan:libusb:002:005 

scanimage -L now fails, but sane-find-scanner still works.

Is this possibly a snapscan.conf issue? What should I have in there?

Thanks, Ian

----------

## NeddySeagoon

iandoug,

Sorry, my first post wasn't very helpful.

The /devusb/... things in snapscan.conf date from the time there was a usb scanner kernel module. That was removed around kernel 2.6.6 in favour of usbfs, libusb, hotpulg and a hotplug script.

What kernel version are you running. 

```
uname -a
```

will show it.

----------

## iandoug

 *NeddySeagoon wrote:*   

> iandoug,
> 
> Sorry, my first post wasn't very helpful.
> 
> The /devusb/... things in snapscan.conf date from the time there was a usb scanner kernel module. That was removed around kernel 2.6.6 in favour of usbfs, libusb, hotpulg and a hotplug script.

 

So I can leave it commented out?

 *Quote:*   

> What kernel version are you running. 
> 
> ```
> uname -a
> ```
> ...

 

gentoo sane.d # uname -a

Linux gentoo 2.6.11-gentoo-r2 #9 SMP Sun Apr 3 22:24:52 SAST 2005 x86_64 AMD Athlon(tm) 64 Processor 3200+ AuthenticAMD GNU/Linux

Thanks, Ian

----------

## NeddySeagoon

iandoug,

Ok, here's some things to check.

1. You need usbfs. If you have it, then a file /proc/bus/usb/devices will exist and show lots of useful info about your USB system.

You don't need to understand it but usbview renders it as a tree structure if you want to.

2. You need  libusb and hotplug emerge both if needed. Hotplug is a daemon, you need to 

```
rc-update hotplug add boot
```

if you needed to emerge it and 

```
/etc/init.d/hotplug start
```

to start hotpulg without a reboot.

3. You need a script for hotplug for your scanner. Heres what I have for my Epson 1650

```
#!/bin/bash

if [ "${ACTION}" = "add" ] && [ -f "${DEVICE}" ]

then

        chown root "${DEVICE}"

        chgrp scanner "${DEVICE}"

        chmod 660 "${DEVICE}"

fi
```

I switched from devfs to udev the other day, that may have broken it. My filename is epson_scanner. Its in /etc/hotplug/usb.

Are you using devfs or udev?

----------

## iandoug

 *NeddySeagoon wrote:*   

> iandoug,
> 
> Ok, here's some things to check.
> 
> 1. You need usbfs. If you have it, then a file /proc/bus/usb/devices will exist and show lots of useful info about your USB system.
> ...

 

devfs AFAIK... that stuff is a bit confusing for a newbie like me... but certainly have /etc/fstab.

Do I need to add anything in there?

For the rest, already emerged hotplug etc, it's running, and there is a similar script to above called libusbscanner in /etc/hotplug/usb, and also a libsane.usermap which calls it, and which has my scanner listed.

I naively assumed that emerging sane-backends would take care of all these issues  :Wink:  ... or that KDE would have an Add Hardware wizard to do it if not....

Isn't there a checklist somewhere that I can work down to isolate the problem? I used to use the scanner on a Mandrake box without problems.

Thanks, Ian

----------

## NeddySeagoon

iandoug,

There is a howto here http://tldp.org/HOWTO/Scanner-HOWTO/sane.html its up to date but covers everything.

You will have a lot to ignore.

Pay particular attention to using USB with libusb. Ignore anything to do with Parallel and SCSI.

USB scanners do not (any longer) get entries in /dev so ignore everything related to makeing and finding them.

----------

## iandoug

Hi

Thanks for your help, eventually found the problem...

I had misread the table on http://snapscan.sourceforge.net/ and was using the wrong firmware upload.

Once I fixed that (and did a reboot before realising I didn't need), and let xsane load the new firmware, suddenly it worked...  :Smile: 

Only problem is that on boot, it doens't find the scanner... I have to manually unplug the scanner and plug it back in (power) and then it detects it fine.

Thanks for your patience  :Smile: 

Now need to see if Kooka works better than xsane...  :Smile: 

Cheers, Ian

----------

## NeddySeagoon

iandoug,

If the scanner is there at power-up you need coldplug. If you always add it later, hotplug should spot it.

Coldplug is a defualt level daemon that detects things at boot time.

```
emerge coldplug

rc-update coldplug add defualt
```

edit ============

You can capture straight into The GIMP

----------

## iandoug

 *NeddySeagoon wrote:*   

> iandoug,
> 
> If the scanner is there at power-up you need coldplug. If you always add it later, hotplug should spot it.
> 
> Coldplug is a defualt level daemon that detects things at boot time.
> ...

 

Aha...  :Smile: 

Things like that should be part of a default install, methinks...

I did rc-update add coldplug boot default

Thanks again for all your help  :Smile: 

Cheers, Ian

----------

## NeddySeagoon

iandoug,

What you get for defualt install has changed since I did mine. Its one of the problems of growing your system to the 'latest standard'.

There is no single latest standard, which is what makes life a bit difficult.

----------

