In this article I will continue to write about my testing of the components for the DIY cash register. Starting by the configuration of the thermal printer to print graphics…
This article will continue the tests from link: Part 2
Thermal printer Graphics
So, thw simple text print is working now, and it was very easy. Compared to that, to get that printer to print graphics was more challenging. The main thing is, that I had to install a driver to get this working. And also there was some CUPS configuration needed…
Here is how I did it:
First connect the thermal printer to the Raspberry Pi
I used the TTL connectivity instead of the USB, because USB didn’t work for me. If you want to use USB, here is how to do this:
Here I also got the instruction, how to connect it via TTL:
- Connect the printer to a 5V power source with 2A or larger
- The TX/RX pins should be “cross” connected between Pi and printer (TX on printer should go to RX on Pi.)
- Connect GND between printer and Pi
- Disable the serial console option and enable the serial port hardware -> Is described in the link:../cash-register-part-2/[last article].
Now, it’s time to install the printer driver and cups.
|
|
You’ll see some warning messages as this compiles. That’s normal and these can be ignored.
When that is done, all the things has to be configured. After that the printer is ready for work:
|
|
“ThermalPrinter” is the name of the printer. You can choose your own… :)
Don’t forget to set this everytime the Pi restart (otherwise you cannot print anything):
|
|
LCD display
The next thing was the LCD, which dimension is 128x64 pixels. I tried to use the original one. The driver on that display was the ks0108. All this information I - luckily - found on the service manual for the cash register on the internet.
Therefore, I searched a lot, and what I found was this:
https://github.com/olikraus/u8g2/wiki/u8g2setupcpp#ks0108-128x64
and
https://www.instructables.com/Arduino-GPS-speedometer-with-a-ks0108-128x64-GLCD-/
But unfortunately none of the two solutions worked for me… :( On te other side - the bright one -, I noticed, that the dimension of the PCB and the screw holes were standardized. So, I could use an LCD with a newer driver chip on it.
So, I ordered this one: https://www.ebay.de/itm/271513573302
Now, I could use the lib for go for the ST7920 driver, which has a SPI interface: https://github.com/olikraus/u8g2/wiki/u8g2setupcpp#st7920-128x64-2
And besides that, I could use the periph.io library for GOLang to get it working: https://github.com/periph/cmd/blob/main/ssd1306/main.go
This is everything for now. In the next article, I will add a short video of the LCD in action… Stay tuned.