pip3 install PyESCPOS[usb]
- Modificar el spooler del triarius para que ejecute el script qr_gen_full_usb.py de esta forma /usr/bin/python3 /opt/pyescpos/qr_gen_full_usb.py ${port} ${dirtmp}$archivo.prn ${dirtmp}${archivo}.json $logo
# lsusb Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub Bus 001 Device 004: ID 0458:0186 KYE Systems Corp. (Mouse Systems) Genius DX-120 Mouse Bus 001 Device 013: ID c0f4:04e0 SZH usb keyboard Bus 001 Device 014: ID 1c8a:3a0e SAM4S PrintClassDevice Bus 001 Device 002: ID 05e3:0608 Genesys Logic, Inc. Hub Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub ...En este listado la impresora se conecto como Bus 001 y Device 014, asi que se puede ver los detalles del dispositivo con el comando:
# lsusb -s 001:014 -v
# lsusb -s 001:014 -v | grep idVendor idVendor 0x1c8a
# lsusb -s 001:014 -v | grep idProduct
idProduct 0x3a0e
# lsusb -s 001:014 -v | grep IN
EndpointAddress 0x81 EP 1 IN # lsusb -s 001:014 -v | grep OUT
EndpointAddress 0x02 EP 2 OUT
<PORT> 0x1c8a 0x3a0e </PORT>Poniendo el idVendor e idProduct con espacio entre ellos y entre los tags, puesto que se agregan como parametro a la ejecución del qr_gen_full_usb.py.
p = Usb(int(tkhost,16), int(tkport,16), timeout=30, in_ep=0x81, out_ep=0x02, profile='TM-P80')
Please wait... it will take a second!