Closed lixxbox closed 8 months ago
Interesting, it's trying to construct it in the ams class. I'll add a check for this later today thanks!
I don't have ams so hard for me to verify the change worked, but going off of your commit I think the most recent commit should fix it. Let me know / reopen it if that didn't work!
It has been running smoothly for a few hours now with the commit. If there will be an error later, I will let you know.
It's been running for quite a while now. But now I get the following error, very similar to the previous error, but not concerning the AMS.
Unfortunately, I cannot reproduce/force the error. My code is based on the example.
Seems like to happen, when I send a print from OrcaSlicer to the printer. I'll test with the original example code.
Edit: Can confirm the error with original example.
Exception in thread Thread-1 (_thread_main):
Traceback (most recent call last):
File "C:\Python311\Lib\threading.py", line 1038, in _bootstrap_inner
self.run()
File "C:\Python311\Lib\threading.py", line 975, in run
self._target(*self._args, **self._kwargs)
File "C:\Python311\Lib\site-packages\paho\mqtt\client.py", line 3591, in _thread_main
self.loop_forever(retry_first_connection=True)
File "C:\Python311\Lib\site-packages\paho\mqtt\client.py", line 1756, in loop_forever
rc = self._loop(timeout)
^^^^^^^^^^^^^^^^^^^
File "C:\Python311\Lib\site-packages\paho\mqtt\client.py", line 1164, in _loop
rc = self.loop_read()
^^^^^^^^^^^^^^^^
File "C:\Python311\Lib\site-packages\paho\mqtt\client.py", line 1556, in loop_read
rc = self._packet_read()
^^^^^^^^^^^^^^^^^^^
File "C:\Python311\Lib\site-packages\paho\mqtt\client.py", line 2439, in _packet_read
rc = self._packet_handle()
^^^^^^^^^^^^^^^^^^^^^
File "C:\Python311\Lib\site-packages\paho\mqtt\client.py", line 3033, in _packet_handle
return self._handle_publish()
^^^^^^^^^^^^^^^^^^^^^^
File "C:\Python311\Lib\site-packages\paho\mqtt\client.py", line 3327, in _handle_publish
self._handle_on_message(message)
File "C:\Python311\Lib\site-packages\paho\mqtt\client.py", line 3570, in _handle_on_message
on_message(self, self._userdata, message)
File "C:\Python311\Lib\site-packages\bambu_connect\WatchClient.py", line 54, in on_message
self.printerStatus = PrinterStatus(**self.values)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Python311\Lib\site-packages\bambu_connect\utils\models.py", line 206, in __init__
self.ipcam = IPCam(**data["ipcam"]) if "ipcam" in data else None
^^^^^^^^^^^^^^^^^^^^^^
TypeError: IPCam.__init__() missing 3 required positional arguments: 'ipcam_dev', 'ipcam_record', and 'mode_bits'
Looks like I can't re-open the issue. :-/
Add initialziation for all of them in the most recent commit so should fix all those issues:
https://github.com/mattcar15/bambu-connect/commit/7510a00b404bd86c372de2d50081e75dc65f37f2
Lemme know!
@mattcar15 I have only been able to start one test print so far. No error message has appeared. 🤞 I will keep an eye on it and get back to you if something similar happens again.
Hi,
the printer_stream.py example runs fine at first:
But after some time I get the following error:
I don't know exactly how this works, but is it possible that MQTT doesn't always send all the entire data, although it is expected by your script?