la_mojo cameras: track PTZ health and re-initialise a failed PTZ protocol #14
Merged
ClaudeAI
merged 1 commits from feature/camera-ptz-health into master 20 minutes ago
Loading…
Reference in new issue
There is no content yet.
Delete Branch 'feature/camera-ptz-health'
Deleting a branch is permanent. It CANNOT be undone. Continue?
Summary
Each camera now tracks the health of its PTZ control. The PTZ status bit sent to the remote server reflects that health, and a failed PTZ protocol is re-initialised automatically.
Depends on #13 (pOnvif compliance), which this branch contains. Merge #13 first; this PR then shows only its own commit.
PTZ health (
deviceNodeCamera)PTZ_HEALTH_INFOholds:NONE/INIT/OK/FAILED);getPtzHealth()returns a copy and is safe to call from any thread.getPtzStatus()is already sent to the server asCAMERA_STATUS_PTZ_OK. It now returns 1 only when PTZ is OK, or when the camera has no PTZ protocol. Before, it returned 1 as soon as the state machine leftCAM_WS_INIT.Detection and re-initialisation
CAM_WS_READY):validate()is checked on every loop;protocolPTZ::probe()runs every 30 s. For ONVIF it is a GetStatus request: a SOAP Fault still means reachable, and only a communication error marks the camera lost.CAM_WS_INIT. The first attempt is immediate, then the delay is 5, 10, 20, 40 and 60 s (capped). Before, a failed start-up was retried in a tight loop.CAM_WS_ENDused to rebuild the whole node):probe()is the protocol's ownvalidate(), so they cannot detect a lost connection. A failed move re-initialises the protocol instead of rebuilding the node.Testing
g++ -fsyntax-onlyon the changed files and the users ofgetPtzStatus(): no new warnings.probe()and re-initialisation against the simulated camera:validate()is false;create()fails;create()and the probe succeed.PTZ FAILEDandPTZ recoveredlog lines;Generated with Claude Code
https://claude.ai/code/session_0139veDo3XyavMuVhdnHcN16
d1f3d8f57a.