From 3cde9c105293db0e5f919558ba58e425ab8ddd01 Mon Sep 17 00:00:00 2001 From: agessaman Date: Wed, 13 May 2026 09:31:02 -0700 Subject: [PATCH] =?UTF-8?q?Update=20MQTT=20implementation=20for=20T-LoRa?= =?UTF-8?q?=20V2.1=E2=80=931.6=20observer=20configurations?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Added guidance for using a single active WSS broker preset in the T-LoRa V2.1–1.6 MQTT observer environments, clarifying that dual TLS sessions may fail due to memory constraints. - Updated partition table descriptions to reflect the new recommendation for the `LilyGo_TLora_V2_1_1_6_repeater_observer_mqtt` and `LilyGo_TLora_V2_1_1_6_room_server_observer_mqtt` targets. - Enhanced platformio.ini comments to emphasize the single broker usage and its implications for memory management. --- MQTT_IMPLEMENTATION.md | 4 +++- variants/lilygo_tlora_v2_1/platformio.ini | 5 +++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/MQTT_IMPLEMENTATION.md b/MQTT_IMPLEMENTATION.md index 93b2a4785..d61e57f75 100644 --- a/MQTT_IMPLEMENTATION.md +++ b/MQTT_IMPLEMENTATION.md @@ -160,6 +160,8 @@ pio run -e LilyGo_TLora_V2_1_1_6_room_server_observer_mqtt **TLora naming:** The env prefix `LilyGo_TLora_V2_1_1_6` is LilyGo’s **T-LoRa V2.1–1.6** board (SX1276); PlatformIO selects **`ttgo-lora32-v1`** (TTGO LoRa32 V1.0). **MQTT observer** envs extend a slim base **without** `sensor_base` so the image fits `min_spiffs`; **all other** `LilyGo_TLora_V2_1_1_6_*` targets still use optional I2C environmental sensors as before. The **`lilygo_tlora_c6`** variant is separate hardware (ESP32-C6). +**T-LoRa V2.1–1.6 MQTT observer — one WSS broker:** This hardware is **classic ESP32 without PSRAM**. Each WSS preset uses a full TLS stack and large contiguous heap allocations; **two active broker presets at once** typically fails the second connection (`mbedtls_ssl_setup` / `esp-tls` `0x8017`, low `IntMax` in `memory`). **Treat these observer builds as supporting one active cloud preset:** configure the broker you need in `mqtt1` or `mqtt2`, and set the other slot to `none` (e.g. `set mqtt2.preset none`). Use PSRAM-capable boards if you need multiple simultaneous MQTT uplinks. + ### Partition Table Changes — Merged Firmware Required Some MQTT observer builds use a non-default partition table to accommodate the larger firmware size (MQTT libraries, TLS, cert bundle, etc.). **When a board's partition table changes, you must flash the merged firmware (`*-merged.bin`) the first time** so the new partition layout and bootloader are written together. After that initial flash, standard OTA or non-merged updates will work normally. @@ -168,7 +170,7 @@ Some MQTT observer builds use a non-default partition table to accommodate the l |-------------|----------------|------------|---------------|-------| | `LilyGo_T3S3_sx1262_repeater_observer_mqtt` | `min_spiffs.csv` | 4 MB | 1.875 MB | Changed from default (1.25 MB) | | `LilyGo_T3S3_sx1262_room_server_observer_mqtt` | `min_spiffs.csv` | 4 MB | 1.875 MB | Changed from default (1.25 MB) | -| `LilyGo_TLora_V2_1_1_6_repeater_observer_mqtt` | `min_spiffs.csv` | 4 MB | 1.875 MB | TTGO LoRa32 V1.0; observer env omits `sensor_base` for flash budget (same `min_spiffs` as other TLora builds) | +| `LilyGo_TLora_V2_1_1_6_repeater_observer_mqtt` | `min_spiffs.csv` | 4 MB | 1.875 MB | TTGO LoRa32 V1.0; observer omits `sensor_base`. **One active WSS broker** recommended (no PSRAM; dual TLS usually fails on the second slot). | | `LilyGo_TLora_V2_1_1_6_room_server_observer_mqtt` | `min_spiffs.csv` | 4 MB | 1.875 MB | same | | `Station_G2_repeater_observer_mqtt` | `default_16MB.csv` | 16 MB | 6.25 MB | 16 MB flash board | | `Station_G2_room_server_observer_mqtt` | `default_16MB.csv` | 16 MB | 6.25 MB | 16 MB flash board | diff --git a/variants/lilygo_tlora_v2_1/platformio.ini b/variants/lilygo_tlora_v2_1/platformio.ini index 81603ead8..0a6da01c1 100644 --- a/variants/lilygo_tlora_v2_1/platformio.ini +++ b/variants/lilygo_tlora_v2_1/platformio.ini @@ -138,6 +138,10 @@ lib_deps = ${LilyGo_TLora_V2_1_1_6.lib_deps} ${esp32_ota.lib_deps} +; LilyGo T-LoRa V2.1-1.6 MQTT observer targets (ttgo-lora32-v1, classic ESP32, no PSRAM): +; Use ONE active WSS broker preset at a time. Two concurrent TLS sessions usually exhaust +; contiguous internal heap; the second slot fails (mbedtls_ssl_setup / esp-tls 0x8017). +; Set extra slots to "none" (e.g. set mqtt2.preset none). See MQTT_IMPLEMENTATION.md. [env:LilyGo_TLora_V2_1_1_6_repeater_observer_mqtt] extends = LilyGo_TLora_V2_1_1_6_core extra_scripts = @@ -182,6 +186,7 @@ lib_deps = JChristensen/Timezone paulstoffregen/Time@1.6.1 +; Same single-broker guidance as LilyGo_TLora_V2_1_1_6_repeater_observer_mqtt (see comment block above). [env:LilyGo_TLora_V2_1_1_6_room_server_observer_mqtt] extends = LilyGo_TLora_V2_1_1_6_core extra_scripts =