Revision 3 as of 2013-10-27 03:47:23

Clear message

sane - Scanner Access Now Easy

  • ** Work in progress - not yet ready for use ***

Introduction

sane (Scanner Access Now Easy) is the linux way of scanning. sane supports a great many scanners, and the community around sane adds support for more scanners all the time. By and large, most supported scanners are plug and play simple (plug them in and your ready to scan). However, some scanners

About this tutorial

This tutorial will walk you through the basic set up of sane with plug and play scanners.

Assumptions

We make the following assumptions in this tutorial (you will need to adjust these to fit your situation)

  • This set up assumes that we are on a small home or office network and are behind a firewall.
  • Our LAN is an IP4 network on subnet 192.168.0.0/24 (192.168.0.0 - 192.168.0.255)
  • Our Ubuntu box is 192.168.0.23
  • Our USB scanner is located at libusb:001:003
  • Our SCSI scanner is at /dev/sg1
  • Our network scanner is at 192.168.0.15
  • Our scanner uses the example backend (example-backend)

Setting up SANE

Step 1: Installing sane

Ensure that you have at least version 1.0.22 of sane installed. sane 1.0.22 is installed by default on ubuntu 11.10 desktops, but we still need to check and make sure we have it, and that we have the correct version. To do that, run this command from a terminal:

scanimage -V

You should see something like this as a result:

scanimage (sane-backends) 1.0.22; backend version 1.0.22

(hint: it should already be installed on Ubuntu 11.10 and higher. If it reads version 1.0.21, you do not have the magicolor back end, and need to upgrade to a newer version of ubuntu).

If sane is not installed (you would have gotten a command not found error), then you can install it using the following command

{apt-get install libsane sane sane-utils libsane-extras xsane

This will also install the xsane front end. Note that some scanner will require other packages be installed. Those are covered in the scanner specific pages.

Enabling the proper backend

Most of the time, the back-end for your scanner will be enabled by default. For some scanners, you will need to enable it manually.

Start by checking [http://www.sane-project.org/sane-mfgs.html] to see what back-end your scanner uses.

Edit the file /etc/sane.d/dll.conf by running the following command:

sudo gedit /etc/sane.d/dll.conf

Within that file, you need to uncomment your backend. In our case, change the line that reads

#example-backend

to read

example-backend

Save the file and close gedit.

Installing your USB scanner

USB scanners are mostly auto detected. So long as the backend is enabled, most scanners need no further configuration. If your scanner is not auto-detected, if scanning does not work as expected or if your scanner needs it, you will have to specify your scanner in the scanners backend configuration file.

1. With your scanner plugged into your computer via a USB cable, run the command:

sane-find-scanner

the output of that command will look something like this:

  # sane-find-scanner will now attempt to detect your scanner. If the
  # result is different from what you expected, first make sure your
  # scanner is powered up and properly connected to your computer.

  # No SCSI scanners found. If you expected something different, make sure that
  # you have loaded a kernel SCSI driver for your SCSI adapter.

found USB scanner (vendor=0x123a [EXAMPLE SCANNER], product=0x2089 [Example Scanner]) at libusb:001:003

  # Your USB scanner was (probably) detected. It may or may not be supported by
  # SANE. Try scanimage -L and read the backend's manpage.

  # Not checking for parallel port scanners.

  # Most Scanners connected to the parallel port or other proprietary ports
  # can't be detected by this program.

You can ignore everything that starts with a hash tag, but the important part is this line:

found USB scanner (vendor=0x123a [EXAMPLE SCANNER], product=0x2089 [Example Scanner]) at libusb:001:003

2. We need to add those two values to the back end configuration file. Backend configuration files are located in /etc/sane.d/. Our example backend configuration file is /etc/sane.d/example.conf. You can edit that file as root using this command:

 sudo gedit /etc/sane.d/example.conf

3. Find the line that reads:

 usb

and after it we need to add a line with the word "usb" followed by the vendor number and the product number we got with the scanimage -L command. That line should look like this:

 usb 0x123a 0x2089

4. After you have added that line, save the file and close gedit.

Installing your SCSI, Parallel or Proprietary Port Scanner

The process for installing other types of scanners is the almost identical to installing a SCSI scanner, however you need to add the address to the proper section of the backend file (e.g. under SCSI)

Installing Network Scanners

Many network scanners work with sane in one of two ways. The scanner can have its own sane server, or it can be supported by a backend.

Scanners with their own SANE servers

Scanners with their own SANE server, as well as scanners connected to a computer running the saned service can be easily added to other computers on the network by enabling the NET backend and adding the servers IP address in the net.conf file.

1. To enable the net backend, edit the file /etc/sane.d/dll.conf by running the following command:

sudo gedit /etc/sane.d/dll.conf

Within that file, you need to uncomment the NET backend. In our case, change the line that reads

#NET

to read

NET

2. We need to add our server or servers to the /etc/sane.d/net.conf. You can edit that file as root using this command:

 sudo gedit /etc/sane.d/net.conf

3. Add your SANED server address as an IP4, IP6, hosts or DNS resolvable name

192.168.0.15
::1
localhost
scan-server.office.lan              

Save your file and close.

Scanners with SANE backends

SANE Backends are available for a number of network scanners. In general, all these need is to specify the protocol, address and port of your server.

1. Our example backend configuration file is /etc/sane.d/example.conf. You can edit that file as root using this command:

 sudo gedit /etc/sane.d/example.conf

3. Find the line that reads:

 network

and after it add the protocol, address and port of your network server. In our case, its

tcp 192.168.0.15 6566

4. After you have added that line, save the file and close gedit.

NOTE: to set up saned, see [https://help.ubuntu.com/community/sane.d%20tutorial]