From d6869b0af9f396d87fea43d2f58754c6b7468098 Mon Sep 17 00:00:00 2001 From: mikecarper Date: Thu, 10 Sep 2026 17:44:55 -0700 Subject: [PATCH] Default Cascade profiles to CAD off --- RESTORE_UPSTREAM_NOTES.md | 5 +++-- build.sh | 4 ++-- docs/cli_commands.md | 4 +++- examples/simple_repeater/MyMesh.cpp | 2 +- examples/simple_room_server/MyMesh.cpp | 2 +- examples/simple_sensor/SensorMesh.cpp | 2 +- 6 files changed, 11 insertions(+), 8 deletions(-) diff --git a/RESTORE_UPSTREAM_NOTES.md b/RESTORE_UPSTREAM_NOTES.md index 6d5bb945..ef422874 100644 --- a/RESTORE_UPSTREAM_NOTES.md +++ b/RESTORE_UPSTREAM_NOTES.md @@ -82,8 +82,9 @@ The current tree contains both restored capabilities: - **`cad_enabled`** is present in common preferences, load/save paths, and the `get/set cad` CLI. Repeater, room-server, sensor, and Companion integrations - feed it to `RadioLibWrapper::setCADEnabled()`. Target-default builds default - CAD off; the Cascade profile supplies `DEFAULT_CAD_ENABLED=1`. + feed it to `RadioLibWrapper::setCADEnabled()`. The Cascade profile supplies + `DEFAULT_CAD_ENABLED=0` for fresh settings across all roles; saved CAD settings + take precedence after an upgrade. - **`radio_fem_rxgain`** is persisted and exposed as `get/set radio.fem.rxgain`. Supported boards implement `setLoRaFemLnaEnabled()`; unsupported boards reject the operation rather than diff --git a/build.sh b/build.sh index f5eae190..bd708075 100755 --- a/build.sh +++ b/build.sh @@ -1279,7 +1279,7 @@ prompt_for_radio_build_settings() { prompt_for_firmware_profile_settings() { local -a options=( - "Cascade (default): power saving + RXPS on / WiFi power save=min / path.hash.mode=2 / loop.detect=minimal / cad=on / rxdelay=2 / agc.reset.interval=8 / advert.interval=0 / flood.advert.interval=83 / multi.acks=1 / companion.manual.add=1 / companion.autoadd=0" + "Cascade (default): power saving + RXPS on / WiFi power save=min / path.hash.mode=2 / loop.detect=minimal / cad=off / rxdelay=2 / agc.reset.interval=8 / advert.interval=0 / flood.advert.interval=83 / multi.acks=1 / companion.manual.add=1 / companion.autoadd=0" "Keep target defaults" ) @@ -3674,7 +3674,7 @@ apply_radio_overrides() { apply_firmware_profile_overrides() { case "${FIRMWARE_PROFILE_OVERRIDE,,}" in cascade) - export PLATFORMIO_BUILD_FLAGS="${PLATFORMIO_BUILD_FLAGS} -DCASCADE_PROFILE=1 -DDEFAULT_PATH_HASH_MODE=2 -DDEFAULT_LOOP_DETECT=1 -DDEFAULT_CAD_ENABLED=1 -DDEFAULT_RX_DELAY_BASE=2.0f -DDEFAULT_AGC_RESET_INTERVAL_SECONDS=8 -DDEFAULT_ADVERT_INTERVAL_MINUTES=0 -DDEFAULT_FLOOD_ADVERT_INTERVAL_HOURS=83 -DDEFAULT_MULTI_ACKS=1 -DDEFAULT_MANUAL_ADD_CONTACTS=1 -DDEFAULT_AUTOADD_CONFIG=0 -DDEFAULT_POWERSAVING_ENABLED=1 -DDEFAULT_RXPS_ENABLED=1 -DDEFAULT_RXPS_LEVEL=8 -DDEFAULT_RXPS_PREAMBLE=16 -DRXPS_FIXED_ENABLED=1 -DRXPS_FIXED_LEVEL=8 -DRXPS_FIXED_PREAMBLE=16 -DDEFAULT_WIFI_POWER_SAVE_MODE=0" + export PLATFORMIO_BUILD_FLAGS="${PLATFORMIO_BUILD_FLAGS} -DCASCADE_PROFILE=1 -DDEFAULT_PATH_HASH_MODE=2 -DDEFAULT_LOOP_DETECT=1 -DDEFAULT_CAD_ENABLED=0 -DDEFAULT_RX_DELAY_BASE=2.0f -DDEFAULT_AGC_RESET_INTERVAL_SECONDS=8 -DDEFAULT_ADVERT_INTERVAL_MINUTES=0 -DDEFAULT_FLOOD_ADVERT_INTERVAL_HOURS=83 -DDEFAULT_MULTI_ACKS=1 -DDEFAULT_MANUAL_ADD_CONTACTS=1 -DDEFAULT_AUTOADD_CONFIG=0 -DDEFAULT_POWERSAVING_ENABLED=1 -DDEFAULT_RXPS_ENABLED=1 -DDEFAULT_RXPS_LEVEL=8 -DDEFAULT_RXPS_PREAMBLE=16 -DRXPS_FIXED_ENABLED=1 -DRXPS_FIXED_LEVEL=8 -DRXPS_FIXED_PREAMBLE=16 -DDEFAULT_WIFI_POWER_SAVE_MODE=0" ;; esac } diff --git a/docs/cli_commands.md b/docs/cli_commands.md index a6b8bbf0..284deabc 100644 --- a/docs/cli_commands.md +++ b/docs/cli_commands.md @@ -2051,7 +2051,9 @@ The pin number is the Arduino pin number used by that target (the normal GPIO nu **Description:** When enabled, the radio performs a hardware Channel Activity Detection scan before transmitting and defers if the channel is busy. Runs independently of `int.thresh` - either, both, or none may be active. -The Cascade firmware profile defaults CAD to `on`; target-default builds continue to default it to `off`. +Fresh Cascade-profile builds default CAD to `off` across all roles, including +Companion. Saved CAD settings take precedence after an upgrade. Use `set cad off` +to disable it on an existing node or `set cad on` to enable it explicitly. The repeater applies the saved toggle to the radio during its periodic noise-floor service. With one runnable packet, a busy result uses the normal CAD retry delay and allows roughly four seconds of continuous busy results. diff --git a/examples/simple_repeater/MyMesh.cpp b/examples/simple_repeater/MyMesh.cpp index 5b518cd5..4b7188d6 100644 --- a/examples/simple_repeater/MyMesh.cpp +++ b/examples/simple_repeater/MyMesh.cpp @@ -3454,7 +3454,7 @@ MyMesh::MyMesh(mesh::MainBoard &board, mesh::Radio &radio, mesh::MillisecondCloc _prefs.flood_max_unscoped = 64; _prefs.flood_max_advert = 8; _prefs.interference_threshold = 0; // disabled - _prefs.cad_enabled = DEFAULT_CAD_ENABLED; // Cascade defaults CAD on; target default remains off + _prefs.cad_enabled = DEFAULT_CAD_ENABLED; _prefs.agc_reset_interval = DEFAULT_AGC_RESET_INTERVAL_SECONDS / 4; _prefs.multi_acks = DEFAULT_MULTI_ACKS; _prefs.path_hash_mode = DEFAULT_PATH_HASH_MODE; diff --git a/examples/simple_room_server/MyMesh.cpp b/examples/simple_room_server/MyMesh.cpp index d68456cb..36e0fafa 100644 --- a/examples/simple_room_server/MyMesh.cpp +++ b/examples/simple_room_server/MyMesh.cpp @@ -1249,7 +1249,7 @@ MyMesh::MyMesh(mesh::MainBoard &board, mesh::Radio &radio, mesh::MillisecondCloc _prefs.flood_retry_group_max_path = FLOOD_RETRY_GROUP_MAX_PATH_DEFAULT; _prefs.interference_threshold = 0; // disabled _prefs.radio_fem_rxgain = 1; // LoRa FEM RX gain on by default (FEM boards) - _prefs.cad_enabled = DEFAULT_CAD_ENABLED; // Cascade defaults CAD on; target default remains off + _prefs.cad_enabled = DEFAULT_CAD_ENABLED; _prefs.powersaving_enabled = DEFAULT_POWERSAVING_ENABLED ? 1 : 0; _prefs.rx_powersaving_enabled = DEFAULT_RXPS_ENABLED ? 1 : 0; _prefs.rx_ps_level = DEFAULT_RXPS_LEVEL; diff --git a/examples/simple_sensor/SensorMesh.cpp b/examples/simple_sensor/SensorMesh.cpp index 2d869826..569ef5a1 100644 --- a/examples/simple_sensor/SensorMesh.cpp +++ b/examples/simple_sensor/SensorMesh.cpp @@ -984,7 +984,7 @@ SensorMesh::SensorMesh(mesh::MainBoard& board, mesh::Radio& radio, mesh::Millise _prefs.flood_retry_group_max_path = FLOOD_RETRY_GROUP_MAX_PATH_DEFAULT; _prefs.interference_threshold = 0; // disabled _prefs.radio_fem_rxgain = 1; // LoRa FEM RX gain on by default (FEM boards) - _prefs.cad_enabled = DEFAULT_CAD_ENABLED; // Cascade defaults CAD on; target default remains off + _prefs.cad_enabled = DEFAULT_CAD_ENABLED; _prefs.powersaving_enabled = DEFAULT_POWERSAVING_ENABLED ? 1 : 0; _prefs.rx_powersaving_enabled = DEFAULT_RXPS_ENABLED ? 1 : 0; _prefs.rx_ps_level = DEFAULT_RXPS_LEVEL;