Currently, I am developing an ordering system that uses a thermal printer.
my code looks like this.
from escpos.printer import Usb
p = Usb(idVendor=0x471, idProduct= 0x55,in_ep=0x82, out_ep=0x02)
try:
p.text('Hello +\n')
status = p.paper_status()
# status = p._read()
print(status)
p.cut()
except Exception as e:
print('error', e)
p.close()
I get the output
: error [Errno 110] Operation timed out
what am I doing wrong?
HELPFULL INFO
- python-escpos==3.0a6
- printer model Alpha TP-80H
I also used the python-escpos library to get the paper status at first, but I always got an error, when I used the pySerial library to get the paper status, I found it works! I recommend you to use the pySerial library.
Here are some simple examples:
You can refer to here, the example I wrote before.