Raspberry Pi interfacing a thermal Printer
What do you get if you combine a Raspberry-Pi and a small thermal printer like those sold by Adafruit or Sparkfun?
I don’t know. You could build anything that includes a Raspberry-Pi and a small printer.
However my idea was to write a small script that could capture web pages, save them as image and print them. With this one can grab content from remote web pages or from a webserver running on the pi itself. Here some examples:
Above you can see some logos captured from Adafruits and Hackadays web pages and the capture of an austrian news site.
You can find the sources for capturing web pages and for the printer class on GitGub:
- Printer: https://github.com/thefloe1/Raspi-Thermal-Printer
- Webcapture: https://github.com/thefloe1/webcapture
To build those projects one needs to have Qt installed. To have this scripts running without an active X-Server one can either use Xvfb which gives a virtual framebuffer running X or one can use the build system of phantomJS. phantomJS is a great javascript library which can be used to create web applications in javascript. It enabled you to build a complete QT framework that can run without a X server at all (compiling QT with QWebKit on the Raspberry-Pi can take up to two days, don’t forget to increase the size of your swap file, otherwise the build will fail!).






impressive! Have you looked at ghostscript? Its a free postscript implementation. And there are several printservers like lpr,cups,lprng. Another tip, set up a cross platform build environment on a desktop, much faster to build large stuff like qt.
Nice Job Flö
(seen @Hacked Gadgets)
Super sache genau das was ich vor hatte mit meinem RPI vorgehabt habe….
Wie hast du das geschafft?
Und wo bekomme ich den Drucker her?
Den Drucker kannst du bei Adafruit, Sparkfun oder einem deren Distributoren / Partner kaufen. Ich habe meinen von hier: http://www.pieterfloris.nl/shop/
Hallo
Nice
Lust dazu ein Tutorial zu schreiben?
Super sache.
Wie genau hast du den Drucker angeschlossen??
Lg
Klaus
Der Drucker hat eine serielle Schnittstelle. Ich habe GND und TX ohne Pegewandler angeschlossen.
lg
Hi,
Super Sache! Könntest du die Verkablung etwas genauer darstellen? Ich bin noch Beginner im GPIO-Bereich, habe jedoch großes Interesse darin.
Außerdem habe ich mehrfach gelesen, man müsse einen Pegelwandler verwenden, (5V -> 3V3), um eine Beschädigung des RPis zu verhindern.
Im letzten Kommentar schreibst du jedoch, dass du einen solchen nicht verwendet hast. Kannst du das vielleicht auch nochmals erklären?
Da wäre ich dir sehr dankbar
Danke
Lars
Hi,
Die Verbindung sieht wie folgt aus:
RasPi < -> Printer
GND < -> GND
TX < -> RX
Der Rückkanal also TX vom Printer auf RX vom RasPi muss nicht verbunden werden und damit wird auch kein Pegelwandler benötigt da es hier zu keinem Konflikt kommt. Der Printer scheint mit den 3.3V Pegel vom RasPi zufrieden zu sein.
This is really cool but I’m curious how you physically connected the printer to the RasPi..
I’m assuming you used the GPIO ports? If you could even include a photo of how the printer was connected to the device, that would be a great help!
Thanks!
Hi,
I created a small article describing how to connect the thermal printer to the raspberry pi: http://tobiscorner.floery.net/raspberry-pi/connecting-the-printer-to-the-raspberry-pi/
Tobias
Does the printer works with an Arduino?? Thanks
Hi,
There are libraries available for this type of printer. You can find them via Adafruit or Sparkfun.
Tobias