Split FULL MQTT and logging profiles

This commit is contained in:
mikecarper committed 2026-07-29 13:35:25 -07:00
1 parent a6ace6076c
commit 6460aaa53b
6 files changed
+101 -78

No files matched your search

+76 -57
View File
@@ -73,9 +73,9 @@ Commands:
list|-l: List firmwares available to build.
build-firmware <target>: Build the firmware for the given build target.
build-firmwares: Build all firmwares for all targets.
build-firmwares-logging-matrix: Build all firmwares in standard, logging, MQTT, FULL ESP32, and FULL ESP32 logging profiles, logging each target under out/build-logs/ and continuing after failures.
build-full-esp32-firmwares: Build only feature-complete ESP32 profiles with 254 neighbors, LoRa OTA, and expanded dual-OTA partitions.
build-full-esp32-logging-firmwares: Build only feature-complete ESP32 profiles with 254 neighbors, logging, LoRa OTA, and expanded dual-OTA partitions.
build-firmwares-logging-matrix: Build all firmwares in standard, logging, MQTT, FULL ESP32 MQTT, and FULL ESP32 logging (no MQTT) profiles, logging each target under out/build-logs/ and continuing after failures.
build-full-esp32-firmwares: Build only feature-complete ESP32 MQTT profiles with 254 neighbors, LoRa OTA, and expanded dual-OTA partitions.
build-full-esp32-logging-firmwares: Build only feature-complete ESP32 profiles with 254 neighbors, logging, MQTT disabled, LoRa OTA, and expanded dual-OTA partitions.
build-matching-firmwares <build-match-spec>: Build all firmwares for build targets containing the string given for <build-match-spec>.
build-companion-firmwares: Build all companion firmwares for all build targets.
build-repeater-firmwares: Build all repeater firmwares for all build targets.
@@ -364,13 +364,13 @@ prompt_for_build_mode() {
local options=(
"Build one firmware target"
"Build all firmwares"
"Build all firmwares in 5 profiles (standard, logging, MQTT, full ESP32, full ESP32 logging)"
"Build all firmwares in 5 profiles (standard, logging, MQTT, full ESP32 MQTT, full ESP32 logging without MQTT)"
"Build all repeater firmwares"
"Build all companion firmwares"
"Build all chat room server firmwares"
"Build all sensor firmwares"
"Build only FULL ESP32 firmwares (all features and LoRa OTA)"
"Build only FULL ESP32 logging firmwares (all features, logging, and LoRa OTA)"
"Build only FULL ESP32 MQTT firmwares (all features, MQTT, and LoRa OTA)"
"Build only FULL ESP32 logging firmwares (all features, logging, no MQTT, and LoRa OTA)"
)
echo "No command provided. Select a build action:"
@@ -434,7 +434,7 @@ prompt_for_single_target_build_profile() {
local options=(
"Standard/custom build"
"FULL everything (all features, 254 neighbors, logging, LoRa OTA, expanded dual-OTA partitions)"
"FULL everything (all features, 254 neighbors, logging, MQTT off, LoRa OTA, expanded dual-OTA partitions)"
)
echo "Select the Option 1 build profile:"
@@ -453,7 +453,7 @@ prompt_for_single_target_build_profile() {
;;
2)
SINGLE_TARGET_FULL_BUILD=1
echo "Using FULL everything: all features, 254 neighbors, logging, LoRa OTA, and expanded dual-OTA partitions."
echo "Using FULL everything: all features, 254 neighbors, logging, MQTT off, LoRa OTA, and expanded dual-OTA partitions."
return 0
;;
esac
@@ -1530,6 +1530,40 @@ is_mqtt_bridge_target() {
[ "${PIO_ENV_MQTT_BY_NAME[$1]:-0}" == "1" ]
}
get_mqtt_enabled_target() {
local target=$1
if is_mqtt_bridge_target "$target"; then
echo "$target"
elif is_mqtt_bridge_target "${target}_mqtt"; then
echo "${target}_mqtt"
elif is_mqtt_bridge_target "${target}_observer_mqtt"; then
echo "${target}_observer_mqtt"
else
return 1
fi
}
get_mqtt_disabled_target() {
local target=$1
local candidate=$target
if is_mqtt_bridge_target "$target"; then
if [[ "$target" == *_observer_mqtt ]]; then
candidate=${target%_observer_mqtt}
elif [[ "$target" == *_companion_radio_wifi_mqtt ]]; then
candidate=${target%_mqtt}
else
return 1
fi
fi
if ! is_supported_build_env "$candidate" || is_mqtt_bridge_target "$candidate"; then
return 1
fi
echo "$candidate"
}
normalize_resolved_targets_for_mqtt() {
local command=$1
local target
@@ -1561,26 +1595,9 @@ normalize_resolved_targets_for_mqtt() {
for target in "${candidates[@]}"; do
candidate=""
if [ "${MQTT_BRIDGE_OVERRIDE,,}" == "on" ]; then
if is_mqtt_bridge_target "$target"; then
candidate=$target
elif is_mqtt_bridge_target "${target}_mqtt"; then
candidate="${target}_mqtt"
elif is_mqtt_bridge_target "${target}_observer_mqtt"; then
candidate="${target}_observer_mqtt"
fi
candidate=$(get_mqtt_enabled_target "$target") || candidate=""
else
if is_mqtt_bridge_target "$target"; then
if [[ "$target" == *_observer_mqtt ]]; then
candidate=${target%_observer_mqtt}
elif [[ "$target" == *_companion_radio_wifi_mqtt ]]; then
candidate=${target%_mqtt}
fi
if ! is_supported_build_env "$candidate" || is_mqtt_bridge_target "$candidate"; then
candidate=""
fi
else
candidate=$target
fi
candidate=$(get_mqtt_disabled_target "$target") || candidate=""
fi
if [ -z "$candidate" ]; then
@@ -2504,8 +2521,9 @@ run_full_esp32_profile() {
shift 2
local targets=("$@")
local target
local full_standard_targets=()
local full_mqtt_targets=()
local full_target
local full_targets=()
local -A seen_full_targets=()
local original_meshdebug_override=$MESHDEBUG_OVERRIDE
local original_packet_logging_override=$PACKET_LOGGING_OVERRIDE
local original_mqtt_bridge_override=$MQTT_BRIDGE_OVERRIDE
@@ -2516,51 +2534,52 @@ run_full_esp32_profile() {
local pass_status=0
for target in "${targets[@]}"; do
if ! supports_esp32_full_build "$target"; then
full_target=""
if [ "$logging_mode" = "on" ]; then
full_target=$(get_mqtt_disabled_target "$target") || full_target=""
else
full_target=$(get_mqtt_enabled_target "$target") || full_target=""
fi
if [ -z "$full_target" ] || ! supports_esp32_full_build "$full_target"; then
continue
fi
if is_mqtt_bridge_target "$target"; then
full_mqtt_targets+=("$target")
else
full_standard_targets+=("$target")
if [ -z "${seen_full_targets[$full_target]+x}" ]; then
full_targets+=("$full_target")
seen_full_targets["$full_target"]=1
fi
done
if [ ${#full_standard_targets[@]} -eq 0 ] && [ ${#full_mqtt_targets[@]} -eq 0 ]; then
echo "${profile_label}: no feature-different ESP32 FULL targets resolved; skipping."
if [ ${#full_targets[@]} -eq 0 ]; then
if [ "$logging_mode" = "on" ]; then
echo "${profile_label}: no non-MQTT ESP32 FULL targets resolved; skipping."
else
echo "${profile_label}: no MQTT ESP32 FULL targets resolved; skipping."
fi
return 0
fi
if [ "$logging_mode" = "on" ]; then
echo "${profile_label}: building $((${#full_standard_targets[@]} + ${#full_mqtt_targets[@]})) feature-complete ESP32 target(s) with ${ESP32_FULL_MAX_NEIGHBOURS} neighbors, logging, and expanded dual-OTA partitions."
echo "FULL logging artifacts include LoRa OTA and use filename form: name-full-logging-ota-version."
echo "${profile_label}: building ${#full_targets[@]} feature-complete ESP32 target(s) with ${ESP32_FULL_MAX_NEIGHBOURS} neighbors, logging on, MQTT off, and expanded dual-OTA partitions."
echo "FULL logging artifacts exclude MQTT, include LoRa OTA, and use filename form: name-full-logging-ota-version."
MESHDEBUG_OVERRIDE="on"
PACKET_LOGGING_OVERRIDE="on"
MQTT_BRIDGE_OVERRIDE="off"
FIRMWARE_FILENAME_INFIX="full-logging"
else
echo "${profile_label}: building $((${#full_standard_targets[@]} + ${#full_mqtt_targets[@]})) feature-complete ESP32 target(s) with ${ESP32_FULL_MAX_NEIGHBOURS} neighbors and expanded dual-OTA partitions."
echo "FULL artifacts include LoRa OTA and use filename form: name-full-ota-version."
echo "${profile_label}: building ${#full_targets[@]} feature-complete ESP32 MQTT target(s) with ${ESP32_FULL_MAX_NEIGHBOURS} neighbors, logging off, and expanded dual-OTA partitions."
echo "FULL artifacts include MQTT and LoRa OTA and use filename form: name-full-ota-version."
MESHDEBUG_OVERRIDE="off"
PACKET_LOGGING_OVERRIDE="off"
MQTT_BRIDGE_OVERRIDE="on"
FIRMWARE_FILENAME_INFIX="full"
fi
echo "Flash the matching merged image once to install the expanded partition table."
MQTT_DEBUG_OVERRIDE="off"
ESP32_FULL_BUILD=1
if [ ${#full_standard_targets[@]} -gt 0 ]; then
MQTT_BRIDGE_OVERRIDE="off"
run_logged_build_targets "${full_standard_targets[@]}"
pass_status=$?
if [ "$pass_status" -ne 0 ]; then build_status=1; fi
fi
if [ ${#full_mqtt_targets[@]} -gt 0 ]; then
MQTT_BRIDGE_OVERRIDE="on"
run_logged_build_targets "${full_mqtt_targets[@]}"
pass_status=$?
if [ "$pass_status" -ne 0 ]; then build_status=1; fi
fi
run_logged_build_targets "${full_targets[@]}"
pass_status=$?
if [ "$pass_status" -ne 0 ]; then build_status=1; fi
MESHDEBUG_OVERRIDE=$original_meshdebug_override
PACKET_LOGGING_OVERRIDE=$original_packet_logging_override
@@ -2576,7 +2595,7 @@ run_full_esp32_build_targets() {
local logging_mode=$1
shift
local targets=("$@")
local profile_name="FULL"
local profile_name="FULL MQTT"
local build_status=0
if [ "$logging_mode" = "on" ]; then
@@ -2835,14 +2854,14 @@ main() {
prompt_for_build_mode
if [ "$SINGLE_TARGET_FULL_BUILD" = "1" ]; then
echo "Skipping separate debug and MQTT prompts; FULL everything enables the complete feature and logging profile."
echo "Skipping separate debug and MQTT prompts; FULL everything enables logging and explicitly disables MQTT."
elif is_automatic_profile_command "${SELECTED_COMMAND_ARGS[0]}"; then
if is_logging_matrix_command "${SELECTED_COMMAND_ARGS[0]}"; then
echo "Skipping debug and MQTT prompts; this action builds all five profiles automatically."
elif is_full_esp32_logging_command "${SELECTED_COMMAND_ARGS[0]}"; then
echo "Skipping debug and MQTT prompts; this action builds only the FULL ESP32 logging profile."
echo "Skipping debug and MQTT prompts; this action builds only the FULL ESP32 logging profile with MQTT disabled."
else
echo "Skipping debug and MQTT prompts; this action builds only the FULL ESP32 profile."
echo "Skipping debug and MQTT prompts; this action builds only the FULL ESP32 MQTT profile."
fi
else
prompt_for_mqtt_bridge_build_setting
+10 -9
View File
@@ -255,8 +255,9 @@ In this case WebConfig owns WiFi only while it is needed. Stopping the portal
disconnects WiFi and turns the WiFi radio off. There is no persistent MQTT
connection keeping WiFi active.
FULL standard and FULL logging repeater/room-server builds provide these
CLI controls and status checks even though they do not include MQTT:
FULL MQTT and FULL logging repeater/room-server builds both provide these CLI
controls and status checks. FULL MQTT includes the MQTT bridge; FULL logging
does not:
```text
get wifi.ssid
@@ -334,15 +335,15 @@ role.
| Standard | Uses the selected target's role. Ordinary portable ESP32 repeater/room-server artifacts omit WebConfig to fit the legacy app slot. Explicit MQTT and WiFi-companion targets still use WiFi. |
| Logging | Enables USB/debug packet logging and disables the MQTT bridge. Logging output is not an MQTT uplink. |
| MQTT | Builds explicit MQTT observer or WiFi-companion-MQTT targets with USB packet logging off. |
| FULL ESP32 | Uses expanded dual-OTA partitions, retains LoRa OTA, restores full-size ESP32 features such as WebConfig where supported, and exposes the TCP 5001 OTA seeder while WiFi is active. MQTT is present only when the selected target is an MQTT target. |
| FULL ESP32 logging | Same expanded/full feature and OTA profile with debug and packet logging enabled. An MQTT target retains MQTT; a standard target remains non-MQTT. |
| FULL ESP32 | Uses the board's MQTT target with logging off, expanded dual-OTA partitions, 254 neighbors, LoRa OTA, and full-size ESP32 features such as WebConfig where supported. |
| FULL ESP32 logging | Uses the board's non-MQTT target with debug and packet logging enabled, expanded dual-OTA partitions, 254 neighbors, and LoRa OTA. |
| LoRa-OTA no-external-sensors | A small radio-only repeater image; no WiFi or MQTT. |
The interactive Option 1 **FULL everything** choice means every supported
feature for the selected ESP32 target, including logging, LoRa OTA, WebConfig,
and expanded dual-OTA partitions. It does not add an unrelated transport to a
different role: select an `*_observer_mqtt` or
`*_companion_radio_wifi_mqtt` target when MQTT is required.
The interactive Option 1 **FULL everything** choice selects the FULL logging
profile: logging is enabled and MQTT is disabled. The standalone FULL ESP32
profile and Profile 4 of the five-profile matrix use the matching MQTT target
instead. Both FULL profiles include LoRa OTA, WebConfig where supported, 254
neighbors, and expanded dual-OTA partitions.
FULL images change the ESP32 partition layout. Flash the matching
`*-merged.bin` once when installing that layout. A partition-layout change can
+2 -2
View File
@@ -34,8 +34,8 @@ administrator.
| LoRa-OTA (`-ota-`) | LoRa OTA adds the `ota ...` commands; it does not otherwise reduce the role CLI. A portable OTA artifact can still have the portable restrictions described below. |
| Portable MQTT observer | Keeps MQTT/WiFi commissioning, bridge control, radio essentials, update commands, basic identity/status commands, `neighbors`, and `discover.neighbors`. The large repeater administration tree is omitted to fit the legacy ESP32 application slot. |
| Portable ESP-NOW bridge | Keeps the repeater's role-specific handlers and a reduced common configuration surface containing radio and bridge essentials. |
| FULL ESP32 | Removes size-based CLI cuts and restores the complete command surface supported by the role and hardware. |
| FULL ESP32 logging | Same command coverage as FULL ESP32, with debug and packet logging enabled. |
| FULL ESP32 | Uses the matching MQTT target with logging off, removes size-based CLI cuts, and restores the complete command surface supported by that role and hardware. |
| FULL ESP32 logging | Uses the matching non-MQTT target with debug and packet logging enabled and the complete command surface supported by that role and hardware. |
| `no_external_sensors` | Removes optional external-sensor drivers and their settings; it does not remove core repeater discovery or routing commands. |
`logging`, `OTA`, and `FULL` describe independent build features. Do not infer
+4 -3
View File
@@ -189,7 +189,7 @@ single-command mode. A command that stops WebConfig, changes its WiFi
connection, disables `wifi.cli`, or reboots the node stops the remaining block
and can close the page before its reply is collected.
On FULL standard and FULL logging ESP32 repeater/room-server builds,
On FULL MQTT and FULL logging ESP32 repeater/room-server builds,
`get wifi.ssid` reports the saved standalone WebConfig network and
`get wifi.status` reports whether WiFi is unconfigured, off, connecting,
running the setup AP, failed, or connected. A connected result includes the
@@ -310,8 +310,9 @@ draining the serial port.
Ordinary `-logging-` artifacts keep packet logging separate from LoRa OTA.
Use the separately named `-ota-` artifact when LoRa OTA is required. A
`-full-logging-ota-` artifact is intentionally the exception: FULL profiles
include every supported feature.
`-full-logging-ota-` artifact is intentionally the exception: it combines
logging with LoRa OTA and the expanded FULL feature set, while MQTT remains
disabled.
### Begin capture of rx log to node storage
**Usage:** `log start`
+3 -2
View File
@@ -57,8 +57,9 @@ not currently have a safe self-apply path and therefore cannot install LoRa firm
ESP32 `*-full-ota-*` artifacts retain all compiled features and enable LoRa OTA for every FULL role,
including room servers, sensors, observers, and bridges. A FULL image requires its expanded partition table:
install the matching merged image over USB once before installing later non-merged FULL updates over LoRa.
Use a `*-full-logging-ota-*` artifact when the same complete feature set is needed with USB debug and packet
logging enabled. The logging profile is intended for diagnostics and can produce substantial serial output.
The `*-full-ota-*` profile uses MQTT with logging off. Use a `*-full-logging-ota-*` artifact when USB debug
and packet logging are needed instead; that diagnostic profile explicitly disables MQTT and can produce
substantial serial output.
### Choose the source radio
+6 -5
View File
@@ -144,16 +144,17 @@ image is rejected before any partial radio or string fields are applied, then re
Option 3 in `build.sh` also emits `*-full-ota-*` and `*-full-logging-ota-*` ESP32 artifacts for
non-companion roles where the portable profile removes a compiled feature and for the constrained companion
fallbacks described above. Menu option 8, or `build-full-esp32-firmwares`, builds only the logging-off FULL
artifacts. Menu option 9, or `build-full-esp32-logging-firmwares`, builds only the FULL logging artifacts.
FULL builds restore WebConfig, display support, optional external sensors, the full CLI and observer feature
fallbacks described above. Menu option 8, or `build-full-esp32-firmwares`, builds the logging-off FULL
artifacts from matching MQTT targets. Menu option 9, or `build-full-esp32-logging-firmwares`, builds the
FULL logging artifacts from matching non-MQTT targets.
FULL builds restore WebConfig, display support, optional external sensors, and the full role CLI and feature
set,
full ElegantOTA where that target declares the required library, and LoRa OTA for every included role,
including room servers, sensors, observers, and bridges. They use expanded A/B partition
tables: 1984 KiB application slots on 4 MiB boards and the framework's larger dual-OTA tables on 8 MiB
and 16 MiB boards. Explicit `*_lora_ota_no_external_sensors` targets are not duplicated; their ordinary
repeater build is the FULL, sensor-enabled counterpart. The `*-full-logging-ota-*` profile additionally
enables USB debug and packet logging, including on MQTT observer targets. Install a matching
repeater build is the FULL, sensor-enabled counterpart. The `*-full-logging-ota-*` profile enables USB
debug and packet logging and explicitly disables MQTT. Install a matching
`*-full-ota-*-merged.bin` or `*-full-logging-ota-*-merged.bin` over USB once to write the expanded partition
table. After that, its matching non-merged FULL application image can be installed through USB, WiFi OTA,
or LoRa OTA. Do not install a non-merged FULL image onto a node that still has its old partition table.