Thomas' writings, builds, toys

2020-07-04

Networked USB scanner

Photo of Scanner

I have a USB connected flatbed scanner, a Canon CanoScan LiDE 110. I need to use it more frequently these days, and figured it would be handy if I connect it to my office-rpi and use it over the network.

Server configuration

sudo apt install sane-utils
sudo systemctl enable saned.socket
sudo systemctl start saned.socket

We also need to allow the scanner clients to access the daemon socket. I added this to /etc/sane.d/saned.conf:

192.168.2.1/24
[2a02::]/10

You can check if the saned user account can access the scanner by running:

sudo -u saned sane-find-scanner

The USB device node (at that time plugged at /dev/bus/usb/001/004 ) was missing the correct permissions. It turns out my scanner seems to be missing from the systemd hwdb at

/lib/udev/hwdb.d/20-sane.hwdb

I tried adding

usb:v04A9p1909*
 libsane_matched=yes

And running

sudo systemd-hwdb update
sudo udevadm trigger

Unfortunately that didn't solve the permission issue. For now I'm using chmod a+rwx on the devicenode whenever I need to use the scanner.

Client configuration

On my laptop, I added the hostname of the server to /etc/sane.d/net.conf When starting simple-scan (the GNOME scanner app), it connects and scans!