Monday 10 November 2003

(In)Sane Scanner for Linux

I'm blogging this one because I have needed it before today (this time being the 2nd time I have needed to know this info).

I have a BENQ 4300U USB Scanner, was $70 8 months a go and is still great.

Making it work with Linux is not too hard as some might think.
install the sane drivers .. (apt-get install sane) debian-esq

apt-get install xsane (the front gui scanning tool)


and now the firmware,

The sane driver (snapscan.sf.net) needs to know
how to talk to the scanner.
This is all in the scanner driver/bios/something file (i don't care much
for these details. I just need it to work .. gosh I'm changing :-), in the past
I would investigate everything..

so .. find this file on your windows install .. reference the table at snapscan.sf.net
My file is the u176v046.bin

How do I know this ?
Easy .. the device has a number, when you plug the USB scanner in, the linux USB drivers will
detect it and throw a message in /var/log/messages about such event.

In the log message, is the device number, which will correspond to the snapscan device id they know
about.. egc:

# dmesg | grep -i usb
... skip all this to the last lines ..
hub.c: new USB device 00:07.2-1, assigned address 3
usb.c: USB device 3 (vend/prod 0x4a5/0x20b0) is not claimed by any active driver.

vendor id and product ID .. 0x4a5/0x20b0

These quite cheerily map to the table entry at the aforementioned driver website.

So Search for this file on your windows boxen.
Mine of course is u176v046.bin

So .. I created a directoy /usr/lib/sane/firmware (anyone know where else this is meant to go, seems good to me)

and then edit the /etc/sane.d/snapscan.conf file ,
at the top set the path to your firmware file.

restart xsane and hey presto ..

BUT, something has changed since I did this on the laptop.

As I understand it, previously, sane used to use an object file
scanner.o method to talk to the scanner.
now it is all via /proc/bus/usb, which debian rightly warned me,
only root has access to.

So, a quick check in /usr/src//Documentation/usb
grep usbfs reveals proc_usb.txt, in there reveals
that you set devmode=0666 for the mount and the device entry points will get
-rw-rw-rw-

so my now /etc/fstab entry for the /dev/usbfs looks like

none /proc/bus/usb usbfs defaults,devmode=0666 0 0


Hope that all helps someone (and me next time I have to do it again and forgot
how I did it last time).

cheerios.

Current 5 booksmarks @ del.icio.us/pefdus