From 9414de85934cd5b421ac1c236704c9905fbed210 Mon Sep 17 00:00:00 2001 From: Kevin Le Date: Sun, 4 Oct 2026 18:29:05 +0700 Subject: [PATCH 1/4] Set defaults to powersaving_enabled=1 and radio_fem_rxgain=0 for fresh installs --- examples/companion_radio/MyMesh.cpp | 6 ++++-- examples/simple_repeater/MyMesh.cpp | 6 +++++- examples/simple_room_server/MyMesh.cpp | 5 ++++- examples/simple_sensor/SensorMesh.cpp | 5 ++++- 4 files changed, 17 insertions(+), 5 deletions(-) diff --git a/examples/companion_radio/MyMesh.cpp b/examples/companion_radio/MyMesh.cpp index 49d62c113..53eac6221 100644 --- a/examples/companion_radio/MyMesh.cpp +++ b/examples/companion_radio/MyMesh.cpp @@ -915,7 +915,7 @@ MyMesh::MyMesh(mesh::Radio &radio, mesh::RNG &rng, mesh::RTCClock &rtc, SimpleMe _prefs.tx_power_dbm = LORA_TX_POWER; _prefs.gps_enabled = 0; // GPS disabled by default _prefs.gps_interval = 0; // No automatic GPS updates by default - _prefs.radio_fem_rxgain = 1; + _prefs.radio_fem_rxgain = 0; // PowerSaving and better signal _prefs.radio_fem_txgain = 0; //_prefs.rx_delay_base = 10.0f; enable once new algo fixed _prefs.setRepeatEn(false); @@ -926,7 +926,9 @@ MyMesh::MyMesh(mesh::Radio &radio, mesh::RNG &rng, mesh::RTCClock &rtc, SimpleMe _prefs.rx_boosted_gain = 1; // enabled by default #endif #endif - _prefs.powersaving_enabled = 1; // Power Saving enabled by default + + // PowerSaving defaults + _prefs.powersaving_enabled = 1; } void MyMesh::begin(bool has_display) { diff --git a/examples/simple_repeater/MyMesh.cpp b/examples/simple_repeater/MyMesh.cpp index a50219eb0..80d1b1838 100644 --- a/examples/simple_repeater/MyMesh.cpp +++ b/examples/simple_repeater/MyMesh.cpp @@ -964,13 +964,17 @@ MyMesh::MyMesh(mesh::MainBoard &board, mesh::Radio &radio, mesh::MillisecondCloc _prefs.rx_boosted_gain = 1; // enabled by default; #endif #endif - _prefs.radio_fem_rxgain = 1; + _prefs.radio_fem_rxgain = 0; // PowerSaving and better signal _prefs.radio_fem_txgain = 0; pending_discover_tag = 0; pending_discover_until = 0; memset(default_scope.key, 0, sizeof(default_scope.key)); + + // PowerSaving defaults + _prefs.powersaving_enabled = 1; + } void MyMesh::begin(FILESYSTEM *fs) { diff --git a/examples/simple_room_server/MyMesh.cpp b/examples/simple_room_server/MyMesh.cpp index 53e7d6972..83598c8b9 100644 --- a/examples/simple_room_server/MyMesh.cpp +++ b/examples/simple_room_server/MyMesh.cpp @@ -681,7 +681,7 @@ MyMesh::MyMesh(mesh::MainBoard &board, mesh::Radio &radio, mesh::MillisecondCloc _prefs.rx_boosted_gain = 1; // enabled by default; #endif #endif - _prefs.radio_fem_rxgain = 1; + _prefs.radio_fem_rxgain = 0; // PowerSaving and better signal _prefs.radio_fem_txgain = 0; next_post_idx = 0; @@ -691,6 +691,9 @@ MyMesh::MyMesh(mesh::MainBoard &board, mesh::Radio &radio, mesh::MillisecondCloc _num_posted = _num_post_pushes = 0; memset(default_scope.key, 0, sizeof(default_scope.key)); + + // PowerSaving defaults + _prefs.powersaving_enabled = 1; } void MyMesh::begin(FILESYSTEM *fs) { diff --git a/examples/simple_sensor/SensorMesh.cpp b/examples/simple_sensor/SensorMesh.cpp index 58c474b36..bc5f4cb0f 100644 --- a/examples/simple_sensor/SensorMesh.cpp +++ b/examples/simple_sensor/SensorMesh.cpp @@ -773,10 +773,13 @@ SensorMesh::SensorMesh(mesh::MainBoard& board, mesh::Radio& radio, mesh::Millise _prefs.gps_enabled = 0; _prefs.gps_interval = 0; _prefs.advert_loc_policy = ADVERT_LOC_PREFS; - _prefs.radio_fem_rxgain = 1; + _prefs.radio_fem_rxgain = 0; // PowerSaving and better signal _prefs.radio_fem_txgain = 0; memset(default_scope.key, 0, sizeof(default_scope.key)); + + // PowerSaving defaults + _prefs.powersaving_enabled = 1; } void SensorMesh::begin(FILESYSTEM* fs) { From fd142084d364a483d615c4ca49edb2dd32a987c5 Mon Sep 17 00:00:00 2001 From: Kevin Le Date: Sun, 4 Oct 2026 21:49:51 +0700 Subject: [PATCH 2/4] Fixed typo in debug print in applyCompanionRxPowerSaving() --- examples/companion_radio/MyMesh.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/examples/companion_radio/MyMesh.cpp b/examples/companion_radio/MyMesh.cpp index 53eac6221..e1d29daac 100644 --- a/examples/companion_radio/MyMesh.cpp +++ b/examples/companion_radio/MyMesh.cpp @@ -286,7 +286,8 @@ static void applyCompanionRxPowerSaving(uint8_t sf, float bw) { control->setRxPowerSaving(false, RX_POWERSAVING_DEFAULT_RX_US, RX_POWERSAVING_DEFAULT_SLEEP_US); } - MESH_DEBUG_PRINTLN("RX Power Saving: companion level=5,preamble=16,rx=%lu,sleep=%lu,%s", + MESH_DEBUG_PRINTLN("RX Power Saving: companion level=%u,preamble=%u,rx=%lu,sleep=%lu,%s", + RX_POWERSAVING_BALANCED_LEVEL, RX_POWERSAVING_PROFILE_PREAMBLE, (unsigned long)rx_us, (unsigned long)sleep_us, ok ? "accepted" : "unavailable - continuous RX"); #else From b1119e30eaed60347d91aa27fff828f1982b9b3f Mon Sep 17 00:00:00 2001 From: Kevin Le Date: Sun, 4 Oct 2026 21:51:51 +0700 Subject: [PATCH 3/4] Set RXPS defaults (Balanced profile) for fresh Installs --- examples/simple_repeater/MyMesh.cpp | 6 ++++++ examples/simple_room_server/MyMesh.cpp | 7 +++++++ examples/simple_sensor/SensorMesh.cpp | 7 +++++++ 3 files changed, 20 insertions(+) diff --git a/examples/simple_repeater/MyMesh.cpp b/examples/simple_repeater/MyMesh.cpp index 80d1b1838..2115acf49 100644 --- a/examples/simple_repeater/MyMesh.cpp +++ b/examples/simple_repeater/MyMesh.cpp @@ -975,6 +975,12 @@ MyMesh::MyMesh(mesh::MainBoard &board, mesh::Radio &radio, mesh::MillisecondCloc // PowerSaving defaults _prefs.powersaving_enabled = 1; + // RXPS defaults - Balanced profile + _prefs.rxps.enabled = 1; + _prefs.rxps.level = 6; + _prefs.rxps.preamble = 16; + _prefs.rxps.rx_us = 49329; + _prefs.rxps.sleep_us = 23757; } void MyMesh::begin(FILESYSTEM *fs) { diff --git a/examples/simple_room_server/MyMesh.cpp b/examples/simple_room_server/MyMesh.cpp index 83598c8b9..4798af052 100644 --- a/examples/simple_room_server/MyMesh.cpp +++ b/examples/simple_room_server/MyMesh.cpp @@ -694,6 +694,13 @@ MyMesh::MyMesh(mesh::MainBoard &board, mesh::Radio &radio, mesh::MillisecondCloc // PowerSaving defaults _prefs.powersaving_enabled = 1; + + // RXPS defaults - Balanced profile + _prefs.rxps.enabled = 1; + _prefs.rxps.level = 6; + _prefs.rxps.preamble = 16; + _prefs.rxps.rx_us = 49329; + _prefs.rxps.sleep_us = 23757; } void MyMesh::begin(FILESYSTEM *fs) { diff --git a/examples/simple_sensor/SensorMesh.cpp b/examples/simple_sensor/SensorMesh.cpp index bc5f4cb0f..0e3036868 100644 --- a/examples/simple_sensor/SensorMesh.cpp +++ b/examples/simple_sensor/SensorMesh.cpp @@ -780,6 +780,13 @@ SensorMesh::SensorMesh(mesh::MainBoard& board, mesh::Radio& radio, mesh::Millise // PowerSaving defaults _prefs.powersaving_enabled = 1; + + // RXPS defaults - Balanced profile + _prefs.rxps.enabled = 1; + _prefs.rxps.level = 6; + _prefs.rxps.preamble = 16; + _prefs.rxps.rx_us = 49329; + _prefs.rxps.sleep_us = 23757; } void SensorMesh::begin(FILESYSTEM* fs) { From 78e134b2ba08935b9c7639962819e257cdcf415c Mon Sep 17 00:00:00 2001 From: Kevin Le Date: Tue, 6 Oct 2026 20:33:33 +0700 Subject: [PATCH 4/4] Only kept enabled, level and preamble for RXPS defaults --- examples/simple_repeater/MyMesh.cpp | 2 -- examples/simple_room_server/MyMesh.cpp | 2 -- examples/simple_sensor/SensorMesh.cpp | 2 -- 3 files changed, 6 deletions(-) diff --git a/examples/simple_repeater/MyMesh.cpp b/examples/simple_repeater/MyMesh.cpp index 2115acf49..06c82c8f8 100644 --- a/examples/simple_repeater/MyMesh.cpp +++ b/examples/simple_repeater/MyMesh.cpp @@ -979,8 +979,6 @@ MyMesh::MyMesh(mesh::MainBoard &board, mesh::Radio &radio, mesh::MillisecondCloc _prefs.rxps.enabled = 1; _prefs.rxps.level = 6; _prefs.rxps.preamble = 16; - _prefs.rxps.rx_us = 49329; - _prefs.rxps.sleep_us = 23757; } void MyMesh::begin(FILESYSTEM *fs) { diff --git a/examples/simple_room_server/MyMesh.cpp b/examples/simple_room_server/MyMesh.cpp index 4798af052..4d0e33c0e 100644 --- a/examples/simple_room_server/MyMesh.cpp +++ b/examples/simple_room_server/MyMesh.cpp @@ -699,8 +699,6 @@ MyMesh::MyMesh(mesh::MainBoard &board, mesh::Radio &radio, mesh::MillisecondCloc _prefs.rxps.enabled = 1; _prefs.rxps.level = 6; _prefs.rxps.preamble = 16; - _prefs.rxps.rx_us = 49329; - _prefs.rxps.sleep_us = 23757; } void MyMesh::begin(FILESYSTEM *fs) { diff --git a/examples/simple_sensor/SensorMesh.cpp b/examples/simple_sensor/SensorMesh.cpp index 0e3036868..6060de872 100644 --- a/examples/simple_sensor/SensorMesh.cpp +++ b/examples/simple_sensor/SensorMesh.cpp @@ -785,8 +785,6 @@ SensorMesh::SensorMesh(mesh::MainBoard& board, mesh::Radio& radio, mesh::Millise _prefs.rxps.enabled = 1; _prefs.rxps.level = 6; _prefs.rxps.preamble = 16; - _prefs.rxps.rx_us = 49329; - _prefs.rxps.sleep_us = 23757; } void SensorMesh::begin(FILESYSTEM* fs) {