It turns out, even old scanners has a function in the modern era, thanks to our brothers and sisters at the SANE project.
They pretty much saves the day if you don’t want to have a dedicated Windows PC just for scanning or printing every once in a while. As the world shifts to the full digital age, it’s less and less common to perform these tasks.
But as we all know; when you need the old hardware to work, you need it badly. Printers are not famous for being very trustworthy or stable. Because after all, the manufacturers make money on the ink and not on good hardware. It’s a perfect study-case for a tiny Raspberry Pi, as these tasks don’t require much horsepower.
Even though you have one device for both scanner and printer, they are separate things. Nowadays multi-function boxes like this is pretty common, but the software is still pretty different for scanning and printing. Remember; the official Windows drivers and software are separate.
This article is for the scanning part
First and foremost, this is a setup that works both for LAN connection and USB connection as I figured out for this particular scanner, Canon LiDE 700F. You should just try with LAN if you are doing this with a network enabled device, then try USB if it’s doesn’t work.
Server – Raspberry Pi
PLEASE NOTE: This section assumes that you’ve already configured your Raspberry Pi or that you know how to do this.
Most of the Linux distros have SANE in their main repositories. To install, type:
sudo apt install sane-utils -y
Detect the scanner
Lan Connection Result:
device `genesys:libusb:001:003-wired’ is a Canon XXX flatbed scanner
If you do not get a similar response (replace “Canon XXX” with the model number that you are working with), check if you can PING your device’s IP. If you do get an ECHO response, try connect to the device via your browser.
Some Canon units have a setting under “Other Settings” and certain settings might need to be enabled there. Please refer to your Canon documentation, or drop a comment with your query.
USB Connection Result:
device `genesys:libusb:001:003′ is a Canon LiDE XXX flatbed scanner
If you do not get a similar response (replace “Canon XXX” with the model number that you are working with), try using the lsusb command to see if the unit was picked up by the USB ports:
Bus 001 Device 003: ID 04a9:1907 Canon, Inc. CanoScan XXX
If lsusb does not list a scanner, try the sane scanner finder:
A typical result will look like this:
found USB scanner (vendor=0x04a9 [Canon], product=0x1907 [CanoScan], chip=XXX) at libusb:001:003
If a scanner cannot be found nor detected, please check the physical cables to ensure that they are connected.
Test the scanner on the “server”
Providing scanimage -L returned a result, we can test the scanner by typing in terminal:
scanimage > test.ppm
You should be able to view the test with any image viewer. scanimage is easy to use from the terminal and has several options, please see the scanimage -h for all of the control options like resolution, colours etc.
Share the scanner over the LAN
It’s time to share the scanner over the network!
sudo nano /etc/sane.d/saned.conf
Find the line that contains the line below and uncomment it:
The above uncommented line will allow all addresses from the 192.168.1.1-192.168.1.254 range. You could restrict this to a single IP address or multiple IP addresses, depending on who needs access or how your network is set up.
Please note: The default port that is used to serve incoming connections is 6566
To start the socket service (providing you use systemd), type:
sudo systemctl start saned.socket
To start it up when the system starts, type:
sudo systemctl enable saned.socket
Looking for a Graphical Scanner Client?
If you’re looking for a decent GUI client for your scanner, I’d suggest you run with “gscan2pdf“.
To install the client, type in:
sudo apt install gscan2pdf