Add release-after-use and cycling motion detection modes

- main_release.py (v3.1.0): Release camera after each snapshot for V4L2 compatibility
- main_cycling.py (v3.2.0): Single motion thread cycles between cameras (1s interval)
- mcp/vision_mcp.py: Support custom snapshot_path for multi-camera servers

Fixes Pi 3 dual-camera V4L2 conflicts by not holding cameras open.
This commit is contained in:
Alex Kazaiev
2025-12-29 16:18:45 -06:00
parent 37a2f2dcd6
commit 844502b4a1
3 changed files with 401 additions and 1 deletions

View File

@@ -302,7 +302,9 @@ async def vision_snap(cam_id: str) -> Union[MCPImage, str]:
if cam_type == 'http':
# HTTP API camera
async with httpx.AsyncClient(timeout=REQUEST_TIMEOUT, verify=False) as client:
snapshot_url = f"{cam['url'].rstrip('/')}/snapshot"
# Support custom snapshot path for multi-camera servers
snapshot_path = cam.get('snapshot_path', '/snapshot')
snapshot_url = f"{cam['url'].rstrip('/')}{snapshot_path}"
headers = {"X-API-Key": cam['api_key']}
logger.info(f"Requesting HTTP snapshot from '{cam_id}' at {snapshot_url}")