SANE - Scanner Access Now Easy

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 will require manual installation.

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

Sane should be installed as a base package in Ubuntu 11.04 and later. You can run the following command to install it (if it's already installed, it will do nothing):

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

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

Step 2: Test your scanner

Run following command to test your scanner:

Applications > Graphics > XSane

You should see a dialog for scanning from your scanner. If SANE says that it can't find the scanner, you will need to do a manual installation.

Manual Scanner Installation

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. This usually involves enabling the back-end, and then adding your scanner to it.

Enable the back-end

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

Some backends need to be enabled for them to work. If this is the case for your scanner, do it by editing the file /etc/sane.d/dll.conf:

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

Within that file, you need to uncomment your backend. Supposing you discovered that the back-end for your scanner is called "wowscan", then you should change the line that reads

#wowscan

to read

wowscan

If the line exists without a hash, the back-end is already enabled.

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 (make sure to replace example.conf with the name of your back end configuration file). 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]

Specific Scanners

HP Scanners

The majority of HP scanners are supported by the hplip project. Setting up an HP scanner can be done using the following command:

hp-setup

This wizard will set up your scanner for use with SANE.

Brother Scanners

Brother offers proprietary SANE drivers for its family of network scanners and multi-function devices.

To install, visit [http://support.brother.com/g/s/id/linux/en/download_scn.html] and download the proper driver for your scanner (brscan, brscan2, brscan3 or brscan4) and your computer (32 or 64 bit) to your desktop. NOTE: You need the .deb version!

Run the following command to install the driver you just downloaded (note: the example below is for the brscan2 package. You will have to change the file name to match what you downloaded)

dpkg -i --force-all brscan2-0.2.4-0.i386.deb 

After you have installed the scanner driver, you need to run the Brother SANE Configuration tool. When you run that tool, you need to append the device name (what you want to call it), the model number and the ip address of the scanner. In the example below, we are using the "brsaneconfig2" tool, we calling the scanner "MyScanner", the model we are installing is the MFC-660CN and the IP address is 192.168.0.15.

brsaneconfig2  -a  name=MyScanner  model=MFC660CN  ip=192.168.0.15

NOTE: One issue that confuses a lot of users is the difference between brscan, brscan2, brscan3, brscan4 and brscan5. Each of these tools supports a different set of scanners, and you need to download the appropriate package for your scanner. Because it is possible to install many different scanners, you need to run the proper version of the brsaneconfig tool. If your scanner is supported by the brscan3 tool, you will need to run the brsaneconfig3 tool to configure it.

Samsung Scanners

Samsung scanner users are advised to install drivers via the The Samsung Unified Linux Driver Repository. See [http://www.bchemnet.com/suldr/index.html] for information on the SULDR project.

sane (last edited 2015-01-30 11:41:52 by rrt)