Setup a shared scanner
mouse 620 · person cloud · link
Last update
2019-08-21
2019
08-21
« — »
1
2
3
4
5
6
7
8
9
10
11
12
apt-get install sane sane-utils

scanimage -L # check if a local scanner is found

# add hostnames and/or IP addresses/subnets
pico /etc/sane.d/saned.conf # eg: localhost, 127.0.0.1 and 192.168.1.0/24

# enable local users to see the scanner
adduser username scanner

systemctl enable saned.socket
systemctl start  saned.socket

Configure a client host:

1
2
3
4
# edit /etc/sane.d/net.conf:
#   - uncomment the net backend entry
#   - and add the IP address/hostname of the sane server
scanimage -L # check the remote scanner is found

On windows you can use SaneTwain, on Android the SaneDroid app.

Note: If your sane-utils < 1.0.25 is broken under systemd, fix it with these steps:

1
apt-get install libsystemd-dev

In /lib/systemd/system/saned@.service set StandardInput/Output/Error=socket and append Alias=saned.service to [Install] section:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
# /lib/systemd/system/saned@.service
[Unit]
Description=Scanner Service
Requires=saned.socket

[Service]
ExecStart=/usr/sbin/saned
User=saned
Group=saned
StandardInput=socket
StandardOutput=socket
StandardError=socket
Environment=SANE_CONFIG_DIR=/etc/sane.d
# Environment=SANE_CONFIG_DIR=/etc/sane.d SANE_DEBUG_DLL=255

[Install]
Also=saned.socket
Alias=saned.service
1
2
3
systemctl daemon-reload
systemctl enable  saned.socket
systemctl restart saned.socket

Source: debian wiki, std* fix