Tinkering with Raspberry (and other things)

Parallel Thermoprinter


Another day, another gadget.

I recently acquired a miniature thermoprinter just for fun because spending 14 EUR (that is 18.47 USD at the time I am writing this) was a no-brainer. I will skip one beer in the beer garden. NOT. It’s 37 °C outside…
For those interested, here is the link to the German ebay-offer.

Sorry. Back to the printer. It has originally a parallel port but comes packaged with a usb-parallel adapter cable. The question was: will the Raspberry work with an adapter and subsequently, the printer. Things turned out to be not that simple. Missing modules, the usual permission problems and the German language with its funny Umlauts (ÄÖÜ).


Usually USB printers require a kernel module called usblp. I was not sure whether this module was present on the Raspberry or not, so I did a

sudo modprobe usblp

which resulted in an error message “FATAL: Module usblp not found.” The hard way would have been to setup a cross-compilation system and completely compile a kernel for the Raspberry from scratch. It is hot outside, I am lazy and this sounds like the perfect winter fun. So recompiling has to wait.

We are going the easy way by installing some software that enables the Raspberry to load the module when needed. On the commandline do

sudo apt-get install system-config-printer-udev

After installing it is usually a good idea to reboot. Or it is another crazy habit of mine. After rebooting insert the USB cable, connect the parallel cable to the printer and the printer to its power supply.

Next action is to check if the adapter has been recognized:


This lists all currently connectd USB devices and give you something like

Bus 001 Device 002: ID 0424:9512 Standard Microsystems Corp. 
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 008: ID 1a2c:0021  
Bus 001 Device 003: ID 0424:ec00 Standard Microsystems Corp. 
Bus 001 Device 004: ID 0409:005a NEC Corp. HighSpeed Hub
Bus 001 Device 005: ID 045e:00a4 Microsoft Corp. 
Bus 001 Device 006: ID 067b:2305 Prolific Technology, Inc. PL2305 Parallel Port
Bus 001 Device 007: ID 0409:005a NEC Corp. HighSpeed Hub

And there it is. “PL2305 Parallel Port”. Now we need to find out if the system created a device from the parallel port:

dmesg | grep 'usblp'

should print something like:

[   17.483132] usblp 1-1.3.2:1.0: usblp0: USB Bidirectional printer dev 6 if 0 
            alt 1 proto 2 vid 0x067B pid 0x2305
[   17.636543] usbcore: registered new interface driver usblp
[  573.508233] usblp0: removed
[  573.535390] usblp 1-1.3.2:1.0: usblp0: USB Bidirectional printer dev 6 if 0 
            alt 1 proto 2 vid 0x067B pid 0x2305

I did some indentation here to get everything into the layout. This looks good. The line “usbcore: registered new interface driver usblp” is what we want. Now let’s make sure that a device for this printer has been created:

ls -al /dev/usb/

If that results in the following output everything is OK.

drwxr-xr-x  2 root root     60 Jun 20 15:25 .
drwxr-xr-x 13 root root   3200 Jun 20 15:25 ..
crw-rw---T  1 root lp   180, 0 Jun 20 15:25 lp0

Looking closely at the lp0 entry you will recognize that it belongs to the group “lp”, so we need to add the user to this group. And, while doing so, we also add him/her to the “lpadmin” group which we need later.

sudo adduser pi lp

sudo adduser pi lpadmin

As this is a simple line printer there is no need for configuring the CUPS printing system. To use the printer you just echo what you want to print to the device associated with the printer. Every line must be terminated with a newline and a carriage return, so I wrote a little shell script that makes life easier. It takes input from anything that usually writes to stdout and sends it to the printer, adding the linefeeds by itself. I also added a charset conversion to be able to print Umlauts.

while IFS= read -r line
    do echo -n "$line" | iconv -t cp437 > /dev/usb/lp0
    echo -n -e "\r" > /dev/usb/lp0
echo -n -e "\r\r\r" > /dev/usb/lp0

The last line adds three carriage returns so that the paper advances three lines and everything printed is readable. I usually have a directory I put all scripts in and have this directory added to the path so that I am able to use it like this:

echo "Hello, World" | thermoprint

In the real world, issuing the above command to the printer looks like this:



6 thoughts on “Parallel Thermoprinter

  1. Pingback: Real Time Clock (Software – I2C) | MyRaspberryAndMe

  2. Danke; hab mir gerade genau denselben Drucker just for fun bestellt gehabt und stand nun vor dem Problem, wie ich ihn zum laufen bringen soll.
    Hat super funktioniert!

  3. Reblogged this on crimier and commented:
    Just another really cheap piece of hardware that might turn out to be able to be repurposed into something really cool =)

  4. das dmesg | grep ‘usblp’ liefert bei mir kein Ergebnis und das Verzeichnis /dev/usb existiert nicht! Ein Idee woran es liegen könnte ?
    Ist denn jetzt doch der Kernel mit usblp support genutzt worden?

    Viele Grüße

  5. Thanks for the information after sudo apt-upgrade it its working now!

    do you know if the printer accepts esc/pos commands, than it would maybe be possible to programm the euro sign manually!?