Differences between revisions 15 and 17 (spanning 2 versions)
Revision 15 as of 2015-05-01 10:03:43
Size: 2657
Editor: ?DamienCourousse
Comment: the backend 'net' needs to be activated on the client side
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 4: Line 4:
 <<TableOfContents(2)>>
= SANE over network =
== Server ==
Line 8: Line 5:
You will need to have the following packages installed: DebianPkg:sane-utils DebianPkg:libsane. In order to use a HP multifunction printer/scanner, make sure to also install the DebianPkg:hplip package. Sharing a USB or network scanner over a network with SANE.
Line 10: Line 7:
Make sure your scanner is recognised (your output will differ unless you have the same scanner ;) ) <<TableOfContents()>>
Line 12: Line 9:
~-{{{
% sane-find-scanner
found USB scanner (vendor=0x04a9 [Canon], product=0x220d [CanoScan], chip=LM9832/3) at libusb:002:006
<<Anchor(intro)>>
=== Introduction ===
Line 16: Line 12:
% scanimage -L
device `plustek:libusb:002:006' is a Canon N670U/N676U/LiDE20 USB flatbed scanner
}}}-~
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 DebianPkg:systemd. On a machine with a scanner connected to a USB port (the [[#server|server]]), SANE with ''systemd'' is socket activated. The [[DebianMan:saned|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 [[#server|shared]] by the server to serve up an [[#client|image of a document]] to an application on a client.
Line 20: Line 14:
Once you can see your scanner make sure that the saned user is in the scanner group.
Note: In some situations it is necessary that the saned user also is in the lp group (place in secondary group)
A scanner which is network enabled with a cabled or wireless connection (a network scanner) is accessed with the help of DebianPkg:libsane and one of its collection of [[Scanner|backends]]. libsane [[#aio1|interworks]] with the non-SANE, HP-provided [[#aio1|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.
Line 23: Line 16:
Make sure that /etc/default/saned includes <<Anchor(server)>>
=== Configuration of SANE on the Server ===
Line 25: Line 19:
~-{{{
# Set to yes to start saned
RUN=yes
}}}-~
 * First ensure the scanner is detected and scanning works from the server as described on [[Scanner|the Scanner wiki page]].
 * Install DebianPkg: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.
Line 30: Line 28:
You will also need to add the following line to /etc/inetd.conf
~-{{{
sane-port stream tcp nowait saned.saned /usr/sbin/saned saned
}}}-~
<<Anchor(client)>>
=== Configuration of SANE on the Client ===
Line 35: Line 31:
You will need to restart inetd for this to take affect: /etc/init.d/openbsd-inetd restart


Then add the relevant network addresses to /etc/sane.d/saned.conf
~-{{{
192.168.0.0/24
}}}-~

== Client ==

You will need to have the following packages installed: DebianPkg:sane-utils DebianPkg:libsane

You will need to add the ip/hostname of the sane server to: /etc/sane.d/net.conf

You will also need to add any users who need access to the scanner group

If everything is working correctly you should get something like this:
## You will need to have the following packages installed: DebianPkg:sane-utils DebianPkg:libsane
 * It is essential to install DebianPkg:libsane and, for testing the client's ability to see the network scanner, it is recommended to install DebianPkg:sane-utils. Success in detecting the shared scanner with [[DebianMan:scanimage| scanimage]] indicates probable success with other [[Scanner#front|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:
Line 57: Line 41:
== Troubleshooting == <<Anchor(aio1)>>
=== Scanning with a Network HP all-in-one (aio)-1 ===
Line 59: Line 44:
=== The network scanner in not detected ===
Check that the backend 'net' is activated on the client side, in the file /etc/sane.d/dll.conf.
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 62: Line 46:
=== HP OfficeJet network printer is not detected === {{{
hpaio:/net/<aio_model_name>?ip=<IP_address_of_the_aio>
}}}
Line 64: Line 50:
A HP network printer e.g. HP !OfficeJet (connected via LAN/WLAN) may not be detected by `scanimage -L` even if it is correctly configured for printing. 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
Line 66: Line 52:
According to a [[http://lists.alioth.debian.org/pipermail/sane-devel/2009-February/024117.html|post on the sane mailing list]] the printer has to be configured differently in [[CUPS]] using HPLib and a URL of the following style, instead of connecting via socket or IPS: {{{
/usr/bin/lpinfo -v
}}}
Line 68: Line 56:
~-{{{
hp:/net/Officejet_6500_E709n?ip=192.168.0.52
}}}-~
Install [[DebianMan: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 [[http://tldp.org/LDP/abs/html/aliases.html|alias]] sufficient.

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

<<Anchor(aio2)>>
=== Scanning with a Network HP all-in-one (aio)-2 ===

Many users will configure an HP aio machine with DebianPkg:hplip, which sets up the printing side of the device. Scanning should now be automatically available, as explained by a [[http://lists.alioth.debian.org/pipermail/sane-devel/2009-February/024117.html|user on sane-devel]] and by an [[http://hplipopensource.com/node/211|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 [[PrintQueuesCUPS#hplip|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 WikiPedia: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, [[#server|sharing a network HP aio scanner]] is not possible due to bugs DebianBug:807427 and DebianBug:838212. Network scanners from other vendors might work in sharing mode though.

=== Inetd Configuration ===

An alternative to [[#intro|systemd socket activation]] is to use DebianPkg:openbsd-inetd. Install it, take a look at ''/etc/default/saned'' and run

{{{
update-inetd --enable sane-port
}}}

=== See also ===

[[Scanner|USB scanner configuration]]

=== Finally ===

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


#######################################################
#################### END OF WIKI PAGE #################
## Portions of the original page are below, together ##
### with comments on why they were altered, removed ###
########## or restructured. (Brian Potkin) ############
#######################################################

###### Covered by the brief description at the top of the page.
##== SANE over network ==

###### Setting a USB scanner is covered on the Scanner page. No need to repeat here.
## You will need to have the following packages installed: DebianPkg:sane-utils DebianPkg:libsane. In order to use a HP multifunction printer/scanner, make sure to also install the DebianPkg:hplip package.
##Make sure your scanner is recognised (your output will differ unless you have the same scanner ;) )
##~-{{{
##% sane-find-scanner
##found USB scanner (vendor=0x04a9 [Canon], product=0x220d [CanoScan], chip=LM9832/3) at libusb:002:006
##% scanimage -L
##device `plustek:libusb:002:006' is a Canon N670U/N676U/LiDE20 USB flatbed scanner
## }}}-~

###### Treated in server section.
## Once you can see your scanner make sure that the saned user is in the scanner group.

###### Are there any grounds on which to add the saned user to the lp group?
## Note: In some situations it is necessary that the saned user also is in the lp group (place in secondary group)
## ~-{{{
## # Set to yes to start saned
## RUN=yes
## }}}-~

##### Restructured in inetd config section.
##You will also need to add the following line to /etc/inetd.conf
##~-{{{
##sane-port stream tcp nowait saned.saned /usr/sbin/saned saned
##}}}-~

##You will need to restart inetd for this to take affect: /etc/init.d/openbsd-inetd restart

###### This is not correct, AFAICT. (BrianPotkin)
## You will also need to add any users who need access to the scanner group

###### Unneeded. It is now specified in the client configuration.
## === Troubleshooting ===

## === The network scanner in not detected ===
##Check that the backend 'net' is activated on the client side, in the file /etc/sane.d/dll.conf.

###### Link to essential content in this section in another section.
## === HP OfficeJet network printer is not detected ===

## A HP network printer e.g. HP !OfficeJet (connected via LAN/WLAN) may not be detected by `scanimage -L` even if it is correctly configured for printing.

## According to a [[http://lists.alioth.debian.org/pipermail/sane-devel/2009-February/024117.html|post on the sane mailing list]] the printer has to be configured differently in [[CUPS]] using HPLib and a URL of the following style, instead of connecting via socket or IPS:

## ~-{{{
## hp:/net/Officejet_6500_E709n?ip=192.168.0.52
## }}}-~

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.