This document describes the process of installing a scanner with a USB interface in Arch Linux.

−

−

'''Update:''' Since I first wrote this document, the installation routine for the sane package has been improved. The only thing you have to do for supported scanners is to install sane with pacman and add your username to the group "scanner". This document is therefore only necessary for scanners that are not listed in the default usermap file of sane, for people who are interested in hotplug configuration or for those who are interested in network support.

−

−

====Verify that your scanner works with SANE====

−

Many but not all of the scanners on the market are supported by SANE. The best way to find out whether yours is supported is to directly check on the project's website: [http://www.sane-project.org/sane-supported-devices.html sane-supported-devices]. On this site, you will also find the information, which SANE backend you will need.

−

−

====Install sane====

−

−

# pacman -S sane

−

−

While xsane is not necessary, but the program is very useful under X windows, it's with gtk2 GUI.

−

−

# pacman -S xsane

−

−

By default, '''hotplug''' has been installed on your Arch system, but if not, you can decide to install or not. However it's strongly recommended.

−

−

−

====Get scanner to work====

−

−

# Open a terminal and log in as root

−

−

# Execute the program

−

−

# sane-find-scanner

−

−

to verify that SANE correctly detects your scanner.

−

−

# Get the device name of your scanner. The easiest way to find it, is to user the program scanimage:

If this correctly creates a file called test.tiff with a reasonable content, we are ready to setup the scanner for the ordinary user.

−

−

# gpasswd -a yourusername scanner

−

−

Minor remarks for some plustek scanners (noticeably Canoscan ones), they require a lock directory. Make sure that /var/lock/sane directory exists, that its permissions are 660, and that it is owned by root:scanner. If the directory permissions are wrong, only root will be able to use the scanner.

−

Seems (at least on x86-64) that some programs using libusb (noticeably xsane and kooka) need scanner group rw permissions also for accessing /proc/bus/usb to work for a normal user.

−

−

That's it, have fun with your scanner.

−

−

====Epson Perfection 1270====

−

−

This is for some scanners which are listed as 'good' support but you simple don't know how to make it work, here I take '''Epson Perfection 1270''' as an example.

−

−

By checking the [http://www.sane-project.org/sane-supported-devices.html sane-supported-devices] page, you can find very useful information for your scanner. Here I know Epson Perfection 1270 is supported by snapscan backend.

−

−

For Epson Perfection 1270, you also need a firmware named esfw3e.bin, you can get it from (anyone could give a working place so I can upload it?), or you can get it yourself by reference to [http://wiki.archlinux.org/index.php/Scanner_setup_%26_configure Scanner setup & configure]. I get it by installing the driver in the windows.

−

−

Modify configuration file of snapscan backend:

−

−

# vi /etc/sane.d/snapscan.conf

−

−

Change the firmware path line with yours. :

−

−

# Change to the fully qualified filename of your firmware file, if

−

# firmware upload is needed by the scanner

−

firmware /mnt/mydata/Backups/firmware/esfw3e.bin

−

−

And add the following line in the end or anywhere you like

−

−

# Epson Perfection 1270

−

usb 0x04b8 0x0120

−

−

You can get such code information (''usb 0x04b8 0x0120'') by "sane-find-scanner" command.

Instead of the values 0x04a9 and 0x220e, insert the Vendor oder ProdID numbers from step 1.

−

Save the file as usbscanner.usermap.

−

(for newer udev, edit the /etc/udev/rules.d/sane.rules)

−

−

# We now need to create a shell script to set the correct permissions on the scanner device. Again, with you favorite text editor, create a file called usbscanner in /etc/hotplug/usb. Insert the following text

−

<pre>

−

#!/bin/bash

−

#

−

# /etc/hotplug/usb/usbscanner

−

#

−

−

GROUP=users

−

−

if [[ \"${ACTION}\" = \"add\" ]] && [[ -f \"${DEVICE}\" ]]

−

then

−

chmod o-rwx \"${DEVICE}\"

−

chgrp \"${GROUP}\" \"${DEVICE}\"

−

chmod g+rw \"${DEVICE}\"

−

fi

−

−

and save the script.

−

−

# Make the script executable

−

−

# chmod +x /etc/hotplug/usb/usbscanner

−

</pre>

−

−

====Test your configuration====

−

# To test your configuration, plug in your scanner and turn it on. If it was already plugged in before, plug it out and in again to invoke the script.

−

−

# List the contents of /proc/bus/usb by typing

−

−

# ls -lR /proc/bus/usb

−

−

There should be at least one device which doesn't say \"root\" twice. On my machine, the output looks like so:

−

−

<pre>

−

/proc/bus/usb/003:

−

total 0

−

-rw-r--r-- 1 root root 43 Apr 12 22:02 001

−

-rw-r--r-- 1 root root 73 Apr 12 22:02 002

−

-rw-rw---- 1 root users 57 Apr 12 22:08 004

−

</pre>

−

−

Notice the last line.

−

−

====Use your scanner in your favourite application====

−

−

You can now use gimp or xsane to scan pictures with your scanner. Enjoy!

−

−

==== Sharing Your Scanner Over a Network ====

−

−

You can share your scanner with other hosts on your network who use sane, xsane or xsane-enabled Gimp. To set up the server (the PC which is connected to your scanner), first indicate which hosts on your network are allowed access.

−

−

Add the following to the /etc/sane.d/sane.conf file:

−

<pre>

−

# required

−

localhost

−

# allow all local hosts

−

192.168.0.0/24

−

</pre>

−

−

Of course, you may need to change "192.168.0.0/24" to suit your local area network. You can also specify individual hosts, as the following examples illustrate:

−

<pre>

−

# specific host with static IP address

−

192.168.0.2

−

# specific hosts supported by local DNS or /etc/hosts

−

bristol

−

brandal

−

brutus

−

</pre>

−

−

You also have to allow connections from network to saned by adding following (or similar) line to /etc/hosts.allow:

−

<pre>

−

saned: 192.168.0.0/255.255.255.0

−

</pre>

−

−

Ensure xinetd is installed:

−

<pre>

−

# pacman -S xinetd

−

:: xinetd-#.#.##-#: is up to date. Upgrade anyway? [Y/n] n

−

</pre>

−

−

Also be sure to add xinetd to the list of DAEMONS in /etc/rc.conf

−

−

Next, create a file called /etc/xinetd.d/sane-port and include the following:

−

<pre>

−

service sane-port

−

{

−

port = 6566

−

socket_type = stream

−

wait = no

−

user = nobody

−

group = nobody

−

server = /usr/sbin/saned

−

disable = no

−

}

−

</pre>

−

−

Add the following line to /etc/services:

−

<pre>

−

sane-port 6566/tcp # SANE network scanner daemon

−

</pre>

−

−

Ensure that port 6566 is not blocked by any firewall which would affect connections inside your local area network.

−

−

Now start (or restart) xinetd:

−

<pre>

−

# /etc/rc.d/xinetd start

−

</pre>

−

−

Your scanner can now be used by other workstations, accross your local area network.

−

−

====Common problems with scanner sharing====

−

−

==== Accessing Your Scanner from a Remote Workstation ====

−

−

You can access your network-enabled scanner from a remote Arch Linux workstation.

−

−

To set up your workstation, begin by installing xsane:

−

<pre>

−

# pacman -S xsane

−

</pre>

−

−

Next, specify the server's host name or IP address in the /etc/sane.d/net.conf file:

−

<pre>

−

# static IP address

−

192.168.0.1

−

# OR /etc/hosts or DNS supported host name

−

stratus

−

</pre>

−

−

Now test your workstation's connection, from a non-root login prompt:

−

<pre>

−

$ xsane

−

</pre>

−

−

After a short while, xsane should find your remote scanner and present you with the usual windows, ready for network scanning delight!