Наши партнеры








Книги по Linux (с отзывами читателей)

Библиотека сайта rus-linux.net

Using a USB Scanner

As noted in the installation part, the scanner driver provides a link for a suitable user space program to access the scanner hardware. This section deals with getting the user space program (SANE) set up correctly.

If you don't have SANE installed, you can get it from from the any of the sites referenced at http://www.mostang.com/sane/source.html.

At this point, you need to do different things depending on what sort of scanner you have. Mostly you need to change configuration files. If you selected the default install location, SANE's configuration files are located in /usr/local/etc/sane.d/. If SANE came installed with your distribution, the configuration files are probably in /usr/etc/sane.d/.

Hewlett Packard Scanners

Not all Hewlett Packard scanners are supported by the sane-hp backend driver. The only ones with a reasonable chance of working are HP4100C, HP5200C, HP6200C and HP6300C. The Photosmart S20 should also work. Note that the HP3300C and HP4200C are not included in the devices with a working backend.

For a HP scanner, you need to change /usr/local/etc/sane.d/hp.conf to contain just the following two lines:
/dev/usb/scanner0
  option connect-device

Epson Scanners

The Perfection 636U and Perfection 1200U scanners have a reasonable chance of working with the sane-epson backend driver.

For an Epson scanner, you need to /usr/local/etc/sane.d/epson.conf to contain the following line:
usb /dev/usb/scanner0

AGFA ScapScan 1212U

This scanner comes in two versions. The version 2 model needs its firmware downloaded. Both version 1 and version 2 need patches to SANE.

Check the driver disk that came with your scanner for a file named SnapScan 1212U_2.bin. If there is no file by that name, you probably have a version 1 scanner and can proceed on. Otherwise you need to copy that file off, and obtain a suitable firmware downloader, such as the agfafirm tool from http://hem.fyristorg.com/henrikj/snapscan/downloads/agfafirm. With this tool, you then do agfafirm /dev/usb/scanner0 "SnapScan 1212U_2.bin". The status lamp on the scanner should flash.

You need to modify the SANE sane-snapscan backend. This requires the source code. Complete the following steps:

Note that this patch will not apply cleanly to SANE 1.0.2, but there you can either apply the rejects by hand or use a development patch. I assume that if you can do this, you won't need detailed instructions.

If you do not have a functional SANE at this point, likely problems are linking to an obsolete SANE backend (check your install target for old libsane-snapscan entries.

Prisa Acerscan Scanners

In addition to SANE changes, the Prisa Acerscan 620U and 640U need firmware downloaded.

Check the driver disk that came with your scanner for a file named u96v057.bin in the DRIVERS/DISK1/BIN/ directory. Copy this file off the driver disk.

You need to obtain a suitable firmware downloader, such as the acerfirm tool from http://utopia.knoware.nl/~joey/linux/acerfirm. With this tool, you then do acerfirm /dev/usb/scanner0 "u96v057.bin". The status lamp on the scanner should flash.

You need to modify the SANE sane-snapscan backend. This requires the source code. Complete the following steps:

  • Obtain the source code from ftp://ftp.mostang.com/pub/sane/sane-1.0.1.tar.gz.
  • unpack the sources with the following command: tar xvzf sane-1.0.1.tar.gz
  • change into the sane source directory: cd sane-1.0.1
  • obtain the required patch from http://hem.fyristorg.com/henrikj/snapscan/downloads/sane-1.0.1-usb.diff.
  • Apply the patch with the following command: patch -p1 < sane-1.0.1-usb.diff
  • Hand edit the following area in backend/snapscan.h
    static struct SnapScan_Model_desc scanners[] =
    {
      /* SCSI model name -> enum value */
      { "FlatbedScanner_4", VUEGO310S },
      { "SNAPSCAN 1212U", SNAPSCAN1236S },
      { "SNAPSCAN 1212U_2", SNAPSCAN1236S },
      { "SNAPSCAN 1236",    SNAPSCAN1236S },
      { "SNAPSCAN 310",     SNAPSCAN310 },
      { "SNAPSCAN 600",     SNAPSCAN600 },
      { "SnapScan",         SNAPSCAN300 },
    };
    to include the following additional entry:
     { "FlatbedScanner13",  SNAPSCAN600 },
  • Build and install SANE with the following command: ./configure; make; make install

Note that this patch will not apply cleanly to SANE 1.0.2, but there you can either apply the rejects by hand or use a development patch. I assume that if you can do this, you won't need detailed instructions.

Using SANE

You should now be able to use a SANE frontend (xscanimage or scanimage) to scan images. You may need to specify what device you are using as a command line option (-d) to scanimage. Much more information is available in the various SANE man pages, including how to get GIMP and xscanimage working together.