2020-08-24

I turned my Raspberry Pi 4 into a network services host this weekend. This post deals with setting up a Windows printer as a network printer.

Motivation

We purchased a Brother HL-2400 printer for the family desktop a few years ago. I knew it was a Windows only, and did not care since the family desktop is always a Windows based machine. It is used for printing school assignments, doing taxes, and scanning with a ScanSnap 500. Unfortunately, Windows is not a good platform for sharing a printer when the CPU is suspended.

Use a Raspberry Pi

They are cheap, reliable, and I picked up a Pi 4 last year. I intended to use it as a web gateway for the family website and communication gateway. I searched and found that it was an ideal server platform. We run an aging Buffalo NAS that really needs to be retired and Windows printers are supported on modern Ubuntu.

Setup CUPS

CUPS is an open standards printing system originally developed by Apple for Unix printing. It uses Internet Printing Protocol to make printers available on Internet Protocol networks. So, SSH into the Pi.

Install CUPS
$ sudo apt-get install --no-install-recommends cups
$ sudo usermod -a -G lpadmin ubuntu

The ubuntu account is the login user created when I installed Ubuntu 20.4 on the Pi. I use this account for all administration.

If you can browse to https://<raspberry-pi>:631/ if the install worked correctly. I then followed the instructions to share the printer that I defined using CUPS to the internal network.

Sharing with Windows Clients

Windows 10 clients were having trouble connecting and printing to the shared printer. After you search for a printer, click on "The printer I want isn’t listed". Then add a printer using TCP/IP address or hostname.

I entered the IP address of my PI server. Note: I assigned this address as a static IP in my router. When you get to the Additional port information required dialog, click custom, then settings. You want to use the LPR protocol. Set the queue name to the name of the printer that you created in CUPS. Check the LPR Byte Counting box, seems to be important.

Add a driver if needed. Click through the rest of the prompts until you get a box allowing you to print a test page. Click that button. If you get a test page, congratulations. That is why I wrote this. If not, I found my way through this using DuckDuckGo. Good luck.