When trying to run python3 printertest.py (on my pi zero w) I get the error:
File "/home/pi/.local/lib/python3.9/site-packages/serial/serialposix.py", line 398, in _reconfigure_port
orig_attr = termios.tcgetattr(self.fd)
termios.error: (25, 'Inappropriate ioctl for device')
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/pi/Python-Thermal-Printer/printertest.py", line 5, in <module>
printer = Adafruit_Thermal("/dev/usb/lp0", 9600, timeout=5)
File "/home/pi/Python-Thermal-Printer/Adafruit_Thermal.py", line 84, in __init__
Serial.__init__(self, *args, **kwargs)
File "/home/pi/.local/lib/python3.9/site-packages/serial/serialutil.py", line 244, in __init__
self.open()
File "/home/pi/.local/lib/python3.9/site-packages/serial/serialposix.py", line 332, in open
self._reconfigure_port(force_update=True)
File "/home/pi/.local/lib/python3.9/site-packages/serial/serialposix.py", line 401, in _reconfigure_port
raise SerialException("Could not configure port: {}".format(msg))
serial.serialutil.SerialException: Could not configure port: (25, 'Inappropriate ioctl for device')
In printertest.py I change the printer setup line to:
printer = Adafruit_Thermal("/dev/usb/lp0", 9600, timeout=5)
This is because I could only get the first test to work with /dev/usb/lp0 and my print test page said it is 9600.
When trying to run
python3 printertest.py
(on my pi zero w) I get the error:In printertest.py I change the printer setup line to:
printer = Adafruit_Thermal("/dev/usb/lp0", 9600, timeout=5)
This is because I could only get the first test to work with /dev/usb/lp0 and my print test page said it is 9600.