Sane

From ArchWiki

Jump to: navigation, search


Contents

Introduction

Sane provides a library and a command-line tool to use scanners under GNU/Linux.

Step 1: Check if sane supports your scanner

Check if sane supports your scanner

Step 2: Installation

sane is available in the extra repository so:

# pacman -S sane

Step 3: Configuration

Users that need to use a scanner should be part of the group scanner. Use gpasswd to add a user to a group:

# gpasswd -a username scanner
Note: You need to logout/login for this to take effect.

Now you can try to see if sane recognizes your scanner

$ scanimage -L

If that fails, check that your scanner is plugged into the computer. You also might have to unplug/plug your scanner for /etc/udev/rules.d/sane.rules to recognize your scanner. Note: For HP hardware you may also need to install the hplip package which is in the extra repository:

# pacman -S hplip

Don't forget to enable hpaio in /etc/sane.d/dll.conf. Running hp-setup as root may help you add your device.

Step 4: Firmware

Note: This section is only needed if you need to upload firmware to your scanner.

Get the firmware

Note: If you don't have an install CD, you might find the required software on the scanner manufacturer's website.

Extract the file from your scanner install CD

Firmwares usually have the .bin extension.

But it may also be in:

  • a .exe file; in this case maybe it is just a zip archive, install and run unzip to find out.
  • a .cab file; install and run cabextract to extract it.

Install the firmware

Firstly you need to put the firmware someplace safe, it is recommended to put it in a subdirectory of /usr/share/sane.

Then you need to tell sane where the firmware is:

  • Find the name of the backend for your scanner from the sane supported devices list.
  • Open the file /etc/sane.d/<backend-name>.conf.
  • Make sure the firmware entry is uncommented and let the file-path point to where you put the firmware file for your scanner. Be sure that members of the group scanner can access the /etc/sane.d/<backend-name>.conf file.

Step 5: Install some frontend(s)

XSane provides a GTK-based frontend to Sane. It is available in the extra repository.

# pacman -S xsane

Other frontends exist, to find them you can:

  • use pacman -Ss to search for keywords such as "sane" or "scanner"
  • see the list of frontends on the sane-project website

Troubleshooting

Invalid argument

If you get an "Invalid argument" error with xsane or another sane front-end you probably need a firmware. See above for details.

Permission problem

If you see your scanner only when doing 'sudo lsusb' you might get it working by adding your user to lp group. At least with my all-in-one (HP PSC 2355) doing this worked.

gpasswd -a username lp

DBus problem

If you get following problem:

arguments to dbus_connection_send() were incorrect, assertion "connection != NULL" failed in file dbus-connection.c

Add dbus to groups lp,scanner

gpasswd -a dbus lp
gpasswd -a dbus scanner
Personal tools