Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 3556

Other projects • Re: Thermal Printer Firmware with RPI 3a+ Troubleshoot

$
0
0
Are you sure it's "pc936"?

Anyway, you need to try setting the code page to your own language, assuming it's not Chinese.

The ESC/POS command for setting Code Page is 'ESC t n' (ASCII) or '1B 74 n' (Hex) where 'n' is page n of the character code table. Luckily there is a function in the Adafruit library:

Code:

setCodePage(val)
There is a list of code page codes here:
https://github.com/escpos/escpos/blob/m ... /escpos.rb

Pick the one you like. Hopefully your printer supports it.
Yes the test page which i couldnt print through code but just by button showed (Langauge: PC936 [GB18030]). So firstly the setCodePage(val) doesnt work unless i havent got the correct library installed or its for a different language as i have seen it on the c program adafruit library. Following the link i inserted the each of those Cp_CP lines in individually and no change. I was wondering if maybe the chinese i received could be translated for printer.feed(2) and printer.print('hello') as the same/similar lines kept getting printed even when alternating whats getting printed. The code must be fine as this is the official adafruit code. Maybe theres a way of configuring it before coding or atleast a line of code to help encode right. Here is my self test and many lines of code output. Hopefully they display something useful instead of being gibberish. https://imgur.com/01xuNVp

Statistics: Posted by george_ferg17 — Wed Dec 06, 2023 8:14 pm



Viewing all articles
Browse latest Browse all 3556

Trending Articles