How to install an Epson Perfection 1670 plotter under RedHat Fedora Core 1 (and 2)

The essay covers one way to install an Epson Perfection 1670 scanner  under RedHat Linux Fedora Core 1.0 and 2.0.  The Epson Perfection 1670 is a USB plotter.  It has 4 buttons on the front panel, a film scanning feature, is color capable.  I think the 1670 is going to be a winner, and I think Fedora is also going to be a winner, but I found the installation overly complicated so I am writing up how I did it.

My asumption is that you have knowlege of RedHat Linux, but not necessarily knowlege about other linuxes or non-linux UNIXes. Furthermore, I assume you have Fedora Core 1 or 2: Fedora Core 3 has a much simpler procedure.


Software components

There are several layers of software that have to work together for the 1670 to work properly.  There is some software that actually goes in the scanner (this is a Good Thing, because if bugs are found in the scanner internal software, then it will be easy to fix.  However, the implementation could be better).  There is a device driver for USB (actually, there is more than one).  There is a low level interface to the scanner called the SANE backend.  There is a high level interface called SANE (Scanner Access Now Easy) and then there are applications which use SANE.  The software can be thought of as a stack:

software component
Function
SANE based applications
User interfacce, save images in different formats, copy images, FAX
SANE
Implements a virtual scanner so that any graphical application can connect to a real scanner (or a TV camera or a digital camera, etc.)
Snapscan
A SANE backend.  Implements the interface to the real device.  Real device dependencies are captured here.  The snapscan component actually handles several scanners which are similar to the Epson 1670.  There are many other SANE backends
Kernel USB device driver
or
libusb
Handles discovery and communication over the USB.  I lump the /dev/usb/scanner0 device in with this component.  However, the scanner module is no longer available under the 2.6 Kernels; you must use libusb.
Plotter firmware
This component is the software inside the plotter that makes it function.  It has to be downloaded into the plotter each time the plotter is turned on (and maybe more frequently).

This procedure works from the bottom up.  Remember, there is more than one way to do it.

The plotter firmware.

The plotter firmware comes in a file called ESFW30.BIN, which apparently is only available if you install the software on the CD-ROM provided with the plotter.  Unfortunately, the software only installs under MS-Windows (it might work under WINE, I didn't try that), and then you have to copy the software from the Windows machine to the linux machine.  Since I hope you will find this procedure as odious as I do, I took the liberty of copying the file to my web server, http://www.commercialventvac.com/%7Ejeffs/ESFW30.BIN .  As root, I copied this file into /usr/share although you have a lot of flexibility on this score.  Note this location, as you will need it when you create the /etc/sane.d/snapscan.conf file.

The Kernel USB driver

The Fedora Core 1.0 kernel comes with USB support already built as a module, so this was not a problem.  On other distributions, you might have to rebuild the kernel with USB support.  Refer to the kernel documentation for more details.  The Fedora Core 2 Kernel requires you to use libusb.

To load the module, there are several ways to do it. For testing purposes, you can use modprobe directly (as root): modprobe scanner vendor=0x04b8 product=0x011f When you are happy with your module, you can make it load automatically at boot time by adding the line options scanner vendor=0x04b8 product=0x011f to the file /etc/modules.conf.

There is another component, called libusb, which provides the same functionality but it works in user space.  I am not sure I understand the differences between regular kernel support and libusb.  My intuition tells me that libusb will be more reliable because it works in user space: if anything goes wrong, it will crash the application but it won't crash the system.  Also, libusb will be easier to install and modify, and it still has to use the kernel at some point anyway.

I did have to create a device for the scanner, /dev/usb/scanner0.  I did that as root with the command

mknod /dev/usb/scanner0 c 180, 48

The c means that this is a character (unbuffered, or serial) device.  The 180 is the major device number and the 48 is the minor device number.  The major and minor device numbers have meaning to the kernel but unless you are a kernel developer, all you need to know is 180 and 48 are the numbers to use.

You can protect your scanner so that only some people may use it by creating a scanner group using addgroup and then adding the people authorized to use the scanner to that group.  Or you can simply give everybody and anybody access to the scanner by giving the command (as root again)

chmod a+rw /dev/usb/scanner0


snapscan-1.0.13

Snapscan is a SANE backend.  In Fedora Core 2, version 1.0.13-7 is supplied so the installation is a little simplified.  I upgraded from Fedora Core 1 to Fedora Core 2, so it just worked.

(20-Sep-2004) The sane-backends 1.0.13 is available in FC2, so if you running Fedora Core 2, then skip to step 6 below.  As of this writing (8-Feb-2004)(16-Apr-2004), RedHat Fedora Core 1.0 included sane-backends-1.0.12-4, which, I am told, does not support the Epson 1670 (although I am not sure why).   However, version 1.0.13 does.  Version 1.0.13 is not available as an RPM (which also means it is not available through yum yet) so I had to get it as a tarball and install it that way.  These instructions are probably applicable to sane-backends-1.0.14 as well.

  1. First, uninstall sane-backends-1.0.12-4 with the command
    rpm -e sane-backends-1.0.12-4
    If you don't like that, remember you can revert back to it by reinstalling it with rpm or using yum. The /etc/sane.d/snapscan.conf file will be saved as /etc/sane.d/snapscan.conf.rpmsave in case something goes wrong.
  2.  Next, download the tarball of the sane-backends-1.0.13 package.   Get it from the source ftp://ftp.mostang.com/pub/sane/sane-backends-1.0.13/sane-backends-1.0.13.tar.gz or from one of its mirrors.  Save this file in a temporary directory
  3. Run configure.  In the UNIX world (and Linux is a UNIX), there are many ways to do things (this is a mixed blessing), and so you have to tell the software where it goes.  There are several answers, and rather than argue over what is the right way to do it, let me simply say that the default way tarballs are done and the way Fedora does it are different.  So, give the command
    ./configure --prefix=/usr
  4. Next, you have to compile all of the source code in the tar ball - but there is a Makefile to do it for you.  Give the command
    make
  5. Assuming all goes well (the compiler finds a lot of minor grammatical errors, and I wish it wouldn't), install the software.  As root, give the command
    make install


  6. Now, we have to tell snapscan that we have an Epson Perfection 1670 scanner and we also have to tell it where the firmware file is.  To to this, as root, modify the file /etc/sane.d/snapscan.conf .  You have to make the following changes:
    1. There is a firmware directive with a path to the firmware file you saved above.  Modify the path so it points to the firmware file.
    2. You have to tell snapscan what the manufacturer code and product ID is for the Epson 1670, and that it is a USB device.  So add the lines
      # Epson Perfection 1670
      usb 0x04b8 0x011f
    3. Add  the  lines
      # For USB scanners also specify bus=usb, e.g.
      /dev/usb/scanner0 bus=usb

      This also tells snapscan to go look on the USB for the scanner.  This is typical for the 2.4 kernel.  For the 2.6 kernel, it will look like
      libusb:004:003 bus=usb  
      Why?  I don't know.  It turns out that the  usb 0x04b8 0x011f  directive is sufficient and the libusb directive is redundant and should be removed.

  7. Now, we are ready for testing.
    1. Make sure that scanimage is installed. scanimageis a command line interface to the sane backends, so technically, it is a sane front end, but it is bundled with the sane-backends for testing purposes. system
    2. Give the command scanimage -d test --format png > /tmp/testImage.png This command should create a black rectangle in /tmp, which you can view with eog (or other PNG viewing program such as mozilla, etc.). This tests that most of the libraries were installed correctly
    3. Give the command scanimage -L You should see
      device `snapscan:/dev/usb/scanner0' is a EPSON Epson Scanner flatbed scanner
      (under 2.4 kernels)
      or
      device `snapscan:libusb:004:003' is a EPSON EPSON Scanner flatbed scanner (under 2.6 and later kernels)
    4. Now for the acid test: (2.4 Kernels only!) can you scan an image. Put something in the scanner so you know what you are looking at and try again.
      scanimage -d snapscan:/dev/usb/scanner0 --format png > /tmp/testImage.png
      [snapscan] Scanner warming up - waiting 11 seconds.
      [snapscan] Scanner warming up - waiting 35 seconds.
    5. Now for the acid test (2.4 and 2.6 Kernels): Again, put something in the scanner and give the command:
      [jeffs@black]$ scanimage -v  --mode line --format png > ~/out.png
      [snapscan] Scanner warming up - waiting 10 seconds.
      [snapscan] Scanner warming up - waiting 35 seconds.
      scanimage: scanning image of size 2560x3507 pixels at 1 bits/pixel
      scanimage: acquiring gray frame
      scanimage: read 1122240 bytes in total
      [jeffs@black]$



  8. If this doesn't work, then you have to go through troubleshooting

SANE

SANE based applications

To find the list of applications which use SANE, give the command
[jeffs@jyw jeffs]$ rpm -q --whatrequires libsane.so.1
wine-20020605-2
xsane-0.91-1
xsane-gimp-0.91-1
kdegraphics-3.1.4-1
sane-frontends-1.0.11-3
[jeffs@jyw jeffs]$

 
For example, to install xsane, if you have the RPM file, simply

rpm -Uvh xsane-0.91-1.rpm

Or, if you prefer to use yum, you can

yum install xsane

The SANE frontends page lists some other front ends, including:

Known problems

  1. The  file  ESFW30.BIN, should be online somewhere easy to find
  2. The sane-backends-1.0.13 should be converted to RPM format and contributed to Fedora
  3. When xsane tries to scan at more than 600 DPI resolution, the color registration fails.  I am still checking into this problem.  All of the following images are 150 pixels wide.  Note that the 50 DPI image has 3 pixels displayed for every real pixel: you can see the pixels with a magnifying class.  800 and 1600 DPI are available in the 1.0.14 backend but 1600 DPI doesn't work well yet.
    50 DPI 150 DPI 300 DPI 450 DPI 600 DPI 900 DPI 1200 DPI
    50 DPI 150 DPI 300 DPI 450 DPI 600 DPI 900 DPI
    900 DPI
    1200 DPI
    1200 DPI
  4. The buttons on the scanner appear not to work.
  5. Sometimes, cycling the power on the scanner is an effective troubleshooting technique.  Cycling power on the computer is never effective.

Not tested

I haven't tested the film holder yet.   SANE allows a scanner to be accessed across a network, I haven't tested this.

Acknowlegements

Oliver Schwartz <Oliver.Schwartz@gmx.de> sent some very helpful comments about the USB system under Fedora Core 2.

Some additions/corrections to your site:
- With kernel 2.6 you can only use libusb. The "scanner" module is obsolete and is no longer present in the 2.6 kernel series.

- When using libusb you don't need (and indeed shouldn't have) any device entry like "libusb:004:003 bus=usb" in snapscan.conf. The only important entry is the one containing the USB ID of your scanner, e.g. "usb 0x04b8,0x011f" for the Epson 1670.

- 900 and 1200 dpi don't work for the 1670. These resolutions are no longer supported by the backend. Instead, 800 and 1600 dpi have been added in the backend. There are still some problems reported with 1600 dpi (interlaced images), but 800 dpi should work fine. You need to upgrade to sane-backends 1.0.14 to get the new resolutions to work.



<Oliver.Schwartz@gmx.de>

Fedora Core 3 and later

Fedore Core 3 has all of this software prebuilt for you. All you have to do is install it using yum or rpm. 150 DPI The images of Randall Bruce Racus is © 2004 Jeff Silverman and all rights are reserved.  The text of this document is available to all under the GPL.