Free Domestic Shipping on Orders Over $100!

Using the Raspberry Pi as a Print Server for a Dymo 4XL Label Printer

by Craig L September 02, 2014 3 Comments

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!




Craig L
Craig L

Author


3 Responses

Kent
Kent

March 20, 2017

Your link is bad, but thankfully a little Googling fixes all.
http://www.dymo.com/en-US/dymo-label-sdk-and-cups-drivers-for-linux-dymo-label-sdk-cups-linux-p—1#

Thanks for the great write up, I’ve just ordered mine and will be setting it up like this over the weekend.

Adam
Adam

April 02, 2016

I had issues getting the printer working on Mac, too. I figured the problem was the Mac was trying to use the driver from the Pi which was compiled on the Pi, but we need the Mac driver, which is slightly different in the configuration file.

Once you have the DYMO Label software installed on the Mac (which also installs the printer drivers). Also, go ahead and add the printer via System Preferences, but don’t try to use it in DYMO quite yet.

Now you will need to do the following in Terminal on the Mac to enable the CUPS web interface (yes, Mac also uses CUPS in the background):
cupsctl WebInterface=yes

Next, you will need to find the Mac printer driver for your printer model. In Finder, press Cmd + Shift + G and paste the following followed by Return (enter):
/Library/Printers/PPDs/Content/Resources/

In that folder, find your model number. For the Label Manager 280, the file is lm280.ppd.gz. For Label Writer 4 XL, it is lw4xl.ppd.gz. I have a Label Writer 450 Twin Turbo, so I needed lw450tt.ppd.gz. Copy this file somewhere, as you cannot write to that folder without privilege escalation. The Desktop works.

Once you have the file copied, double-click the copy to unarchive it. You’ll end up with a file with the same name, less the .gz at the end.

Now, open CUPS through the web interface by going to this address in a web browser on the Mac:
http://localhost:631

Go to Administration at the top. You’ll be prompted for a username and password. Use your login name. Not your displayed name, but your system name. To get this, go to terminal and type the command “whoami” and press enter. The result is the name you need to use.

The password is just your regular account password for logging into the Mac.

Click “Manage Printers”, which is the third button in the top left section.

On that page, click your printer name under the “Queue Name” column.

Then in the dropdown just above “Description” that says “Administration”, select “Modify Printer”.

On the first screen, it defaults to the connection to that printer. Just click “Continue” at the bottom.

The description can stay the same, unless you doh’t like how it’s named in System Preferences. Here’s where you can change the name that shows in System Preferences without having to re-re-install the printer. Rename if desired, then click “Continue”.

At this step, you tell the print system exactly which drive you want. You’ll need that file you uncompressed. Near the bottom of the page, click the “Choose file” button next to “Or Provide a PPD file.” Navigate to the location where you moved and uncompressed the driver file, and select the uncompressed version (the one without .gz at the end).

Now click “Modify Printer” and it should work. Once this is done, you shouldn’t have to do it again unless you remove the printer in System Preferences.

Optionally, when you’re done, you can turn the CUPS web interface back off by using the below command in the Terminal, but I personally prefer to leave it active, as it’s much more versatile for changing printer settings that you don’t even have access to in System Preferences:
cupsctl WebInterface=no

Repeat this process for each DYMO product connected to the Pi.

Prescott Paulin
Prescott Paulin

August 07, 2015

This is extremely helpful! We are looking to build a warehouse application that connects to our server running on Amazon AWS… this seems to be a good fix so that our inventory management system will automatically be able to print inventory labels for our parts.

Leave a comment

Comments will be approved before showing up.


Also in News

Our new location

by Craig L August 10, 2017

Continue Reading

VM-CLAP1 👏 sensor + gpiozero on Raspberry Pi

by Stewart Russell June 19, 2017

Continue Reading

Lower International Shipping Rates!

by Craig L June 14, 2017

Continue Reading