Cheap and fast check thermal printer printing

We, IT specialists, often have the task of printing something simple and one-time - for example, a username and password for a new employee, a ticket for an installer, or something like that. Spending paper and cartridge on like that is very expensive. At the same time, there are printers with ultra-cheap high-speed printing, which rarely anyone remembers, although we see them all every day many times. We are talking about check thermal printers.



I’ll start, perhaps, with a demo so that you can appreciate the print speed of 20 cm per second:



( - , . :) )


. Citizen CT-S2000, – 58 80 . , , , . , : , , ( !).


80 . 58 . , .. , .



COM- ( USB), Ethernet, WiFi Bluetooth, .


Citizen – Windows, PPD CUPS, Java. , , Β«ESC/POSΒ».


. Citizen , (!) – - , Windows.


USB COM 25 pin, 9 pin – USB. Windows COM-, .


– ( ) . , , – .



ESC/POS, Python- python-escpos . Orange PI PC Debian, .


lsusb ID , 2730:0fff:


# lsusb
Bus 006 Device 002: ID 2730:0fff Citizen

USB endpoints, ID :


# lsusb -v -d 2730:0fff | grep bEndpointAddress
        bEndpointAddress     0x81  EP 1 IN
        bEndpointAddress     0x02  EP 2 OUT

Python:


from escpos import Usb
p = printer.Usb(0x2730, 0x0fff, 0, 0x81, 0x02)

, , Epson TM-T88III, , , , β€” . .


– , ESC/POS:


"""   , ,  """
p.set(font='a', align=u'left', height=3)

"""   (     DPI!) """
p.image('/home/test/example.png')

"""   (-   ,
        ) """
p.text("Hello, world!\n")

"""  QR- """
p.qr("https://gbougakov.dev", size=5, center=True)

"""  - ( ,  
  checksum) """
p.barcode('1324354657687','EAN13')
p.barcode('123456', 'CODE39')

"""   - –    
      """
p.soft_barcode('code39', '123456')

"""  : """
p.cut(mode='PART')

"""     : """
p.cut()

"""        
(        RJ-25): """
p.cashdraw(2)
p.cashdraw(5)

– . , , , . – 24 , – .



Raspberry Pi - – . , , , Β« !Β» β€” , .


Finally - an example of application. Last weekend, my school celebrated its next birthday (as far as the 143rd), and by tradition, high school students organized various contests and entertainment for elementary grades and graduates. I was responsible for Bingo - at the press of a button my printer printed tickets for players, and numbers were displayed on the board. The QR code on the ticket made it possible to check whether the player crossed out the numbers correctly during the game:



For vandal resistance, the Orange Pi was hidden in a plywood podium, tightly screwed to the printer, and the ticket printing command was displayed on the buttons connected to the GPIO. For security, an I2C screen was added, on which the IP address of Orange Pi was displayed, in which case, to know how to access it via SSH.

Source: https://habr.com/ru/post/undefined/


All Articles