Wire AIS end to end: AIS-catcher support in secondary-sdr container
node-26#9. decoder_control.py's AIS mode now actually launches AIS-catcher instead of 400ing: a background thread reads its stdout JSON stream (one message per line) and keeps a live in-memory snapshot keyed by mmsi, since AIS-catcher streams rather than writing a periodic file the way dump1090's --write-json does. Messages are merged onto the existing entry per mmsi rather than replacing it, since AIS-catcher emits static data (name) and position reports (lat/lon) as separate message types — a naive overwrite would blank the name back to null on every position-only update (caught by a standalone unit check against a fake stdout stream before this fix, not by pytest — this container has no test suite yet). edge-node's telemetry_uplink_loop now posts non-empty vessel snapshots to the new /telemetry/ais the same way it already does for aircraft. UNVERIFIED against real hardware/binary in this session, same caveat as the ADS-B commit — AIS-catcher's JSON field names are believed correct from its docs, not confirmed against a real capture. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 5
parent
b2e3804dc3
commit
52f31bbcc0
@@ -33,9 +33,12 @@ async def telemetry_uplink_loop():
|
||||
while True:
|
||||
await asyncio.sleep(UPLINK_INTERVAL_SECONDS)
|
||||
config = load_node_config()
|
||||
if config.secondary_sdr_mode != "adsb":
|
||||
if config.secondary_sdr_mode not in ("adsb", "ais"):
|
||||
continue
|
||||
snapshot = await secondary_sdr_client.data()
|
||||
if not snapshot or not snapshot.get("aircraft"):
|
||||
if not snapshot:
|
||||
continue
|
||||
await _post_snapshot("/telemetry/adsb", {"aircraft": snapshot["aircraft"]})
|
||||
if config.secondary_sdr_mode == "adsb" and snapshot.get("aircraft"):
|
||||
await _post_snapshot("/telemetry/adsb", {"aircraft": snapshot["aircraft"]})
|
||||
elif config.secondary_sdr_mode == "ais" and snapshot.get("vessels"):
|
||||
await _post_snapshot("/telemetry/ais", {"vessels": snapshot["vessels"]})
|
||||
|
||||
Reference in New Issue
Block a user