When using the Python Library python-escpos to use a thermal printer via usb, you need the device id, vendor id, endpoint out id, and endpoint in id.
Finding these values took me some time, so here is a script that automates the process.
All you need to supply to the script is the name of the printer device. Find it out by running lsusb
with the printer disconnected. Then connect the printer and run lsusb
again.
Look out for the device that has been added and remember its name (or some part of it, doesn't really matter).
Run ./get_thermal_printer_info.sh "device name"
and there you'll find the values you need to create the escpos.printer.Usb
object.
Your Python code might look something like this:
from escpos.printer import Usb
printer = Usb(0x0416, 0x5011, in_ep=0x81, out_ep=0x03)
# ... do something with printer like `printer.Text("It works!")`