Skip to content

Instantly share code, notes, and snippets.

@Irdroid
Last active September 18, 2022 02:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Irdroid/09017dea81b9397bca2d71542633d21c to your computer and use it in GitHub Desktop.
Save Irdroid/09017dea81b9397bca2d71542633d21c to your computer and use it in GitHub Desktop.
Zijiang Thermal Receipt Printer driver fix for Linux / Cups

pos58

Problem:

Zijiang based thermal receipt printer usb backend for Linux Cups (via libusb) does not properly initializes the Zijiang based thermal receipt printers and the printers are either not working properly e.g. print just once, print garbage characters when printing graphics or just moves the paper feed and stalls without printing and a power cycle is needed to start a new print.

Solution:

This problem. has to do with the usb backend and the org.cups.usb.quirks where special parameters are defined for different printer models. This file is loaded and parsed by the usb backend each time the printer prints

For the USB printer that I am using I have defined the following at the last line of the cups usb quirks file (org.cups.usb-quirks):

0416:5011 unidir soft-reset

0416:5011 is the USB printer VID ( Vendor ID) and PID (product ID) ( I am using POS5890K) but I think most of the Zijiang USB printerd have this VID / PID

These printers have one endpoint for configuration and one endpoint for writing data. If the above is not defined , the printer reports bidirectional and it will either stall or not work at all.

The second parameter (soft-reset) will instruct libusb to issue a soft reset affer each print job on the usb bus for this device. If soft reset isnt issued, the next print will come up with garbage characters in the begining of the print receipt. So these definitions in org.cups.usb-quirks are important if you want a stable printing.

Applicable models:

  • All Zijiang based
  • POS58,POS80
  • NT5890k, POS5890, POS5890k
  • Hoin POS58, Hoin POS80
  • Probably many other printers are using this firmware

Vendor ID : 0416 Product ID : 5011

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment