Using the Raspberry Pi as a Print Server for a Dymo 4XL Label Printer
So the bulk of our revenue comes from shipping product, so naturally we print a lot of labels!
The most cost effective way to print a lot of labels is to use a thermal printer, such as the Dymo 4XL. These printers use thermal transfer instead of ink, so you don't have to buy ink cartridges. They also use less paper than our previous method printing 8.5" x 5.5" labels via a laser printer.
Unfortunately, the Dymo does not play well with our Macintosh computers. We tried our trusty 2007 Macbook and 2013 Macbook Pro Retina, and the results were not good. In fact we spent 1.5 hours on the phone with the wonderful folks at ShipStation trying to get the Dymo to work. We ended up hooking it up to an old Windows laptop, and even then it was buggy. The printer would occasionally lock up and we would have to restart it....super frustrating!
So here we were with a $150 printer that was basically a paperweight. What to do!
Enter the Raspberry Pi. We sell a ton of Raspberry Pi systems and we also use them everyday for making SD cards, listening to Pandora, and more. So why couldn't we run one as a print server?
The first step was to install CUPS, which is the Common Unix Print Service. If you run a Mac, it is actually how printing works on your machine. Don't believe me? Go to localhost:631 and you will see the print server. Cool eh?
We found a great guide at howtogeek.com describing CUPS installation on the Pi, and we will just give you the highlights here:
- Run the following to make sure you have the latest packages: sudo apt-get update
- Run this to install CUPS. Note it might take a bit: sudo apt-get install cups
- Run this to make sure the user "pi" can access CUPS as an admin: sudo usermod -a -G lpadmin pi
- Run the following to make sure remote users can make changes to CUPS: sudo nano /etc/cups/cupsd.conf
- Change the text to say:
- # Only listen for connections from the local machine
# Listen localhost:631
Port 631 - Scroll further down in the config file until you see the “location” sections. In the block below, we’ve bolded the lines you need to add to the config:
< Location / >
# Restrict access to the server...
Order allow,deny
Allow @local
< /Location >
< Location /admin >
# Restrict access to the admin pages...
Order allow,deny
Allow @local
< /Location >
< Location /admin/conf >
AuthType Default
Require user @SYSTEM
# Restrict access to the configuration files...
Order allow,deny
Allow @local
< /Location >
- Restart CUPS by issuing the following: sudo /etc/init.d/cups restart
- You should now be able to access the print server on any local computer by typing http://{raspberry pi's IP address}:631
So now that you have CUPS installed, here comes the fun part. You have to compile the drivers for the Dymo label printer. It actually isn't that scary and it worked for us on the first try!
- First, download the Dymo SDK for Linux. You will end up with a Tarball, we recommend putting the tarball into the /home/pi directory and extracting it via the tar -xvf command
- Next, cd into the new directory
- We recommend checking out the install instructions by typing: more INSTALL
- Then run: sudo ./configure which will configure the install script for the printer
- Then build the drivers by typing: sudo make
- And once that's done, install the driver by typing: sudo make install
So now that you have the driver for the Dymo created, you can install the printer in CUPS.
Our pi is at 192.168.0.140, so please change the IP address for your own network.
First, point your web browser at your new Raspberry Pi print server:
At this point you want your Dymo connected to your Pi and turned on.
Then, click Administration and Add New Printer. Note that you should be prompted to login at this point, use your Raspberry Pi login. Likely username: pi, and hopefully a password better than "raspberry"
You should now see the Dymo listed as a local printer. If not, you should make sure it is powered on and that it is connected.
You can now name the Dymo as you wish. Make sure to check the box for "share this printer" assuming you want other users on your network to use it.
Now, assuming you installed the driver correctly, you should see Dymo as a choice for manufacturer. Then just pick the appropriate Dymo driver and you are good to go!
Now would be a great time to play around in CUPS and get comfortable with it. If you click Administration->Manage Printers->{whatever you named your Dymo}, you can get a good idea of what you can do in CUPS.
This would also be an excellent time to print a test page! Just click the drop down on the left side (default is Maintenance) and then select "Print Test Page"
So hopefully this is all you have to do to get the printer working. Test it by adding the printer to another computer. The printer's network location will be https://192.168.0.140:631/printers/DYMO_LabelWriter_4XL or something along those lines, naturally replace 192.168.0.140 with your Pi's IP address.
Note that after all this, we actually _still_ had problems using the Mac Dymo driver on our remote computer when we were printing our ShipStation labels. We ended up creating a workaround that has the Pi running a Samba server and then has a daemon monitoring a directory for new files. We then wrote a script that tells the Pi to print whatever PDF file gets dropped in that directory, and then just saved our ShipStation labels to that directory. Kind of a PITA, but it works flawlessly now!
Comments
Leave a comment