Running a .NET Core Application on a Raspberry Pi to Control Thermal Receipt and Label Printers
Introduction
I've previously developed POS systems for the food and beverage industry. At that time, the backend was developed entirely on the Windows platform. Most vendors provided a Windows SDK, which allowed us to interact directly with their DLLs. This time, however, I'm working on a Raspberry Pi. The vendors didn't provide any SDKs, and I even encountered problems just trying to install the drivers. Ultimately, I had to resort to using sockets to send command sets to the network printers to get them to print.
Objective
To set up a .NET Core website on a Raspberry Pi and call the receipt and ticket printers to print.
Development Environment
Raspberry Pi 4B 8G * 1
Godex DT2X Label Printer * 1
HPRT TP805 Receipt Printer * 1
Thermal receipt paper * 1
Thermal label paper * 1
Command Sets for Receipt/Label Printers
Before developing for receipt or label printers, you first need to understand:
- Most receipt printers use Epson's ESC/POS command set.
- Most label printers use ZPL or a ZPL-extended command set.
Finally, I referenced the following open-source .NET Core projects
I ended up referencing the two packages below. By following their examples, I was able to directly use sockets to control the label and receipt printers, which quickly helped me achieve my goal.

BinaryKits.Zpl(ZPL)
ESC-POS-.NET(ESCPOS)





























Comments