I can't figure out a way to print on a POS machine(EPSON TM-T20III).
I have tried creating a text file and then printing it. It works, but I have no control over alignments, font type, font size, or specifying printer(at least 2 printers will be connected). So I came across this Python library called Escpos. Here is my code using that library:
from escpos.printer import Usb
#######(vendor id, device id, 0, profile)
p = Usb(0x6&398681A4, 0x1, 0, profile="TM-T20III")
p.text("Hello World\n")
p.cut()
This code can't find my printer:
error: USBNotFoundError("Device not found or cable not plugged in.")
I'm suspecting that I may have the wrong details for the vendor id and device id. I got them by:
Open the Device Manager by right-clicking on the Start button and selecting Device Manager.
Expand the Printers section.
Right-click on your printer and select Properties.
Click on the Details tab.
In the Property drop-down list, select Hardware IDs.
The vendor ID and product ID will be listed in the Value column.
- This is what I'm getting: usbprint\epsontm-t20iii2dac
In the Property drop-down list, select Device instance path.
- This is what I'm getting: USBPRINT\EPSONTM-T20III\6&398681A4&1&USB002. Accoding to chartGPT the Vendor id is 0x6&398681A4 and the product id is 0x1
Note: Network connection if off the table for me. Thank you for helping