Raspberry Print Server for Brother QL-500 Label Printer
My Brother QL-500 label printer is attached to a Raspberry Pi and I use it with my Label Creator Software and that's fine most of the time.
But sometimes I need to print something else to a label sticker. Case in point this time: I bought a bunch of stamps from the German Postal Service through their website.
So how do I access the printer from my desktop computer without having to unplug it from the Raspberry? I need a print server obviously.
Share the Printer without CUPS
When you look up “print server rasbian” you will find hundreds of tutorials that will tell you to install CUPS.
CUPS is all fine and dandy for a regular printer, but for the label printer we need as few intermediates between our application and the printer as possible. Otherwise printing will either outright fail or you will have a super hard time getting print margins and pages sizes correct. But really it will most probably just not work.
What we want is basically connecting a network socket to the raw USB printer device. Luckily HP invented something like that about a million years ago and dubbed it “JetPrint”. AFAIK it's also known as “app socket” or simply as “raw mode”.
Setup is super easy, once you know about it. First install the p910nd
daemon:
apt install p910nd
Next, edit the config and have it point to your USB printer. Don't forget to actually enable the daemon in the last line.
- /etc/default/p910nd
# Printer number, if not 0 P910ND_NUM="" # Additional daemon arguments, see man 8 p910nd P910ND_OPTS="-f /dev/usb/lp0" # Debian specific (set to 1 to enable start by default) P910ND_START=1
Finally (re)start the service:
systemctl restart p910nd.service
That's it. The printer can now be accessed on port 9100
.
Setup the QL-500 on Windows 10
Next we want to use the Label Printer from a Windows machine (because again, that's probably closest to what Brother intended the printer to be used with). But you should also be able to access the JetDirect shared printer from your local CUPS system on Linux.
Open the settings and go to the printer panel. Then follow these steps:
- Add a printer or scanner
- The printer that I want wasn't listed
- Add a printer using a TCP/IP address or hostname
- Device Type: TCP/IP Device
- Hostname or IP Address: IP address of your Raspberry Pi
- Port name: IP address of your Raspberry Pi
- uncheck Query the printer and automatically select the driver to use
- (wait for whatever Windows is doing now)
- Device Type: Custom
- Settings…
- Protocol: Raw
- Port Number: 9100
- Pick the Brother → QL-500 driver
- the rest is pretty self explanatory
The printer is now added. But you're not done yet. We want to remove the Windows print queue sitting between us and the printer.
- Select the new printer
- Manage
- Printer Properties
- Advanced
- check Print directly to the printer
Printing Stamps
It's finally time to print the stamps. Deutsche Post offers various formats when buying stamps online. One is “Brother DK-22205 Endlos-Etikett 62 mm” which is one of the rolls I have available. The resulting download is a PDF where each “page” is 62x37mm in size.
When printing, you should pick the “Print using System Dialog” option. Select the printer and click the Preferences button. Use the appropriate width, 62mm in my case and enter the length, 37mm for me.
And that should be all to finally print those damn stamps. Easy, eh?