Differences between revisions 16 and 17
Revision 16 as of 2017-08-14 16:22:05
Size: 9405
Editor: Brian Potkin
Comment: Use the same layout as the Scanner wiki page. Many small changes, updates and corrections to fit Debian 8 and 9.
Revision 17 as of 2017-08-17 13:02:28
Size: 9530
Editor: Brian Potkin
Comment: Mention plugin. Added "See Also".
Deletions are marked like this. Additions are marked like this.
Line 44: Line 44:
To scan over the network from a scanner on an HP aio (one which is not connected to a computer) you only need to install DebianPkg:libsane-hpaio (without its recommended packages) and pass the WikiPedia:URI of the scanner to the [[Scanner#front|frontend]]. The format of the URI is: To scan over the network from a scanner on an HP aio (one which is not connected to a computer) you need only to install DebianPkg:libsane-hpaio (without its recommended packages) and pass the WikiPedia:URI of the scanner to the [[Scanner#front|frontend]]. This assumes a [[Scanner#aio|non-free plugin]] is not required. The format of the URI is:
Line 131: Line 131:
=== See also ===

[[Scanner|USB scanner configuration]]

Translation(s): English - Français - Italiano


Sharing a USB or network scanner over a network with SANE.

Introduction

This page is written principally in the context of a user with Debian 8 (jessie) or Debian 9 (stretch) installed. Both distributions have an init system (the first process started during booting of the computer and which governs its subsequent behaviour) based on systemd. On a machine with a scanner connected to a USB port (the server), SANE with systemd is socket activated. The saned daemon is started when a request is received on the server from a client and is stopped when the request is fulfilled. This forms the basis for a scanner shared by the server to serve up an image of a document to an application on a client.

A scanner which is network enabled with a cabled or wireless connection (a network scanner) is accessed with the help of libsane and one of its collection of backends. libsane interworks with the non-SANE, HP-provided hpaio backend. Other vendors also provide a means to access a network scanner, but there is generally a non-free aspect to what they offer so configuration of their devices is not treated on this page.

Configuration of SANE on the Server

  • First ensure the scanner is detected and scanning works from the server as described on the Scanner wiki page.

  • Install sane-utils to get saned.

  • Check that the contents of /etc/default/saned fit the system and that saned is in the scanner group. No changes need be made to this file for the vast majority of users.

groups saned
  • Add the hostnames, IP addresses or IP subnets that are permitted to use local SANE devices on the server in /etc/sane.d/saned.conf.

  • The server will now be sharing the USB connected scanner with other designated machines on the network.

Configuration of SANE on the Client

  • It is essential to install libsane and, for testing the client's ability to see the network scanner, it is recommended to install sane-utils. Success in detecting the shared scanner with scanimage indicates probable success with other frontends.

  • Uncomment the net backend entry in /etc/sane.d/net.conf.

  • Add the IP address/hostname of the sane server to /etc/sane.d/net.conf.

  • If everything is working correctly you should get something like this:

% scanimage -L
device `net:192.168.0.100:plustek:libusb:002:006' is a Canon N670U/N676U/LiDE20 USB flatbed scanner

Scanning with a Network HP all-in-one (aio)-1

To scan over the network from a scanner on an HP aio (one which is not connected to a computer) you need only to install libsane-hpaio (without its recommended packages) and pass the URI of the scanner to the frontend. This assumes a non-free plugin is not required. The format of the URI is:

hpaio:/net/<aio_model_name>?ip=<IP_address_of_the_aio>

The IP address could be known from the way the aio's networking was set up, or it could be got from the aio's front panel or deduced from the output of

/usr/bin/lpinfo -v

Install nmap. The model name can be found from the Service Info: line in the output of

nmap -sV <IP_address>

A portion of a typical output is:

Nmap scan report for 192.168.7.235
Host is up (0.049s latency).
Not shown: 994 closed ports
PORT     STATE SERVICE    VERSION
80/tcp   open  http       HP ENVY 4500 series printer http config (Serial CN56G332DT060D)
443/tcp  open  ssl/http   HP ENVY 4500 series printer http config (Serial CN56G332DT060D)
631/tcp  open  http       HP ENVY 4500 series printer http config (Serial CN56G332DT060D)
8080/tcp open  http       HP ENVY 4500 series printer http config (Serial CN56G332DT060D)
9100/tcp open  jetdirect?
9220/tcp open  hp-gsg     HP Generic Scan Gateway 1.0
Service Info: Device: printer; CPE: cpe:/h:hp:envy_4500_series

The URI of the scanner would then be

hpaio:/net/envy_4500_series?ip=192.168.7.235

and a frontend can be started with (for example):

simple-scan <URI>

Typing the URI each time can be avoided by exploring what your DE (Desktop Environment) offers for customising a command. For typing from a terminal you might find a simple alias sufficient.

hplip provides the utility hp-makeuri if it is wished to bypass the previous technique for finding a URI.

Scanning with a Network HP all-in-one (aio)-2

Many users will configure an HP aio machine with hplip, which sets up the printing side of the device. Scanning should now be automatically available, as explained by a user on sane-devel and by an hplipopensource troubleshooting page. Simply typing the name of a favourite frontend or clicking on a menu entry should be sufficient to run the application:

simple-scan
xsane
xscanimage

The URI to pass to the frontend is obtained from the printer URI by replacing hp:/.... with hpaio:/.....

Recent aios (since 2010) will probably come with AirPrint. When activated, the URI of the scanner is formed from the mDNS broadcasts and, without setting up the printing function of the aio, the scanner should be detected by

scanimage -L

and the frontend should run after doing

xsane
simple-scan
xscanimage

Unfortunately, sharing a network HP aio scanner is not possible due to bugs 807427 and 838212. Network scanners from other vendors might work in sharing mode though.

Inetd Configuration

An alternative to systemd socket activation is to use openbsd-inetd. Install it, take a look at /etc/default/saned and run

update-inetd --enable sane-port

See also

USB scanner configuration

Finally

Do not forget to read the Debian documentation in /usr/share/doc/sane-utils.