Bug: "Enable camera on print start" toggle is ignored (Camera always activates and forces itself back on) #50
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Hi again!
Since you guys are on fire with the fixes, I wanted to report another minor but stubborn bug regarding the camera management in the bridge settings.
In the KX-Bridge interface, there is a configuration toggle named "Enable camera on print start".
The Issue:
This setting is currently being ignored by the bridge logic. Even when the toggle is explicitly set to Disabled / OFF, the printer's native camera automatically activates the moment a new print job begins.
Furthermore, if I manually turn off the camera stream from the bridge web interface during a print, it doesn't stay off. After a few moments, it automatically forces itself back ON.
Possible Cause:
It feels like there is either a hardcoded override triggered by the print start event (perhaps tied to the native Anycubic MQTT print start sequence) that ignores the GUI config state, or a background keep-alive loop that continuously checks and forces the camera status back to enabled regardless of user interaction.
This behavior is a bit annoying if someone prefers to keep the native camera off to save bandwidth or hardware resources (especially since some of us are using secondary webcams for monitoring).
Let me know if you need any logs from the container when a print starts! Thanks again for your awesome work.
Thanks for the detailed report — the root cause is now identified and fixed.
What was happening
There were two separate issues:
Camera forces itself back on after manual stop: The bridge web UI calls
applyState()on every poll cycle (~2–3s). It had an auto-start condition: "if print is running and camera is not on → start camera." So every time you stopped the camera manually, the next poll would restart it. This had nothing to do withcamera_on_print— it was a UI-level loop."Stream unavailable" error toast on manual stop: When
camStop()clearedimg.src, the browser fired the existingimg.onerrorhandler for the still-open stream connection, which logged an error toast.The fix (in progress, will be in the next release)
camStop()in the UI now sets acamUserStoppedflag and clearsimg.onerrorbefore resettingsrc— no more spurious error toast.applyState()checkscamUserStoppedbefore auto-starting — camera stays off for the remainder of the print.handle_api_camera_stop()in the bridge backend also sets a_camera_user_stoppedflag to block any backend-side auto-start triggers.The
camera_on_printtoggle itself was working correctly all along — it controls the initial auto-start, not the keep-alive behavior.