Repository navigation
Conversation
…s and systems to support building them
…cket size calculation
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.
Feature: Standalone MQTT Broker Gateway / Proxy
Overview
This pull request introduces the Standalone MQTT Gateway & Proxy subsystem. When enabled, the ESP32 operates as an autonomous 24/7 MQTT client for the connected Meshtastic radio ( when the radio has
proxy_to_clientenabled and mqtt enabled), eliminating the need to keep a mobile phone or desktop app continuously running.It also introduces crucial memory optimizations, dual-queue packet prioritization, lock-free telemetry, and thread priority tuning that should improve stability across all ESP32 and ESP32-S3 targets.
Key Features & Architectural Changes
1. Auto-Sync MQTT Gateway (Zero-Config)
ModuleConfig.mqttpackets over BLE to inherit broker address, port, credentials, root topic (msh,ptp, etc.), and TLS settings directly from the radio.want_config_idpacket upon BLE connection to immediately retrieve radio settings without waiting for heartbeats.MqttClientProxyMessageuplink packets, preventing duplicate publishes from connected phone apps.2. 3-Tier TLS Security Pipeline
x509_crt_bundle.bin) for verified TLS connections to public brokers (mqtt.meshtastic.org:8883, AWS IoT, HiveMQ, etc.).3. Dual-Queue Prioritization & Static
.bssSizingtcp_to_ble_queue) are drained first with 100ms backpressure, while background MQTT downlink packets (mqtt_to_ble_queue) are drained when idle using non-blocking (0tick) enqueues.BRIDGE_QUEUE_SIZE = 32andMQTT_QUEUE_SIZE = 16in static.bss(zero heap fragmentation).esp32dev), providing >5× safety margin against heap exhaustion during simultaneous TLS handshakes and WebUI requests.4. Thread Priorities & Deadlock-Free Concurrency
LwIP Stack: Priority 18AsyncTCP Worker: Priority 3mqtt_clientTask: Priority 2 (8KB stack)bridgeBleTask: Priority 1 (Core 1, 8KB stack, 1ms yield)bridgeNetTask: Priority 1 (Core 0, 4KB stack)diag_telemetry: Priority 1 (Core 0, 3KB stack, 15s interval)MqttLockGuardreleased prior to task lifecycle operations (esp_mqtt_client_start/destroy), preventing task-destruction deadlocks.5. Queue Drop Telemetry & WebUI Polish
tcp_to_ble_dropped,ble_to_tcp_dropped, andmqtt_to_ble_dropped).[Diag]log displays queue fill levels and drops inline:──────