Add MQTT neighbors functionality for PSRAM builds
- Introduced commands for periodic neighbors publishing: `get mqtt.neighbors`, `set mqtt.neighbors on|off`, `get mqtt.neighbors.interval`, and `set mqtt.neighbors.interval <hours>`. - Updated MQTT topics to include a new neighbors topic for cached zero-hop repeater neighbors. - Added JSON message format for neighbors, including fields for SNR, last-heard age, and status. - Enhanced CLI documentation to reflect new commands and settings. - Implemented neighbor discovery logic in MyMesh class, including handling responses and publishing neighbor data. - Adjusted MQTTBridge to manage neighbors JSON buffer and publish logic. This update enhances the MQTT implementation by allowing devices to share neighbor information, improving network awareness and connectivity.
This commit is contained in:
1 parent
ae045395f9
commit
6b3c543cba
11 files changed
+525
-5
No files matched your search
@@ -113,6 +113,17 @@ This document provides an overview of CLI commands that can be sent to MeshCore
|
||||
|
||||
---
|
||||
|
||||
### Discover neighbor scopes and publish to MQTT (PSRAM observer builds)
|
||||
|
||||
**Usage:**
|
||||
- `discover.scopes`
|
||||
|
||||
Queries cached zero-hop repeater neighbors for flood-allowed region scopes (`ANON_REQ_TYPE_REGIONS`), then publishes a retained JSON snapshot to `meshcore/{IATA}/{device}/neighbors`. Includes this node's own scopes in the `self` object.
|
||||
|
||||
**Note:** Requires `WITH_MQTT_BRIDGE`, `MAX_NEIGHBOURS`, and PSRAM (`BOARD_HAS_PSRAM`). Returns `Err - not supported (requires PSRAM)` on other builds.
|
||||
|
||||
---
|
||||
|
||||
## Statistics
|
||||
|
||||
### Clear Stats
|
||||
@@ -1103,6 +1114,21 @@ Requires WiFi connected and the MQTT bridge running.
|
||||
|
||||
---
|
||||
|
||||
#### Periodic neighbors/scopes MQTT publish (PSRAM observer builds)
|
||||
|
||||
**Usage:**
|
||||
- `get mqtt.neighbors`
|
||||
- `set mqtt.neighbors on|off`
|
||||
- `get mqtt.neighbors.interval`
|
||||
- `set mqtt.neighbors.interval <hours>`
|
||||
|
||||
**Parameters:**
|
||||
- `hours`: Interval between automatic `discover.scopes` runs (minimum **12**, default **24**)
|
||||
|
||||
**Note:** Requires PSRAM. Publishes to `meshcore/{IATA}/{device}/neighbors` (retained, QoS 1). Use `discover.scopes` for a one-shot publish.
|
||||
|
||||
---
|
||||
|
||||
#### View or change the speed of the bridge (RS-232 only)
|
||||
**Usage:**
|
||||
- `get bridge.baud`
|
||||
|
||||
Reference in new issue
Block a user