feat(thinknode-m7): add repeater and room server observer variants

Adds ThinkNode_M7_repeater_observer_mqtt and
ThinkNode_M7_room_server_observer_mqtt, following the Station G3 observer
overlay: adafruit-full cert bundle, MQTT bridge + SNMP, pinned observer
lib_deps, and the quieter default logging profile.

WiFi-only for now. The M7 has an onboard CH390 Ethernet controller (used by
ThinkNode_M7_companion_radio_ethernet, and an lwIP netif so the MQTT data path
would work over it), but the bridge's link management is bound to the WiFi
station API, so Ethernet cannot carry MQTT yet.

The board has PSRAM, so MAX_NEIGHBOURS=50 enables WITH_MQTT_NEIGHBORS —
verified present in both images. Builds use 46.5% of the 3.19 MB app slot at
13.7% RAM, and build.sh emits the full artifact set (.bin, -merged.bin,
.partsig). The partition table is inherited from [ThinkNode_M7] unchanged, so
no merged first flash is needed; its signature is byte-identical to the T-Beam
Supreme observer builds (both default_8MB.csv).

Also fixes two pre-existing build failures on this board:

- [ThinkNode_M7] re-added a blanket helpers/*.cpp after arduino_base excludes
  the MQTT-only sources, so every M7 env failed on a missing Timezone.h. The
  glob was otherwise fully redundant with the base, so it is dropped rather
  than re-excluding the two files.
- ThinkNode_M7_companion_radio_ethernet sets DISPLAY_CLASS=NullDisplayDriver
  but never compiled NullDisplayDriver.cpp, which defines UIColor::window_bkg,
  so it failed at link. The ble and wifi envs both already list it.

All nine M7 envs now build. Observer env discovery picks up both new envs, and
the ArduinoJson pin check covers both new sections.
This commit is contained in:
agessaman
2026-07-31 09:34:42 -07:00
parent 5828a3c563
commit 37444be7b5
2 changed files with 110 additions and 1 deletions
+13
View File
@@ -199,8 +199,18 @@ pio run -e Station_G3_ESP32_room_server_observer_mqtt
# LilyGo T-LoRa V2.1-1.6 (TTGO LoRa32 V1.0)
pio run -e LilyGo_TLora_V2_1_1_6_repeater_observer_mqtt
pio run -e LilyGo_TLora_V2_1_1_6_room_server_observer_mqtt
# Elecrow ThinkNode M7
pio run -e ThinkNode_M7_repeater_observer_mqtt
pio run -e ThinkNode_M7_room_server_observer_mqtt
```
**ThinkNode M7 — WiFi only:** the M7 has an onboard CH390 Ethernet controller, and
`ThinkNode_M7_companion_radio_ethernet` uses it, but the MQTT bridge's link
management is bound to the WiFi station API, so the observer envs uplink over WiFi.
See `UPSTREAM_BUGS.md` for the Ethernet gap. The board has PSRAM, so these builds
get the PSRAM-only neighbors publication (`WITH_MQTT_NEIGHBORS`).
**TLora naming:** The env prefix `LilyGo_TLora_V2_1_1_6` is LilyGos **T-LoRa V2.11.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.11.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.
@@ -222,6 +232,9 @@ Some MQTT observer builds use a non-default partition table to accommodate the l
| `LilyGo_TBeam_1W_repeater_observer_mqtt` | `default_16MB.csv` | 16 MB | 6.25 MB | Set in `boards/t_beam_1w.json`; required vs implicit `default.csv` |
| `LilyGo_TBeam_1W_room_server_observer_mqtt` | `default_16MB.csv` | 16 MB | 6.25 MB | same |
Boards absent from this table need no special first flash: their observer envs use the
same partition table as the board's other firmwares.
**Settings loss when the layout changes**
A merged image writes a new bootloader **and** partition table at offset `0x0`. If that
+97 -1
View File
@@ -28,8 +28,9 @@ build_flags = ${esp32_base.build_flags}
-D P_LORA_TX_LED=46 ; blue
-D LR11X0_DIO_AS_RF_SWITCH=true
-D LR11X0_DIO3_TCXO_VOLTAGE=1.8
; No blanket +<helpers/*.cpp> here: it would undo arduino_base's exclusion of the
; MQTT-only sources, which need Timezone/NTPClient that only observer envs pull in.
build_src_filter = ${esp32_base.build_src_filter}
+<helpers/*.cpp>
+<helpers/sensors/EnvironmentSensorManager.cpp>
+<helpers/ui/MomentaryButton.cpp>
+<../variants/thinknode_m7>
@@ -167,6 +168,7 @@ build_src_filter = ${ThinkNode_M7.build_src_filter}
${ThinkNode_M7_ethernet.build_src_filter}
+<helpers/esp32/*.cpp>
+<helpers/ui/MomentaryButton.cpp>
+<helpers/ui/NullDisplayDriver.cpp> ; defines UIColor::window_bkg for DISPLAY_CLASS
+<../examples/companion_radio/*.cpp>
+<../examples/companion_radio/ui-orig/*.cpp>
lib_deps = ${ThinkNode_M7.lib_deps}
@@ -177,3 +179,97 @@ lib_deps = ${ThinkNode_M7.lib_deps}
extends = ThinkNode_M7
build_src_filter = ${ThinkNode_M7.build_src_filter}
+<../examples/kiss_modem/>
; MQTT observer envs are WiFi-only: the bridge's link management is bound to the
; WiFi station API, so the onboard CH390 cannot carry MQTT yet. The board has
; PSRAM, so MAX_NEIGHBOURS enables WITH_MQTT_NEIGHBORS (see MQTTBridge.h).
[env:ThinkNode_M7_repeater_observer_mqtt]
extends = ThinkNode_M7
extra_scripts =
${esp32_base.extra_scripts}
pre:scripts/generate_cert_bundle.py
board_ssl_cert_source = adafruit-full
board_build.embed_files = src/certs/x509_crt_bundle.bin
build_flags =
${ThinkNode_M7.build_flags}
-D ADVERT_NAME='"MQTT Observer"'
-D ADVERT_LAT=0.0
-D ADVERT_LON=0.0
-D ADMIN_PASSWORD='"password"'
-D MAX_NEIGHBOURS=50
-D WITH_MQTT_BRIDGE=1
-D MAX_MQTT_BROKERS=3
-D MQTT_MAX_PACKET_SIZE=1024
-D MQTT_DEBUG=1
# -D MESH_PACKET_LOGGING=1
# -D MESH_DEBUG=1
-D CONFIG_MBEDTLS_CERTIFICATE_BUNDLE=y
-D ESP32_CPU_FREQ=160
-D WITH_SNMP=1
# -D WIFI_SSID='"ssid"'
# -D WIFI_PWD='"password"'
# -D MQTT_SERVER='"your-mqtt-broker.com"'
# -D MQTT_PORT=1883
# -D MQTT_USERNAME='"your-username"'
# -D MQTT_PASSWORD='"your-password"'
build_src_filter = ${ThinkNode_M7.build_src_filter}
+<helpers/bridges/MQTTBridge.cpp>
+<helpers/MQTTMessageBuilder.cpp>
+<helpers/JWTHelper.cpp>
+<helpers/SNMPAgent.cpp>
+<../examples/simple_repeater>
lib_deps =
${ThinkNode_M7.lib_deps}
${esp32_ota.lib_deps}
elims/PsychicMqttClient@^0.2.4
bblanchon/ArduinoJson @ 7.4.3
arduino-libraries/NTPClient
JChristensen/Timezone
paulstoffregen/Time@1.6.1
0neblock/SNMP_Agent
[env:ThinkNode_M7_room_server_observer_mqtt]
extends = ThinkNode_M7
extra_scripts =
${esp32_base.extra_scripts}
pre:scripts/generate_cert_bundle.py
board_ssl_cert_source = adafruit-full
board_build.embed_files = src/certs/x509_crt_bundle.bin
build_flags =
${ThinkNode_M7.build_flags}
-D ADVERT_NAME='"ThinkNode M7 Room Observer"'
-D ADVERT_LAT=0.0
-D ADVERT_LON=0.0
-D ADMIN_PASSWORD='"password"'
-D ROOM_PASSWORD='"hello"'
-D MAX_NEIGHBOURS=50
-D WITH_MQTT_BRIDGE=1
-D MAX_MQTT_BROKERS=3
-D MQTT_MAX_PACKET_SIZE=1024
-D MQTT_DEBUG=1
# -D MESH_PACKET_LOGGING=1
# -D MESH_DEBUG=1
-D CONFIG_MBEDTLS_CERTIFICATE_BUNDLE=y
-D ESP32_CPU_FREQ=160
-D WITH_SNMP=1
# -D WIFI_SSID='"ssid"'
# -D WIFI_PWD='"password"'
# -D MQTT_SERVER='"your-mqtt-broker.com"'
# -D MQTT_PORT=1883
# -D MQTT_USERNAME='"your-username"'
# -D MQTT_PASSWORD='"your-password"'
build_src_filter = ${ThinkNode_M7.build_src_filter}
+<helpers/bridges/MQTTBridge.cpp>
+<helpers/MQTTMessageBuilder.cpp>
+<helpers/JWTHelper.cpp>
+<helpers/SNMPAgent.cpp>
+<../examples/simple_room_server>
lib_deps =
${ThinkNode_M7.lib_deps}
${esp32_ota.lib_deps}
elims/PsychicMqttClient@^0.2.4
bblanchon/ArduinoJson @ 7.4.3
arduino-libraries/NTPClient
JChristensen/Timezone
paulstoffregen/Time@1.6.1
0neblock/SNMP_Agent