feat(mqtt): publish native MapReports for the official Meshtastic map - #116
feat(mqtt): publish native MapReports for the official Meshtastic map#116Meyblaubaer wants to merge 2 commits into
Conversation
There was a problem hiding this comment.
Pull request overview
This PR adds an opt-in, MQTT-only Meshtastic MapReport publisher so a Meshpoint can appear on the official Meshtastic map using the configured transmit identity (transmit.node_id) rather than the separate MQTT gateway identity.
Changes:
- Adds MapReport protobuf construction and a new MQTT publish path targeting
<topic_root>/<region>/2/map/. - Introduces a coordinator loop to publish MapReports on a bounded cadence (min 3600s) and tracks runtime status (
last_map_report_at). - Extends config/API/dashboard/docs/tests to support enabling MapReports plus interval and position-precision controls.
Reviewed changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/test_mqtt_config_routes.py | Extends MQTT config route tests to cover MapReport fields and min-interval validation. |
| tests/test_map_report.py | Adds unit tests for MapReport formatting, MQTT publishing behavior, and coordinator integration. |
| src/storage/node_repository.py | Adds optional protocol filter to get_active_count for MapReport “heard nodes” counts. |
| src/relay/mqtt_publisher.py | Adds publish_map_report() and runtime status tracking for MapReport publishing. |
| src/relay/map_report.py | Introduces MapReport + ServiceEnvelope builder and coordinate rounding logic. |
| src/coordinator.py | Adds background task/loop to periodically publish MapReports based on config. |
| src/config.py | Adds MQTT MapReport configuration defaults. |
| src/api/routes/mqtt_config_routes.py | Surfaces MapReport config in dashboard status and persists/validates via API. |
| frontend/js/configuration/mqtt_card.js | Adds dashboard controls for MapReport enable/interval/precision. |
| docs/MQTT-AND-MESHRADAR.md | Documents how to enable native MapReport publishing and its privacy constraints. |
| docs/CONFIGURATION.md | Documents new MQTT configuration keys for MapReport support. |
| docs/CHANGELOG.md | Adds unreleased changelog entry for native MQTT MapReport. |
| config/default.yaml | Adds defaults for MapReport-related MQTT settings. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
|
Thanks for this, @Meyblaubaer. Merged into
Follow-up on our side (not attributed to you): require Closing this PR against Hardware bake still welcome when you can: enable MapReport against |
|
Landed on feat/v0.7.8 rather than main; see comment above. |
What changed
MAP_REPORT_APPpublishing on<topic_root>/<region>/2/map/.transmit.node_idfor both the packet source and ServiceEnvelope gateway ID, keeping it separate from the capture gateway identity.Closes #115
Why
The existing MQTT publisher forwards captured traffic with a separate gateway identity. It does not publish a native map report for the configured Meshpoint transmit identity, so the Meshpoint node may not appear on the official Meshtastic map.
Safety and compatibility
device.latitude,device.longitude, andtransmit.node_id./2/map/topic shape.Testing
27 passed: MapReport formatter/publisher/coordinator, MQTT API, and node repository targeted tests.938 passed, 68 subtests passed: broad suite excluding hardware/update tests that requiresudoand/opt/meshpointon the host.sudoor write/opt/meshpoint.node --check frontend/js/configuration/mqtt_card.jsgit diff --checkpassed for changed files.Hardware and region
Risks
The report intentionally shares public node identity and approximate location data. The feature is explicit opt-in, clearly labeled in the dashboard and documentation, and bounded to the Meshtastic-supported privacy range and cadence.
AI assistance
This focused change was developed with Codex assistance and reviewed through targeted protocol tests plus the broader project test suite.