Open alessandro-antonelli opened 4 months ago
I can’t personally reproduce it locally, but I just added a few checks to that errored function, which would probably give more helpful info.
Please try:
git pull
in the repo and try to reproduce it, see if there’s any errorYou may also need to provide which browser you are using, if the error persists.
It seems that commit e976b0d fixed it! I tried the new version, and I could print without any error message. The print is successfull even without touching the Strength slider, at least on my system. Thank you a lot!
Glad to hear that :)
No idea what caused that though.
I still have this error with latest commit, or at least something very similar:
$ python server.py
Serving at http://127.0.0.1:8095/
----------------------------------------
Exception occurred during processing of request from ('127.0.0.1', 48192)
Traceback (most recent call last):
File "/usr/lib/python3.11/socketserver.py", line 317, in _handle_request_noblock
self.process_request(request, client_address)
File "/usr/lib/python3.11/socketserver.py", line 348, in process_request
self.finish_request(request, client_address)
File "/tmp/Cat-Printer/server.py", line 329, in finish_request
self.handler.__init__(request, client_address, self)
File "/usr/lib/python3.11/socketserver.py", line 755, in __init__
self.handle()
File "/usr/lib/python3.11/http/server.py", line 436, in handle
self.handle_one_request()
File "/tmp/Cat-Printer/server.py", line 104, in handle_one_request
super().handle_one_request()
File "/usr/lib/python3.11/http/server.py", line 424, in handle_one_request
method()
File "/tmp/Cat-Printer/server.py", line 271, in do_POST
self.handle_api()
File "/tmp/Cat-Printer/server.py", line 219, in handle_api
self.printer.print(io.BytesIO(body))
File "/tmp/Cat-Printer/printer.py", line 414, in print
self._print_bitmap(printer_data)
File "/tmp/Cat-Printer/printer.py", line 478, in _print_bitmap
self._prepare()
File "/tmp/Cat-Printer/printer.py", line 458, in _prepare
self.set_energy(self.energy)
File "/tmp/Cat-Printer/printer_lib/commander.py", line 149, in set_energy
self.send( self.make_command(0xaf, int_to_bytes(amount, length=2)) )
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/tmp/Cat-Printer/printer_lib/commander.py", line 55, in int_to_bytes
raise f'int_to_bytes: {i} > {max_value}'
TypeError: exceptions must derive from BaseException
----------------------------------------
Maybe something in python internals has changed because I was printing about 2 or 3 weeks ago without a problem. I am using up to date Archlinux.
I'm encountering an uncaught exception that prevents me from printing on the Windows "bare bone" version.
Error message displayed on app:
Error message displayed on terminal:
Setup where error occurs:
Steps to reproduce:
py -m pip install bleak
on the command promptC:\Users\aless\AppData\Roaming
and executegit clone https://github.com/NaitLee/Cat-Printer.git
python server.py
MX06-10D6
from the dropdown