Brother HL-2140 on Linux and Raspberry Pi Print Server
This blog in the past few days has been a collection of “I had this problem and couldn’t easily find an answer, so maybe I can repost it and have somebody find the help they need.” Today is no exception.
My Raspberry Pi project is underway, and last night’s adventure was getting the AirPrint to work with my Brother HL-2140. Yeah, it’s an older printer, but it sure beats the heck out of spending more money. Print quality is still decent. Besides, I bought the printer when I was in a dorm room in 2008, and 8 years later it’s still working through its first toner cartridge. You can’t beat that kind of lifespan!
Installing and configuring CUPS to share the printer was easy, but the problem was that the drivers for the printer didn’t actually work. To Google I went! The easiest answer looked like it was going to be simple! Download a package from Brother’s website, type in the model number, and it will automatically configure and install drivers. Nope! That didn’t work. Back to Google we go! The Open Printing website had a PPD file for the printer. Downloaded and configured it was time for a test print. I had blinking lights on the printer, but no actual printing action. So what actually clued me in? A page on the Ask Xmodulo website.
As it turns out the PPD file from Open Printing was the correct file, I just needed to pair it with another driver available from the apt-get repository. So, here’s what I did (without the failed steps!) from start to finish.
- Followed the instructions at Lynsay’s Little World. Her guide was phenomenal and made everything incredibly easy to setup.
- Logged into CUPS on the Raspberry Pi from a web browser at http://192.168.1.3:631 and added the printer. When it comes time to choose a driver, choose this PPD file from the Open Printing website.
- Back on the Raspberry Pi’s terminal install the package printer-driver-hpijs by running this command:
sudo apt-get install printer-driver-hpijs
- Restart the CUPS service.
sudo /etc/init.d/cups restart
At this point you should be able to do a test print out of CUPS and have it spit out some real printed materials!
I hope this guide helps you! If it does, let me know on Twitter!