Replies: 2 comments
|
I made the following changes and the crash and reboots are gone. The ws_client.py file has two issues that flood the HA event loop during printing: _periodic_gets() runs on a 0.2s sleep loop, polling the printer at GET_REQPRINTERPARA_SEC = 5.0s and GET_PRINT_OBJECTS_SEC = 2.0s. This generates a very high volume of state updates during active prints. When the WebSocket goes dead mid-print and reconnects, a burst of state updates hits HA all at once, which was enough to crash it. The crash wiped the log buffer before any Creality errors could be recorded, making it very hard to diagnose. Fix: Increase _periodic_gets() sleep from 0.2s → 1.0s python# Add constant Add to initself._last_dispatched_state: dict[str, Any] = {} Add methodasync def _dispatch_if_changed(self, new_state: dict[str, Any]) -> None: Replace on_message call in _loop with:await self._dispatch_if_changed(dict(self._state)) Change sleep in _periodic_gets:await asyncio.sleep(1.0) # was 0.2 Result: Happy to share the full modified ws_client.py if helpful. |
|
Hey, could you please submit a PR? Ioverlook this discussion completely. Tho, very strange! My HA runs on 3GB of RAM and single low power core and I never had any issues like this |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
When this integration is enabled and printing eventually HA will crash and reboot. Problem is the error or cause doesn’t persist after reboot, so I don’t know what specifically is causing it. I have excluded all entities from recorder, but it still is happening. If this integration is disabled, no crashes or reboots. HA is a VM on Proxmox with 12gb ram. Anyone else have this issue.
All reactions