Preserve separate TLora Full transports within RAM budget

This commit is contained in:
mikecarper committed 2026-10-05 18:33:34 -07:00
1 parent 6765100c3a
commit 8d76923a4e
11 files changed
+207 -37

No files matched your search

+37 -6
View File
@@ -347,7 +347,6 @@ for env_name, rx, tx in (
("Heltec_v3_repeater_observer_mqtt", 5, 6),
("Heltec_WSL3_repeater_observer_mqtt", 5, 6),
("RAK_3112_repeater_observer_mqtt", 5, 6),
("LilyGo_TLora_V2_1_1_6_repeater_observer_mqtt_", 34, 25),
):
require(env_name, "build_flags", "WITH_MQTT_BRIDGE=1")
require(env_name, "build_flags", "WITH_RS232_BRIDGE=Serial2")
@@ -358,6 +357,14 @@ for env_name, rx, tx in (
require(env_name, "build_src_filter", "helpers/bridges/RS232Bridge.cpp")
reject(env_name, "build_flags", "RS232_BRIDGE_DEFAULT_ON")
# The T-LoRa runtime RAM budget cannot fit MQTT, ESP-NOW and UART together.
# Keep its UART in the normal Full image and its MQTT recipe independent.
tlora_observer = "LilyGo_TLora_V2_1_1_6_repeater_observer_mqtt_"
require(tlora_observer, "build_flags", "WITH_MQTT_BRIDGE=1")
reject(tlora_observer, "build_flags", "WITH_RS232_BRIDGE")
reject(tlora_observer, "build_flags", "RS232_BRIDGE_MERGED")
reject(tlora_observer, "build_src_filter", "helpers/bridges/RS232Bridge.cpp")
# MKE keeps its ordinary role and UART wiring while exposing the existing
# persistent bridge controls. The merged marker selects the disabled default;
# the explicit legacy bridge remains enabled for deliberate direct builds.
@@ -1086,10 +1093,28 @@ done
[ "$(select_ordinary_full_targets MKE_s3_repeater_bridge_espnow MKE_s3_repeater)" \
= MKE_s3_repeater ] \
|| fail "MKE S3 bridge input order changed its canonical Full image"
[ "$(select_ordinary_full_targets LilyGo_TLora_V2_1_1_6_repeater_bridge_espnow \
LilyGo_TLora_V2_1_1_6_repeater_observer_mqtt_)" \
= LilyGo_TLora_V2_1_1_6_repeater_observer_mqtt_ ] \
|| fail "TLora trailing-underscore observer failed to replace its ESP-NOW sibling"
tlora_normal=LilyGo_TLora_V2_1_1_6_repeater
tlora_observer=${tlora_normal}_observer_mqtt_
tlora_espnow=${tlora_normal}_bridge_espnow
[ "$(get_ordinary_full_group_key "$tlora_normal")" \
!= "$(get_ordinary_full_group_key "$tlora_observer")" ] \
|| fail "TLora RAM exception collapsed its independent UART and MQTT Full groups"
for tlora_order in normal-first observer-first bridge-first; do
case "$tlora_order" in
normal-first) tlora_candidates=("$tlora_normal" "$tlora_observer" "$tlora_espnow") ;;
observer-first) tlora_candidates=("$tlora_observer" "$tlora_espnow" "$tlora_normal") ;;
bridge-first) tlora_candidates=("$tlora_espnow" "$tlora_normal" "$tlora_observer") ;;
esac
mapfile -t tlora_selected < <(select_ordinary_full_targets "${tlora_candidates[@]}")
[ "${#tlora_selected[@]}" = 2 ] \
|| fail "TLora $tlora_order did not retain exactly two capacity-safe Full images"
[[ " ${tlora_selected[*]} " == *" $tlora_normal "* ]] \
|| fail "TLora $tlora_order discarded its UART Full image"
[[ " ${tlora_selected[*]} " == *" $tlora_observer "* ]] \
|| fail "TLora $tlora_order discarded its MQTT Full image"
[[ " ${tlora_selected[*]} " != *" $tlora_espnow "* ]] \
|| fail "TLora $tlora_order retained the replaced dedicated ESP-NOW image"
done
ESP32_FULL_BUILD=0
PLATFORMIO_BUILD_FLAGS=""
PLATFORMIO_BUILD_SRC_FILTER=""
@@ -1626,7 +1651,7 @@ fi
(
BUILD_PROFILE_FOR_TARGET=full
for uart_target in Heltec_v3_repeater Heltec_WSL3_repeater RAK_3112_repeater \
LilyGo_TLora_V2_1_1_6_repeater_observer_mqtt_; do
LilyGo_TLora_V2_1_1_6_repeater; do
BUILD_EXPECTATIONS=()
declare_build_capability_contract "$uart_target" ESP32_PLATFORM
[[ " ${BUILD_EXPECTATIONS[*]} " == *"bridge.rs232=_ZN11RS232Bridge5beginEv"* ]] \
@@ -1634,6 +1659,12 @@ fi
[[ " ${BUILD_EXPECTATIONS[*]} " == *"bridge.espnow=_ZN12ESPNowBridge5beginEv"* ]] \
|| fail "$uart_target Full contract omitted the linked ESP-NOW driver"
done
BUILD_EXPECTATIONS=()
declare_build_capability_contract LilyGo_TLora_V2_1_1_6_repeater_observer_mqtt_ ESP32_PLATFORM
[[ " ${BUILD_EXPECTATIONS[*]} " != *"bridge.rs232="* ]] \
|| fail "TLora MQTT capacity exception falsely promised a linked UART driver"
[[ " ${BUILD_EXPECTATIONS[*]} " == *"bridge.espnow=_ZN12ESPNowBridge5beginEv"* ]] \
|| fail "TLora MQTT capacity exception omitted its linked ESP-NOW driver"
)
# A WiFi base's final -UENABLE_OTA must not win over the Full Companion's
+47 -1
View File
@@ -1287,7 +1287,7 @@ console.log('combined UART/ESP-NOW picker modes, independent commands and histor
// MQTT, ESP-NOW and UART coexist in the same qualified Full artifact. UART
// instructions must never use MQTT's historical ESP-NOW bridge alias.
const tripleTargets = ['Heltec_v3_repeater', 'Heltec_WSL3_repeater',
'RAK_3112_repeater', 'LilyGo_TLora_V2_1_1_6_repeater_observer_mqtt_']
'RAK_3112_repeater']
.map(target => target + '-full-usb-wifi');
const tripleCatalog = picker.buildCatalog([
release(bridgeFamily, '2026-10-05T00:00:00Z', tripleTargets.map(target =>
@@ -1318,6 +1318,52 @@ for (const profile of tripleCatalog.profiles) {
assert.strictEqual(tripleCatalog.profiles.length, tripleTargets.length);
console.log('three-transport Full picker uses independent UART, MQTT and ESP-NOW controls');
// T-LoRa cannot fit all three transports in its runtime RAM budget. Both
// capacity-safe Full images remain selectable with their actual capabilities.
const tloraNormalTarget = 'LilyGo_TLora_V2_1_1_6_repeater-full-usb-wifi';
const tloraObserverTarget = 'LilyGo_TLora_V2_1_1_6_repeater_observer_mqtt_-full-usb-wifi';
const tloraCatalog = picker.buildCatalog([
release(bridgeFamily, '2026-10-05T00:00:00Z', [tloraNormalTarget, tloraObserverTarget]
.map(target => asset(target + '-ota-' + bridgeFamily + '.bin'))),
], {
familyTag: bridgeFamily,
profiles: {
[tloraNormalTarget]: {
platform: 'ESP32_PLATFORM', rs232: true, mqtt: false, espnowBridge: true,
updateMethods: ['wifi', 'lora'],
loggingModes: ['none', 'usb'], loggingControl: 'usb.logging',
},
[tloraObserverTarget]: {
platform: 'ESP32_PLATFORM', rs232: false, mqtt: true, espnowBridge: true,
updateMethods: ['wifi', 'lora'],
loggingModes: ['none', 'usb', 'wifi', 'both'], loggingControl: 'logging.output',
},
},
});
assert.strictEqual(tloraCatalog.profiles.length, 2);
const tloraNormalProfile = tloraCatalog.profiles.find(profile => profile.target === tloraNormalTarget);
const tloraObserverProfile = tloraCatalog.profiles.find(profile => profile.target === tloraObserverTarget);
assert(tloraNormalProfile && tloraObserverProfile);
assert.deepStrictEqual(picker.profileFieldValues(tloraNormalProfile, 'mode'),
['standard', 'rs232', 'espnow']);
assert.deepStrictEqual(picker.profileFieldValues(tloraObserverProfile, 'mode'),
['standard', 'espnow']);
assert.deepStrictEqual(picker.profileFieldValues(tloraNormalProfile, 'logging'), ['none', 'usb']);
assert.deepStrictEqual(picker.profileFieldValues(tloraObserverProfile, 'logging'),
['none', 'usb', 'wifi', 'both']);
assert(!picker.profileMatches(tloraNormalProfile, {logging: 'wifi'}, ['logging']));
assert(picker.profileMatches(tloraObserverProfile, {logging: 'wifi'}, ['logging']));
const tloraNormalDirections = picker.runtimeDirections(tloraNormalProfile, {mode: 'rs232'});
const tloraObserverDirections = picker.runtimeDirections(tloraObserverProfile, {mode: 'espnow'});
assert(tloraNormalDirections.some(section => /^RS232 bridge/.test(section.title)));
assert(tloraNormalDirections.some(section => section.title === 'ESP-NOW bridge'));
assert(!tloraNormalDirections.some(section => section.title === 'MQTT broker connections'));
assert(tloraObserverDirections.some(section => section.title === 'MQTT broker connections'));
assert(tloraObserverDirections.some(section => section.title === 'ESP-NOW bridge'));
assert(!tloraObserverDirections.some(section => /^RS232 bridge/.test(section.title)));
assert(!commands(tloraObserverDirections).some(command => command.startsWith('set rs232.')));
console.log('T-LoRa RAM exception preserves separate UART and MQTT Full picker choices');
// Partition expansion uses the packager's lookup and published utility assets,
// not hardware labels or guessed slugs (several historical names differ).
const migrationFamily = currentControls.familyTag;
+69 -8
View File
@@ -1,5 +1,5 @@
#!/usr/bin/env python3
"""The ordinary release has one ESP32 Full OTA identity per board and role."""
"""Full selection preserves qualified transports and board capacity exceptions."""
import sys
import unittest
@@ -23,7 +23,9 @@ class ReleaseFullSelectionTest(unittest.TestCase):
def test_full_uart_source_substitution_requires_linked_driver_proof(self):
for base in ("Heltec_v3_repeater", "Heltec_WSL3_repeater", "RAK_3112_repeater",
"LilyGo_TLora_V2_1_1_6_repeater"):
for suffix in ("", "_observer_mqtt", "_observer_mqtt_"):
suffixes = ("",) if base.startswith("LilyGo_TLora_") else (
"", "_observer_mqtt", "_observer_mqtt_")
for suffix in suffixes:
for fault in ("missing_capability", "missing_proof", "false_proof", "unverified"):
image = record(base + suffix, capabilities=("bridge.rs232", "bridge.espnow"))
manifest = image["manifest"]
@@ -40,8 +42,7 @@ class ReleaseFullSelectionTest(unittest.TestCase):
select_ordinary_full_records([image])
def test_new_combined_full_displaces_stale_plain_and_both_dedicated_bridges(self):
for base in ("Heltec_v3_repeater", "Heltec_WSL3_repeater", "RAK_3112_repeater",
"LilyGo_TLora_V2_1_1_6_repeater"):
for base in ("Heltec_v3_repeater", "Heltec_WSL3_repeater", "RAK_3112_repeater"):
stale = record(base, capabilities=("bridge.espnow",))
primary = record(base + "_observer_mqtt_",
capabilities=("bridge.rs232", "bridge.espnow"))
@@ -52,6 +53,65 @@ class ReleaseFullSelectionTest(unittest.TestCase):
with self.subTest(base=base, profile=profile):
self.assertEqual(select_ordinary_full_records(inputs), [primary])
def test_tlora_ram_exception_keeps_uart_and_mqtt_full_images(self):
base = "LilyGo_TLora_V2_1_1_6_repeater"
normal = record(base, capabilities=("bridge.rs232", "bridge.espnow"))
observer = record(base + "_observer_mqtt_", capabilities=("bridge.espnow",))
for profile in ("standard", "full"):
legacy = [record(base + "_bridge_" + bridge, profile)
for bridge in ("rs232", "espnow")]
for inputs in ([normal, observer] + legacy, legacy + [observer, normal],
[observer] + legacy + [normal]):
with self.subTest(profile=profile, first=inputs[0]["manifest"]["target"]):
selected = select_ordinary_full_records(inputs)
self.assertCountEqual(selected, [normal, observer])
self.assertEqual(len(selected), 2)
self.assertTrue(all(item is normal or item is observer for item in selected))
def test_tlora_observer_cannot_retire_uart_without_normal_driver_proof(self):
base = "LilyGo_TLora_V2_1_1_6_repeater"
observer = record(base + "_observer_mqtt_", capabilities=("bridge.espnow",))
for profile in ("standard", "full"):
uart = record(base + "_bridge_rs232", profile, capabilities=("bridge.rs232",))
wireless = record(base + "_bridge_espnow", profile, capabilities=("bridge.espnow",))
for inputs in ([observer, uart, wireless], [wireless, uart, observer]):
with self.subTest(profile=profile):
self.assertCountEqual(select_ordinary_full_records(inputs), [observer, uart])
for fault in ("missing_capability", "missing_proof", "false_proof", "unverified"):
normal = record(base, capabilities=("bridge.rs232", "bridge.espnow"))
manifest = normal["manifest"]
if fault == "missing_capability":
manifest["capabilities"].remove("bridge.rs232")
elif fault == "missing_proof":
manifest["verification"] = []
elif fault == "false_proof":
manifest["verification"][0]["present"] = False
else:
manifest["verified"] = False
for inputs in ([normal, observer], [observer, normal]):
with self.subTest(fault=fault):
with self.assertRaisesRegex(ValueError, "verified RS232 bridge"):
select_ordinary_full_records(inputs)
def test_tlora_legacy_espnow_needs_verified_replacement(self):
base = "LilyGo_TLora_V2_1_1_6_repeater"
for fault in ("missing_capability", "missing_proof", "false_proof", "unverified"):
observer = record(base + "_observer_mqtt_", capabilities=("bridge.espnow",))
manifest = observer["manifest"]
if fault == "missing_capability":
manifest["capabilities"] = []
elif fault == "missing_proof":
manifest["verification"] = []
elif fault == "false_proof":
manifest["verification"][0]["present"] = False
else:
manifest["verified"] = False
for profile in ("standard", "full"):
legacy = record(base + "_bridge_espnow", profile, capabilities=("bridge.espnow",))
with self.subTest(fault=fault, profile=profile):
self.assertCountEqual(select_ordinary_full_records([observer, legacy]),
[observer, legacy])
def test_meshtower_sd_primary_filters_stale_internal_images_without_relabeling(self):
primary = "Heltec_tower_v2_sdcard_repeater_lora_ota_no_external_sensors"
variants = []
@@ -102,8 +162,8 @@ class ReleaseFullSelectionTest(unittest.TestCase):
record("Station_G2_repeater_observer_mqtt"),
record("Tbeam_SX1262_repeater_bridge_espnow"),
record("Tbeam_SX1262_repeater_observer_mqtt", capabilities=("bridge.espnow",)),
record("LilyGo_TLora_V2_1_1_6_repeater"),
record("LilyGo_TLora_V2_1_1_6_repeater_observer_mqtt_", capabilities=("bridge.rs232",)),
record("LilyGo_TLora_V2_1_1_6_repeater", capabilities=("bridge.rs232", "bridge.espnow")),
record("LilyGo_TLora_V2_1_1_6_repeater_observer_mqtt_", capabilities=("bridge.espnow",)),
record("Meshadventurer_sx1262_repeater"),
record("Meshadventurer_sx1262_repeater_bridge_espnow"),
record("RAK_4631_repeater", platform="NRF52_PLATFORM"),
@@ -113,11 +173,12 @@ class ReleaseFullSelectionTest(unittest.TestCase):
"Heltec_v3_repeater", "Heltec_v3_room_server",
"Station_G2_repeater_observer_mqtt",
"Tbeam_SX1262_repeater_observer_mqtt",
"LilyGo_TLora_V2_1_1_6_repeater",
"LilyGo_TLora_V2_1_1_6_repeater_observer_mqtt_",
"Meshadventurer_sx1262_repeater_bridge_espnow",
"RAK_4631_repeater",
})
self.assertEqual(len(selected), 8) # standard V3 remains alongside Full V3
self.assertEqual(len(selected), 9) # standard V3 and both TLora Full profiles remain
def test_mke_combined_repeater_filters_stale_bridge_identities_without_relabeling(self):
primary = record("MKE_s3_repeater", capabilities=("bridge.rs232", "bridge.espnow"))
@@ -253,7 +314,7 @@ class ReleaseFullSelectionTest(unittest.TestCase):
def test_combined_observer_with_trailing_underscore_replaces_matching_espnow(self):
observer = record("LilyGo_TLora_V2_1_1_6_repeater_observer_mqtt_",
capabilities=("bridge.espnow", "bridge.rs232"))
capabilities=("bridge.espnow",))
legacy = record("LilyGo_TLora_V2_1_1_6_repeater_bridge_espnow",
capabilities=("bridge.espnow",))
for inputs in ([observer, legacy], [legacy, observer]):