From 50bd343ac5fb74b372a14e8214bb7109048100cd Mon Sep 17 00:00:00 2001 From: Adam Nieto Date: Mon, 19 Oct 2026 10:32:39 -0500 Subject: [PATCH] feat(mqtt): per-slot IATA override (mqttN.iata) mqtt.iata is node-wide, so an observer feeding brokers with different region maps can't publish the right code to each. mqttN.iata overrides it for one slot; empty keeps the node-wide code, so existing nodes are unchanged. Stored as an optional per-slot JSON key, downgrade-safe. --- MQTT_IMPLEMENTATION.md | 24 +++++++- scripts/webconfig_mock_server.py | 10 +++- src/helpers/CommonCLI_Observer.cpp | 31 +++++++++- src/helpers/MQTTPrefsSerializer.h | 19 +++++++ src/helpers/MQTTPrefsStorage.h | 5 ++ src/helpers/MQTTTopicRouter.h | 11 ++++ src/helpers/WebConfigKeys.h | 2 +- src/helpers/bridges/MQTTBridge.cpp | 23 ++++---- src/helpers/bridges/MQTTBridge.h | 4 +- src/helpers/esp32/WebConfigServer.cpp | 1 + .../test_mqtt_prefs_serializer.cpp | 56 +++++++++++++++++++ .../test_mqtt_topic_router.cpp | 24 ++++++++ .../test_webconfig_keys.cpp | 1 + webui/index.html | 7 ++- 14 files changed, 200 insertions(+), 18 deletions(-) diff --git a/MQTT_IMPLEMENTATION.md b/MQTT_IMPLEMENTATION.md index b3384e22860..4ccfed426cc 100644 --- a/MQTT_IMPLEMENTATION.md +++ b/MQTT_IMPLEMENTATION.md @@ -64,7 +64,8 @@ set mqtt3.preset none # disable the slot Broker address, transport, and credentials ship in the firmware. The **Extra setup** column lists the presets that need more. Every preset except `meshrank` uses the -`meshcore/{iata}/…` topic layout, so `mqtt.iata` must be set. +`meshcore/{iata}/…` topic layout, so `mqtt.iata` must be set (or `mqttN.iata` for +that slot, see [Per-slot region codes](#per-slot-region-codes)). `get mqtt.presets` lists what the running firmware ships. The table matches the current build. @@ -147,6 +148,7 @@ Commands work over serial and over a remote admin login unless marked *serial on | `get/set mqttN.token ` | Per-slot token, e.g. MeshRank; `get` shows the value on serial only | | `get/set mqttN.topic