Repository navigation
Conversation
Closes smittix#179. Publishes decoded ADS-B, AIS, and APRS position events as CoT XML to a configured UDP/TCP destination (defaults to the ATAK SA multicast group 239.2.3.1:6969, or point it at a TAK Server), following the same optional/env-gated export pattern already used by the MQTT export (utils/mqtt.py): disabled by default, no external dependency, hooked into the shared event pipeline so all three modes get it for free. New env vars: INTERCEPT_COT_HOST (unset = disabled), INTERCEPT_COT_PORT, INTERCEPT_COT_PROTO, INTERCEPT_COT_STALE_SECONDS.
Meshtastic was the only mode not wired into the shared event pipeline (no alerts, recording, MQTT, or now CoT). This hooks POSITION_APP packet handling into utils.event_pipeline.process_event(), the same call already made for ADS-B/AIS/APRS, and adds a "meshtastic" entry to cot.py's mode map (CoT type a-f-G-U-C, uid MESH-<node id>). Position updates from mesh nodes now flow through the same alerts/recording/MQTT/CoT infrastructure as every other mode, so a Meshtastic node with GPS (e.g. the Heltec T114) shows up on ATAK/WinTAK alongside tracked aircraft/vessels/APRS stations when CoT export is enabled.
The Heltec T114 attached to the Pi's Meshtastic node reports its own position via POSITION_APP packets. Forward that position into utils/gps.py's external-position slot so _get_observer_location() (gpsd -> external -> config -> hardcoded default) picks it up automatically for ADS-B range rings and any other observer-location consumer, without requiring a separate gpsd-speaking GPS receiver. Only the local node's own position is ever forwarded (_is_local_node guards against any mesh peer's position corrupting the observer location); gpsd remains authoritative whenever a real fix is present.
InterceptTime's global timezone preference only offered UTC, browser-local, or US zones -- no way to select SAST, and it defaulted to US/Eastern. Added Africa/Johannesburg (labelled SAST) as a selectable option and made it the default, since this deployment and its primary user are South Africa-based. Also fixed two clocks that bypassed InterceptTime entirely and hardcoded raw UTC display regardless of user preference: - map-utils.js's per-map HUD clock (top-right overlay) - gps.js's GPS-fix timestamp readouts (sidebar + visuals panel) Both now show the user's configured local time (SAST by default) with UTC appended for reference, rather than UTC-only. templates/layout/base.html's header clock (currently unused by any route, but defensively) was updated the same way for consistency.
…popups Surfaces Position.sats_in_view (already sent by the device, previously unparsed) alongside the existing lat/lon/altitude fields: MeshNode and NodeInfo gain a sats_in_view field, populated from both the live POSITION_APP packet handler and the nodeDB interface-sync path. Frontend shows it as a SATS stat in the local-node status strip and a Sats: line in each node's map popup.
Owner
|
Thanks for this — and for splitting it up afterwards, which is what makes it easy to act on. This branch is the stacked version of work that now exists as three focused PRs. Comparing them:
This PR carries all five of those commits, and its 15 changed files are exactly the union of the other three — nothing here is missing from them. #251's commits are the same content as this branch's So I'm closing this one as superseded, and reviewing #247, #250 and #251 individually — each is far easier to assess on its own merits than the stack is. Review notes are going on each of them now. Nothing is lost by this; if you think something in here isn't covered by the other three, say so and I'll reopen. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
utils/gps.py(set_external_position/get_external_position), consulted byget_current_position()only when no gpsd client has a live fix — gpsd remains authoritative whenever present.utils/meshtastic.pyforwards the local node's own POSITION_APP reports into that slot (_is_local_nodeguards against any mesh peer's position ever being mistaken for the observer's own location)._get_observer_location(): gpsd -> external -> config -> hardcoded default) used by ADS-B range rings and other location-aware features — no separate gpsd-speaking receiver required.Stacked on #247 — this branch is built on top of
feat/cot-exportso the two features don't collide in the same POSITION_APP handling block. Please land #247 first; this PR's diff will settle down to just the GPS-forwarding commit once that happens.Test plan
pytest tests/test_gps.py tests/test_meshtastic.py tests/test_cot.py tests/test_system.py tests/test_bt_locate.py— 91 passedtests/test_gps.pycovers: no source available, external-only, gpsd-priority-over-external, external-fallback-when-gpsd-client-has-no-fixTestMeshtasticOwnNodeGpsFeedsObserverLocationintests/test_meshtastic.pycovers own-node forwarding and confirms peer-node positions are never forwarded🤖 Generated with Claude Code