How to install a scanner in Debian GNU-Linux using Sane

From NewbieDOC

Chris Lale
chrislale AT users DOT berlios DOT de (publisher)

Go to NewbieDOC index

Revision History


Revision 1.0 23rd April 2008 Revised by Chris Lale
Initial release.

Live Date(s): click on the history tab. Revised by: click on the history tab.
This is the live, editable version.


Image:Newbiedoc-32.png Stable document
You can comment on this document by clicking on the discussion tab.

You can edit the live version of this document: How to install a scanner in Debian GNU-Linux using Sane


Abstract

This article should help you to set up a scanner in Debian. It uses the Mustek ScanExpress 1248UB as an example. It has been tested using Etch and Lenny.


Contents


1 Check/choose your scanner model

Check that you scanner is supported at the Sane Project website: http://www.sane-project.org/sane-backends.html. Use your browser's search function to locate your model. For instance, to search the page for the Mustek 1248UB using Firefox or Iceweasel:

Ctrl + F
1248

gives this information

Backend: gt68xx
Manufacturer: Mustek
Model: ScanExpress 1248 UB 	
Interface: USB 	
USD id: 0x055f/0x021f 	
Status: Complete

2 Install the Debian packages

sane - scanner graphical frontends sane-utils - API library for scanners -- utilities libsane - API library for scanners xsane - GTK+-based X11 frontend for SANE (Scanner Access Now Easy)

You can find out more about the backend for your scanner by looking at its manual page after you have installed libsane. Eg for the Mustek 1248UB:

$ man sane-gt68xx

You will find more general help in the manual page for sane:

$ man sane

3 Set up the software

3.1 Install the scanner firmware file

Put a copy of the firmware file from the scanner manufacturer's CD into /usr/share/sane/<backend>/.

The name of the file for the Mustek 1248UB is SBSfw.usb. Put it in

/usr/share/sane/gt68xx/

In the case of the Mustek 1248UB, you can also download a copy of the file from http://www.meier-geinitz.de/sane/gt68xx-backend/.

3.2 Check the configuration file

Look at the contents of the configuration file for your backend in /etc/sane.d/<backend>.conf. The file for the Mustek 1248UB is

/etc/sane.d/gt68xx.conf

The section for 1248 UB looks like this:

# Autodetect Mustek ScanExpress 1248 UB
usb 0x055f 0x021f

Some scanners require you to uncomment certain lines. Details are in the manual page for your backend.

4 Test the scanner

Connect your scanner to a USB port.

 
Note
Note: 
The scanner may not work correctly if you connect it via a USB hub. Connect it directly to a USB socket on the motherboard panel at the back of your computer.
 

Check that sane can find the scanner:

$ sane-find-scanner
[...]
found USB scanner (vendor=0x055f, product=0x021f [USB Scanner], chip=GT-6816) at
libusb:005:004
[...]

Check that the scanner has been correctly identified. (Do this as user root.)

# scanimage -L
device `gt68xx:libusb:005:004' is a Mustek ScanExpress 1248 UB flatbed scanner

Carry out a simple test. (This works even without a scanner connected.)

# scanimage -d test -T
scanimage: scanning image of size 157x196 pixels at 8 bits/pixel
scanimage: acquiring gray frame, 8 bits/sample
scanimage: reading one scanline, 157 bytes...   PASS
scanimage: reading one byte...          PASS
scanimage: stepped read, 2 bytes...     PASS
[...]

Carry out a test on your backend (with scanner connected):

# scanimage -d gt68xx -T
scanimage: scanning image of size 2563x3531 pixels at 8 bits/pixel
scanimage: acquiring gray frame, 8 bits/sample
scanimage: reading one scanline, 2563 bytes...  PASS
scanimage: reading one byte...          PASS
scanimage: stepped read, 2 bytes...     PASS
[...]

You may hear the scanner working.

Perform a scan. Put some artwork in the scanner and issue this command:

scanimage --format pnm > outfile.pnm

Open and check the file created in the current working directory.

5 Add users to the scanner group

Sane commands, and the Xsane application, are only available to user root and users in the group 'scanner'. It is not recommended to run Xsane as root.

If you add yourself to the scanner group, don't forget to logout and login again to activate the your membership of the group. Run xsane and enjoy scanning!

6 Appendix A: Licence

Copyright ©2008 Chris Lale, chrislale AT users DOT berlios DOT de.

GNU FDL Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is included in the section entitled "GNU Free Documentation License."


Go to NewbieDOC index

Content is available under GNU Free Documentation License 1.2, unless otherwise stated.