Post Reply 
Print42 - thermal printer software for Free42
11-07-2019, 07:45 AM (This post was last modified: 11-07-2019 07:55 AM by jpcuzzourt.)
Post: #11
RE: Print42 - thermal printer software for Free42
(11-05-2019 03:15 AM)tcab Wrote:  Hi - great to hear about your thermal printer purchase!

Before I go to the effort of making a linux version of Print42, we need to verify if your bargain printer responds properly to ESCPOS commands and is compatible with the python escpos library that Print42 uses, https://python-escpos.readthedocs.io/en/latest/.

...

cheers,
Andy


Hi Andy.
Thanks. I installed python-escpos on my Linux laptop. (MX19)
After a little bit of RTFM, i found the magic to properly instantiate this printer, and the short version: It works fine.

Here is the code snippet I tested:
Code:

from escpos.printer import Usb
x = Usb(0x0fe6,0x811e,0,0x98,0x02)  # these values depend on your printer
# Print text
x.text("\n")
x.text("Hello World\n")
# Print image
x.image("debian-logo.png")
# Print QR Code
x.qr("You can readme from your smartphone")
# Print barcode
x.barcode('1324354657687','EAN13',64,2,'','')
x.text("\n\n\n\n\n\n")
# Cut paper
#x.cut()

Note the extra numbers 0x98 and 0x02 in the printer instantiation line. These were necessary to make the printer work. These are the 'interface' and 'endpoint' numbers, found from following this manual entry.

Text, barcodes, QR codes, and graphics all worked fine.
   

Cheers,
JP

Quick edit: Note also that this printer does not have a cut() feature, so one has to tear the paper off manually.

Georgia, USA
10BII+, 12C, 14B (AE), 17B, 17BII, 20B, WP-34S, 28S, 35S, 39GS, 48G, 82240A,B
+ sliderules galore, mostly Hemmi/Post & Dietzgen
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: Print42 - thermal printer software for Free42 - jpcuzzourt - 11-07-2019 07:45 AM



User(s) browsing this thread: 1 Guest(s)