4. Configuring a scanner: Epson Perfection 1670

Installing SANE

To be able to run your scanner in GNU\Linux you will need the API developed by SANE. The project's site features a list of all supported devices. For each of them, a description of quality and the required backend are provided. You will accordingly find out that Epson Perfection 1670 is supported by the snapscan backend.
Calculate Linux Desktop inlcudes SANE and XSANE (the latter is the graphical frontend for SANE) by default; should they be absent from your system, execute:

emerge sane-backends xsane

(KDE4 users may also need the libksane package, which integrates the DE with the SANE interface)

Finding your scanner

Check if the system sees your device. To do so, enter:


(root rights are required to perform this)
The command should return a list of USB-connected devices: there must be a line containing the name of our scanner:
Bus 001 Device 002: ID 04b8:011f Seiko Epson Corp. Perfection 1670

Otherwise, have a look at the dmesg output:

dmesg | grep error

If you see something like this:
usb 2-9: device descriptor read/64, error -71
usb 2-9: device not accepting address 9, error -71

you should check the cable. Some devices require being connected to the USB 2.0 controller with a high-speed cable.

Also use the sane-find-scanner tool, which prints a list of all recognized scanners. Something like this should be returned:

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

You may naturally have a USB bus other than libusb:001:002.

Installing firmware

Some scanners cannot work properly without firmware. The same applies to Epson Perfection 1670. Firmware is not included in SANE distribution because of licence restrictions, but usually it is either available on the producer's site or can be found on the CD supplied with the scanner. In other words, you will need drivers for Windows. I suggest downloading them from the official site. In the driver archive, look for the file ModUsb.cab; to handle it, you will need the cabextract tool.

emerge cabextract

go to the directory which contains drivers and execute:
cabextract ModUsb.cab

look for esfw30.bin among the unpacked files: this is actually your firmware.

Configuring SANE

Copy the firmware file in /usr/share/sane/snapscan/. Now edit the configuration file of the applicable backend: open /etc/sane.d/snapscan.conf and edit the line containing the path to your firmware.

firmware /usr/share/sane/snapscan/Esfw30.bin

Switch the scanner off, disconnect the USB cable and plug it in again, switch the scanner back on. Now it is time to launch XSANE; let us give it a try with the root rights first. If the only applicable device you have is the scanner (no tuner, no webcam), you will have to select your device at the program start. What we need is the scanner, so select "EPSON Scanner1" and click on "OK". After a brief timeout, XSANE should start. If not, an error window will very probably pop up. The "Invalid argument" message means that something is wrong with your firmware. If the message says something about "I/O" errors, there must be a problem addressing the device. But if everything is OK, a scanning window will open and you will finally be able to use your device.

However, working with the root rights is not a good way to manage things; you will thus have to add all users that need access to the scanner to the scanner group:

gpasswd -a user1,user2 scanner

Thank you!