STAR TSP 100 thermal printer with CUPS
19 May 2024
First things first we need the source code to build the CUPS filter and ppd
file. The filter takes the raster format and converts it to a Star futurePRNT format, whereas a PPD file is a PostScript Print Descriptor file, which contains PostScript capabilities, and importantly, options and configurations for the printer.
Unbelievably, both can be downloaded and built from source from the manufacturer. Unfortunately, you can't just download the Linux source code. So although you only need about 1.4MB of files, you have to download a 400MB tarball that contains Java Drivers for their Point of Sales (POS) systems, the windows and macos drivers, various software manuals in various translations, and more.
Some additional things to know: STAR futurePRNT technology and all of it's gimmicks only exists in a Windows world. To the Linux user, the printer is only a raster printer, which means it knows nothing about fonts or PostScript or anything else; it can only print rastered data. Thanks to various device and software abstractions, however, we can practically use a thermal printer just like any other printer, though with some quirks associated to weird paper layouts.
Pre-requisites
We'll need CUPS, which is likely easiest to install through your distribution's package manager thanks to its ubiquity. There's a good chance you might already have it installed if you've ever printed anything.
We can use the ppdi
command that comes with CUPS to install the PPD file for the STAR printer.
Building the driver
Download and extract the driver tarball. Then navigate down through to
Linux/CUPS/Star_CUPS_Driver-3.12.0_linux/SourceCode/Star_CUPS_Driver
extracting tarballs as you go. A simple make
command in this directory should do everything we need it to do, and create an install
directory. It builds and copies more than we need, so we can manually install a subset with
cp rastertostar /usr/lib/cups/filter/
ppdi ./tsp143.ppd
The /usr/lib/cups/filter/
directory should be the standard place to install CUPS filters, but check for your distribution. If all worked, the following command should list the PPD driver we just installed:
$ lpinfo -m | grep tsp
lsb/usr/cupsfilters/tsp143.ppd Star TSP100 Cutter
Adding the printer as a CUPS device
Connect the printer and power on the device. lpinfo -v
should list all printer sources your computer knows about, and under usb
you should see your STAR printer
$ lpinfo -v | grep usb
direct usb://Star/TSP143%20(STR_T-001)
To add a new printer device, run
lpadmin -p STAR -E \
-v 'usb://Star/TSP143%20(STR_T-001)' \
-m 'lsb/usr/cupsfilters/tsp143.ppd'
This command will likely print a deprecation warning:
lpadmin: Printer drivers are deprecated and will stop working in a future version of CUPS.
We can just ignore this. Note that we have to give the full path to the PPD driver as listed by lpinfo -m
. Else you'll get some kind of generic "PPD not found" error.
To quickly explain the flags:
-p STAR
names the printerSTAR
.-E
is probably not needed as it's to do with enabling TLS, and since this is a USB printer it's redundant, though I've left it in as I haven't been able to test adding the printer without it yet.-v DEVICE
specifies the device URI.-m MODEL
the model of the printer.
Listing the printers can be done with
$ lpstat -p -d
printer STAR is idle. enabled since Mon 18 Mar 2024 10:59:17 GMT
If the rastertostar
filter was installed in the wrong place, you'll get an error message about that when using lpstat
. Fortunately the error tells you exactly where it's expecting the filter to be, so it's just as matter of moving it there.
Printing Hello World
The test print:
echo "Hello World" | lp -d STAR
This will print a small slice of paper with "Hello World" in a relatively large font.
To list all of the printer specific options you have available, use lpoptions
, for example:
lpoptions -p STAR -l
Options like DocCutType
and PageCutType
are quite interesting, as they allow you to send multiple items to the printer without invoking the cut function. To use one, try
echo "Hello World" | lp -d STAR -o DocCutType=0NoCutDoc
This should print "Hello World" without cutting the page.
Other general options that are useful are the character per inch and lines per inch (cpi
and lpi
respectively), that let you play around with font sizes in a rudimentary way. I usually write a little test script to loop over values and see which ones I like
sizes=(8 10 12 14 16 18)
for CPI in "${sizes[@]}" do
for LPI in "${sizes[@]}" do
echo "Hello World cpi=$CPI lpi=$LPI" | lp \
-o DocCutType=0NoCutDoc -o cpi=$CPI -o lpi=$LPI
done
done
Printing images uses the CUPS image to raster, raster to STAR pipeline, and can be done by just passing the image file to the printer, e.g.
lp -p STAR ./test-image.jpg
Printing images is a bit of a dark art, as the printer seems to do everything it can do reorient the image against your wishes. I've found the only reliable way to get things in the right orientation is to export the image with whitespace in some X by Y pixel configuration where Y > X.
Happy printing!
Further reading
Some additional links that I've found useful: