Repository navigation
feat(mqtt): per-slot IATA override (mqttN.iata) - #69
Merged
agessaman merged 1 commit intoOct 21, 2026
Merged
Conversation
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.
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.
Why
mqtt.iatais node-wide, so every slot publishesmeshcore/<same code>/…. That breaks down when an observer feeds brokers whose region maps differ. In Texas, for example, MeshMapper has LBB (Lubbock) and MAF (Midland/Odessa) but no CRP (Corpus Christi) or ACT (Waco), while MeshTexas's broker is the reverse, and it rejects codes it doesn't know. Today a Corpus Christi observer can't be correct on both: whichever code it picks is wrong (or refused) on the other network.What
mqttN.iata <code>. Empty (the default) means "usemqtt.iata", so nothing changes for existing nodes.customslots without a template) and to{iata}in acustomtopic template. MeshRank topics carry no region code, so it has no effect there.mqtt.iata(exactly 3 alphanumerics, uppercased).mqttSlotIata()inMQTTTopicRouter.hpicks the effective code. An empty,XXX, or otherwise invalid override falls back to the global code, so a bad override can't take a working slot offline.isSlotReady) and theset mqttN.presethint now check the slot's effective code, so a slot with only an override counts as configured.MQTTBridge::isIATAValid()was replaced byslotIata()/isSlotIATAValid()(it had no other callers).Persistence
MQTTPrefs::mqtt_slot_iata[6][8], appended at the end likedisplay_timeout_secs.LegacyV1MQTTPrefsand the frozen binary layouts are untouched.iatakey inside eachslotNgroup, no format-version bump.PrefsWrittenBeforeSlotIataStillLoad).UnknownKeysInsideAKnownGroupAreDowngradeSafebehavior. The slot falls back tomqtt.iata.repairedset.Web config
iataadded toWC_ALLOWED_SLOT_KEYSand to the/api/configslot objects.noneslot except token-only (MeshRank) presets. CLI autocomplete table and the mock server updated.Tests
test_mqtt_topic_router: override precedence/fallback; override feeds MeshCore and custom-template topics.test_mqtt_prefs_serializer: round trip; pre-feature file loads; case repair and invalid-override clearing.test_webconfig_keys:mqttN.iatais allowlisted.pio test -e native: all 38 suites pass. Not yet built or tested on hardware.Notes
mqtt_slot_token. Setting it callsrestartBridgeSlot()like the other slot setters.scripts/webconfig_cli_audit.pyreportsgps diagmissing from the UI command table. That's pre-existing onobserver-firmware-devand unrelated to this change.