From 60648142a239e7a43cd5db4f810e8baa03fc2965 Mon Sep 17 00:00:00 2001 From: Jared Dohrman Date: Fri, 10 Apr 2026 18:26:29 +1000 Subject: [PATCH] feat(mqtt,docs): add mqtt.status control and tighten migration guidance --- docs/custom-cli.md | 6 ++++++ docs/migration.md | 6 ++++-- examples/simple_repeater/MyMesh.cpp | 7 +++++++ 3 files changed, 17 insertions(+), 2 deletions(-) diff --git a/docs/custom-cli.md b/docs/custom-cli.md index 186bc74c..7e2a358a 100644 --- a/docs/custom-cli.md +++ b/docs/custom-cli.md @@ -12,6 +12,8 @@ These commands are available on `*_repeater_mqtt` firmware targets. - `get mqtt.status` - shows WiFi, NTP, IATA, endpoint status, and TX state +- `get mqtt.statuscfg` + - shows whether periodic status messages are enabled - `get mqtt.iata` - shows the IATA/location code used in MQTT topics - `set mqtt.iata ` @@ -42,6 +44,8 @@ These commands are available on `*_repeater_mqtt` firmware targets. - shows whether raw packet payloads are published - `set mqtt.raw on|off` - enables or disables the separate `raw` MQTT topic +- `set mqtt.status on|off` + - enables or disables periodic MQTT status publishing - `get mqtt.tx` - shows whether TX packets are included - `set mqtt.tx on|off` @@ -125,6 +129,8 @@ That allowlist currently includes: - `set mqtt.packets on|off` - `get mqtt.raw` - `set mqtt.raw on|off` +- `get mqtt.statuscfg` +- `set mqtt.status on|off` - `get mqtt.tx` - `set mqtt.tx on|off` - `get mqtt.eastmesh-au` diff --git a/docs/migration.md b/docs/migration.md index 3d94b762..1eac589d 100644 --- a/docs/migration.md +++ b/docs/migration.md @@ -27,6 +27,7 @@ Once the new firmware is flashed, set: - `set wifi.ssid ` - `set wifi.pwd ` - `set mqtt.iata ` +- `set mqtt.status on` ## Optional Settings @@ -53,6 +54,7 @@ Confirm the repeater is up and connected with: - `get wifi.status` - `get mqtt.status` +- `get mqtt.statuscfg` ## Validate In The Web Console @@ -94,11 +96,11 @@ If you flash without erase first, older legacy values may still remain in flash 1. Flash the new EastMesh firmware without erasing. 2. Open the serial CLI or companion app. -3. Set `wifi.ssid`, `wifi.pwd`, and `mqtt.iata`. +3. Set `wifi.ssid`, `wifi.pwd`, `mqtt.iata`, and `mqtt.status on`. 4. Optionally set `mqtt.owner` and `mqtt.email`. 5. If you previously had TX publishing disabled, set `mqtt.tx off`. 6. Reboot the repeater. -7. Verify with `get wifi.status` and `get mqtt.status`. +7. Verify with `get wifi.status`, `get mqtt.status`, and `get mqtt.statuscfg`. 8. Optionally confirm local web access with `set web on`, `get web.status`, and `https:///`. ## Related Docs diff --git a/examples/simple_repeater/MyMesh.cpp b/examples/simple_repeater/MyMesh.cpp index 9c8b4b5b..827d16dd 100644 --- a/examples/simple_repeater/MyMesh.cpp +++ b/examples/simple_repeater/MyMesh.cpp @@ -1337,6 +1337,8 @@ void MyMesh::handleCommand(uint32_t sender_timestamp, char *command, char *reply sprintf(reply, "> %s", mqtt.isPacketsEnabled() ? "on" : "off"); } else if (memcmp(command, "get mqtt.raw", 12) == 0) { sprintf(reply, "> %s", mqtt.isRawEnabled() ? "on" : "off"); + } else if (memcmp(command, "get mqtt.statuscfg", 18) == 0) { + sprintf(reply, "> %s", mqtt.isStatusEnabled() ? "on" : "off"); } else if (memcmp(command, "get mqtt.tx", 11) == 0) { sprintf(reply, "> %s", mqtt.isTxEnabled() ? "on" : "off"); } else if (memcmp(command, "get mqtt.eastmesh-au", 20) == 0 || memcmp(command, "get mqtt.eastmesh.au", 20) == 0) { @@ -1396,6 +1398,9 @@ void MyMesh::handleCommand(uint32_t sender_timestamp, char *command, char *reply } else if (memcmp(command, "set mqtt.raw ", 13) == 0) { mqtt.setRawEnabled(memcmp(&command[13], "on", 2) == 0); strcpy(reply, "OK"); + } else if (memcmp(command, "set mqtt.status ", 16) == 0) { + mqtt.setStatusEnabled(memcmp(&command[16], "on", 2) == 0); + strcpy(reply, "OK"); } else if (memcmp(command, "set mqtt.eastmesh-au ", 21) == 0 || memcmp(command, "set mqtt.eastmesh.au ", 21) == 0) { mqtt.setEndpointEnabled(0x01, memcmp(&command[21], "on", 2) == 0); strcpy(reply, "OK"); @@ -1448,6 +1453,7 @@ void MyMesh::runWebCommand(const char* command, char* reply, size_t reply_size) matches_exact("get mqtt.email") || matches_exact("get mqtt.packets") || matches_exact("get mqtt.raw") || + matches_exact("get mqtt.statuscfg") || matches_exact("get mqtt.tx") || matches_exact("get mqtt.eastmesh-au") || matches_exact("get mqtt.eastmesh.au") || @@ -1471,6 +1477,7 @@ void MyMesh::runWebCommand(const char* command, char* reply, size_t reply_size) matches_prefix("set mqtt.email ") || matches_prefix("set mqtt.packets ") || matches_prefix("set mqtt.raw ") || + matches_prefix("set mqtt.status ") || matches_prefix("set mqtt.tx ") || matches_prefix("set web ") || matches_prefix("set.web ") ||