I have Epson TM-U220B Network printer and a cash drawer. I am developing Python Web app I managed to configure printer over my application. My printer is working fine, I just want to open till when I print ticket. I found some codes over internet for opening till drawer.
Here is the code:
def print_(printer_name, file_path):
preorder = chr(27)+chr(100)+chr(0)
cut_paper = chr(29)+chr(86)+chr(66)+chr(0)
open_till = chr(27)+chr(112)+chr(10)
the_file = open(file_path, "a")
the_file.seek(0)
the_file.write(preorder)
the_file.seek(0,2)
the_file.write(cut_paper)
the_file.write(open_till)
the_file.close()
conn.printFile(printer_name, file_path, md5(file_path), {})
The open_till is the code that not working, everything else is ok
Thank you
You can use the below code to open the cash drawer