feat: include radio stats in MQTT status messages#169
Open
Kpa-clawbot wants to merge 1 commit intorightup:mainfrom
Open
feat: include radio stats in MQTT status messages#169Kpa-clawbot wants to merge 1 commit intorightup:mainfrom
Kpa-clawbot wants to merge 1 commit intorightup:mainfrom
Conversation
Adds noise_floor, tx_air_secs, rx_air_secs, recv_errors, and battery_mv to the MQTT status message under a 'stats' key. This enables downstream tools like CoreScope to display RF health metrics (noise floor charts, airtime monitoring, jammer detection) for observers running pyMC_Repeater. The stats format matches meshcoretomqtt's output for compatibility. Changes: - MQTTHandler: add LWT (Last Will) for offline detection, add publish_status() for retained status messages - StorageCollector: add get_device_stats() to gather radio metrics, add publish_status() convenience method - RepeaterHandler (engine.py): publish status periodically (default every 5 minutes, configurable via mqtt.status_interval)
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
Adds periodic MQTT status messages that include radio and device statistics, enabling downstream monitoring tools to track repeater health in real time.
What
<base_topic>/<node_name>/statusevery 5 minutes (configurable viamqtt.status_interval)."offline"status when the repeater disconnects unexpectedly.Message Format
{ "status": "online", "origin": "<node_name>", "origin_id": "<node_id>", "stats": { "uptime_secs": 3600, "noise_floor": -95, "tx_air_secs": 42, "rx_air_secs": 0, "recv_errors": 0 } }The format is compatible with meshcoretomqtt status messages, so tools like CoreScope can consume pyMC_Repeater status alongside other MeshCore nodes without any changes.
Configuration
Notes
rx_air_secsandrecv_errorsare currently hardcoded to0since pyMC_Repeater doesn't track those metrics yet. They're included so consumers can distinguish "not tracked" from "field missing".battery_mvis omitted (only relevant on embedded boards).