Yesterday I wrote about working from home with your Raspberry Pi, and talked about things like how to connect to your company VPN, and how to get video conferencing up and working. However, one thing I didn’t talk about – and that many of you have asked for some guidance on – was printing.
To get printing up and working on your Raspberry Pi the first thing you need to do is install CUPS. CUPS is an open source printing system developed by Apple that uses the Internet Printing Protocol (IPP) to support printing to both local and network printers.
Go ahead and open a terminal window, and install CUPS.
$ sudo apt-get install cups
CUPS has a lot of dependencies, so depending on your broadband connection installation, it could take a while. If you have any left in the house, now might be a good time for a cup of coffee ☕.
After installation you’ll need to give the pi user administrative rights on CUPS. To do this, go back to your console and type
$ sudo usermod -a -G lpadmin pi
to make the pi user part of the lpadmin group.
Adding a printer
Now open up your browser and navigate to https://localhost:631 . You’ll receive a security warning from your browser. Hit the ‘Advanced’ button and then ‘Proceed to localhost (unsafe)’.
You’ll be presented with the CUPS interface. Click on ‘Administration’ in the top bar, and a drop-down will appear. Authorise yourself to CUPS as the pi user, which we’d added to the administrator group earlier.
After you authorise yourself, click on the ‘Add Printer’ button. CUPS will then look for locally connected (via USB) printers as well as any networked printers it can see on your home network.
For a lot of printers you’ll be presented with a number of possible options, as most modern printers offer a number of ways to connect. So depending on which printer you have, you might need to go through the process of adding a printer a couple of times to figure out the best method to connect.
I have a Brother HL-3140CW, an older model colour laser printer. While Brother offers Linux drivers, they are compiled for the x86 rather than ARM architecture, and the open source ‘brlaser’ driver doesn’t support my model. However, CUPS does list a ‘driverless’ option for communicating without a native printer driver using the Internet Printing Protocol (IPP).
Picking this option, I was presented with a list of drivers for the printer. I picked IPP Everywhere from the list, and hit the ‘Add Printer’ button.
After a few seconds CUPS should present you with the ‘Printers’ tab, which should show you your connected printer. If everything is okay it should show that the printer is ‘Accepting Jobs’.
Testing the printer
Now we have our printer set up we need to test it. Go ahead and open LibreOffice Writer from the start menu, and enter some test text.
Then click on ‘File > Print’ in the LibreOffice Writer menu.
If everything has gone smoothly your printer should start making appropriate printing noises and should print your test document.
I actually went ahead and printed two test documents just to be sure colour printing was working okay, and happily it was working just fine!
The exact process you’re going to go through to get your printer working will depend heavily on which printer you own. The trickiest bit is always going to be drivers. Thankfully, these days things are a lot easier than they used to be, as most printers – especially networked printers that live on your wireless network – offer standard ways to print and you don’t necessarily have to rely on a native (manufacturer-provided) driver any more.