Add generic pyMC modem telemetry support and preserve modem GPS satellite details#294
Open
yellowcooln wants to merge 11 commits into
Open
Add generic pyMC modem telemetry support and preserve modem GPS satellite details#294yellowcooln wants to merge 11 commits into
yellowcooln wants to merge 11 commits into
Conversation
Collaborator
Author
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.


PR Summary
Overview
This PR adds first-class support for consuming diagnostics from a networked pyMC modem HTTP API, including GPS, battery, and solar telemetry.
It also fixes GPS diagnostics for modem-backed GPS sources by preserving detailed
satellites.in_view[]records so the UI can correctly plot satellite azimuth, elevation, and SNR data.The implementation is intentionally modem-generic. New sensor and source names use
pymc_modemandmodem_httprather than board-specific naming, allowing support for current and future pyMC modem hardware exposing the same/api/statsAPI.Changes
Modem HTTP GPS Source
Adds a new GPS source type:
Supported aliases:
modem_httppymc_modemhttpFeatures:
/api/statspayload or a nested GPS payload.GPS Satellite Detail Preservation
Preserves detailed modem satellite visibility records:
Normalizes:
prnelevation_degreesazimuth_degreessnr_dbAlso supports alternate field names:
elevationazimuthsnrThis fixes an issue where modem-backed GPS sources could report a valid fix and satellite counts while the diagnostics UI displayed zero plottable satellites due to missing azimuth/elevation/SNR data.
New pymc_modem Sensor
Adds a new sensor type:
The sensor reads modem telemetry from the HTTP
/api/statsendpoint and exposes:The sensor tolerates missing GPS coordinates and optional telemetry fields, allowing use on non-GPS or GPS-disabled modem deployments.
CRC Counter Handling
Improves CRC statistics handling for pyMC modem transports:
pymc_usbpymc_tcpThe repeater now treats modem CRC counts as device-owned cumulative counters and baselines the first observed value rather than recording it as a startup CRC spike.
Existing CRC behavior remains unchanged for:
sx1262sx1262_ch341kissConfiguration Updates
Updated
config.yaml.exampleto document:gps.source: modem_httppymc_modemsensor configuration examplesFiles Changed
config.yaml.examplerepeater/config.pyrepeater/data_acquisition/gps_service.pyrepeater/engine.pyrepeater/sensors/pymc_modem.pytests/test_engine.pytests/test_gps_service.pytests/test_sensors.pyValidation
Targeted test suite:
Result:
Additional coverage added for:
pymc_modemsensor operationOperational Verification
Verified on a live repeater deployment:
Observed live modem data:
Backwards Compatibility
serialGPS sources remain supported.fileGPS sources remain supported.pymc_modemsensor is additive.modem_httpGPS source is opt-in via configuration.Why This Matters
Before this change, pyMC modem deployments could expose a valid GPS fix and satellite counts while losing detailed GSV-style satellite visibility data during ingestion. As a result, the GPS diagnostics UI could show zero plotted satellites despite the modem having complete azimuth, elevation, and SNR information.
This PR preserves and normalizes those satellite records end-to-end, allowing the repeater UI to display the same GPS diagnostic detail available on the modem itself.