Transition your old USB-Printer to a Network printer with scanning capabilities
Equipment Decisions
Single Board Computer (SBC)
Installing the Operating System
Flash the image
Documentation based on NanoPi NEO3 - FriendlyELEC WiKi, flash the image according to the documentation. I was also using the Win32DiskImager, available from
First Login, Change Password and Updates
The image is configured to use DHCP. The device will get an IP automatically. Since it does not have any display, it cannot show it to you. To find the device in your network, you have two options
- Check your router and find the device in the DHCP leases list
- Use a Network Scanner, which finds all devices by ennumerating all possible IP addresses
I'm using Advanced Port Scanner – free and fast port scanner (advanced-port-scanner.com) to find the device, which was found under the name "NanoPi-NEO3".
It has SSH enabled, and comes with two logins, as below. For both you should immediately change their password.
- Guest Login: User pi, Password pi
- Root Login: User root, Password fa
Change Password
sudo passwd root
sudo passwd pi
Updates & Nano Editor
Update and Upgrade, should always be your second command after changing passwords. We will also install the plaintext editor nano, which makes it easier to edit files than vi.
sudo apt-get update
sudo apt-get upgrade
sudo apt-get autoremove
sudo apt-get install nano
Change from DHCP to fixed IP
As the device becomes a server, we should assign it a fixed ip. This can be done by editing the file /etc/network/interfaces.d/eth0.
sudo nano /etc/network/interfaces.d/eth0
Here is an example with my network configuration
auto eth0
allow-hotplug eth0
iface eth0 inet static
address 192.168.1.15
netmask 255.255.255.0
gateway 192.168.1.1
sudo shutdown -r now
It should not take more than 1 min until you can connect to the device again.
Turn it into a printer server with CUPS
CUPS Installation
- Install cups sudo apt-get install cups
- Start cups with sudo systemctl start cups
- Enable auto start with sudo systemctl enable cups
- Adjust configuration in /etc/cups/cupsd.conf
- Enable Browsing, turn Browsing Off to Browsing On
- Change Web interface binding from Listen localhost:631 to Port 631
- Add Allow @LOCAL to the web directories /(root folder) and /admin
- Restart cups sudo systemctl restart cups
Yay, CUPS is ready to work for us! |
CUPS will almost certainly not automatically detect your printer. I order to make that happen you need drivers.
Install Drivers
Find your Printer Name
auto eth0
[ 498.977794] usb 4-1: new high-speed USB device number 2 using xhci-hcd
[ 499.124867] usb 4-1: New USB device found, idVendor=04a9, idProduct=176d, bcdDevice= 2.03
[ 499.124879] usb 4-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 499.124886] usb 4-1: Product: MG2500 series
[ 499.124892] usb 4-1: Manufacturer: Canon
[ 499.124899] usb 4-1: SerialNumber: 840A8C
[ 499.224748] usblp 4-1:1.1: usblp0: USB Bidirectional printer dev 2 if 1 alt 0 proto 2 vid 0x04A9 pid 0x176D
[ 499.225500] usbcore: registered new interface driver usblpou are not sure what values to be u
Home page of the CUPS administration |
Select the option "Add Printer" to start the add printer wizard. In the first page of the wizard, you will find your printer (see below)
Wizard to add a new printer to CUPS |
Feel free to customize the name of the printer, or change default settings. You can always change this settings later again. After completion, navigate to the printer maintanance and select "Test Page" from the menu to confirm that everythins is working as expected.
Print test page option for newly installed printer |
After completion, your printer is ready and available in the network and can be found from any major devices and operating systems (Windows, Mac, Android, iPhones). Typically you go to their settings and find new printers. They will install automatically. For mobile phones, you can select from the print dialog to print on network printers, just make sure you are in the same WiFi.
In case it cannot be found
sudo apt install avahi-daemon
sudo systemctl start avahi-daemon
sudo systemctl enable avahi-daemonallow-hotplug eth0
Add Scanning Capabilities
- Scan to E-Mail
- Scan to Network share
- Scan to Scanner Web UI
Let's install the backend: SANE
sudo apt install install sane
> sane-find-scanner
# sane-find-scanner will now attempt to detect your scanner. If the
# result is different from what you expected, first make sure your
# scanner is powered up and properly connected to your computer.
# No SCSI scanners found. If you expected something different, make sure that
# you have loaded a kernel SCSI driver for your SCSI adapter.
# Also you need support for SCSI Generic (sg) in your operating system.
# If using Linux, try "modprobe sg".
found USB scanner (vendor=0x04a9 [Canon], product=0x176d [MG2500 series]) at libusb:004:006
# Your USB scanner was (probably) detected. It may or may not be supported by
# SANE. Try scanimage -L and read the backend's manpage.
# Not checking for parallel port scanners.
# Most Scanners connected to the parallel port or other proprietary ports
# can't be detected by this program.
scanimage > image.jpg --format jpeg
And the Frontend: ScanServJs
curl -s https://raw.githubusercontent.com/sbs20/scanservjs/master/packages/server/installer.sh | sudo bash -s -- -a
- Scan to PDF including text extraction with Tesseract!
- Black & White, Greytone, Colour modes
- Preview to set the correct margins
- Download previous scans / delete them
Comments
Post a Comment