From 9a9dc4266fd9e7b5b64622dfcb8e427354cd1f6f Mon Sep 17 00:00:00 2001 From: Wessel Nieboer Date: Thu, 9 Jul 2026 15:56:25 +0200 Subject: [PATCH 1/3] bump radiolib to 7.7.1 --- library.json | 2 +- platformio.ini | 2 +- src/helpers/radiolib/SX126xReset.h | 28 +++++----------------------- 3 files changed, 7 insertions(+), 25 deletions(-) diff --git a/library.json b/library.json index 8504793c23..2ff3aaec9c 100644 --- a/library.json +++ b/library.json @@ -4,7 +4,7 @@ "dependencies": { "SPI": "*", "Wire": "*", - "jgromes/RadioLib": "^7.6.0", + "jgromes/RadioLib": "^7.7.1", "rweather/Crypto": "^0.4.0", "adafruit/RTClib": "^2.1.3", "melopero/Melopero RV3028": "^1.1.0", diff --git a/platformio.ini b/platformio.ini index 47cc0ab8c3..d2b9f587db 100644 --- a/platformio.ini +++ b/platformio.ini @@ -19,7 +19,7 @@ monitor_speed = 115200 lib_deps = SPI Wire - jgromes/RadioLib @ ^7.6.0 + jgromes/RadioLib @ ^7.7.1 rweather/Crypto @ ^0.4.0 adafruit/RTClib @ ^2.1.3 melopero/Melopero RV3028 @ ^1.1.0 diff --git a/src/helpers/radiolib/SX126xReset.h b/src/helpers/radiolib/SX126xReset.h index 39ddb73eed..3c36afdb35 100644 --- a/src/helpers/radiolib/SX126xReset.h +++ b/src/helpers/radiolib/SX126xReset.h @@ -3,32 +3,14 @@ #include // Full receiver reset for all SX126x-family chips (SX1262, SX1268, LLCC68, STM32WLx). -// Warm sleep powers down analog, Calibrate(0x7F) refreshes ADC/PLL/image calibration, -// then re-applies RX settings that calibration may reset. +// RadioLib 7.7.0+ provides resetAGC(): warm sleep powers down analog, Calibrate(0x7F) +// refreshes ADC/PLL/image calibration, image is re-calibrated for the operating +// frequency, and DIO2 RF switch / RX boosted gain are re-applied automatically. inline void sx126xResetAGC(SX126x* radio) { - radio->sleep(true); - radio->standby(RADIOLIB_SX126X_STANDBY_RC, true); + radio->resetAGC(); - uint8_t calData = RADIOLIB_SX126X_CALIBRATE_ALL; - radio->mod->SPIwriteStream(RADIOLIB_SX126X_CMD_CALIBRATE, &calData, 1, true, false); - radio->mod->hal->delay(5); - uint32_t start = millis(); - while (radio->mod->hal->digitalRead(radio->mod->getGpio())) { - if (millis() - start > 50) break; - radio->mod->hal->yield(); - } - - // Calibrate(0x7F) defaults image calibration to 902-928MHz band. - // Re-calibrate for the actual operating frequency. - radio->calibrateImage(radio->freqMHz); - -#ifdef SX126X_DIO2_AS_RF_SWITCH - radio->setDio2AsRfSwitch(SX126X_DIO2_AS_RF_SWITCH); -#endif -#ifdef SX126X_RX_BOOSTED_GAIN - radio->setRxBoostedGainMode(SX126X_RX_BOOSTED_GAIN); -#endif #ifdef SX126X_REGISTER_PATCH + // for improved RX with Heltec v4 — calibration may reset this uint8_t r_data = 0; radio->readRegister(0x8B5, &r_data, 1); r_data |= 0x01; From ae0dfc0c7bfa55accbff10b79a4451b2b80e1191 Mon Sep 17 00:00:00 2001 From: Wessel Nieboer Date: Thu, 9 Jul 2026 16:14:22 +0200 Subject: [PATCH 2/3] refactor to use config instead of init() methods this prepares us for radiolib release 8 --- src/helpers/radiolib/CustomLLCC68.h | 21 ++++++++++++------- src/helpers/radiolib/CustomSX1262.h | 29 +++++++++++++++----------- src/helpers/radiolib/CustomSX1268.h | 21 ++++++++++++------- src/helpers/radiolib/CustomSX1276.h | 14 +++++++++---- variants/ebyte_eora_s3/target.cpp | 14 ++++++++++--- variants/minewsemi_me25ls01/target.cpp | 14 ++++++++++--- variants/rak3x72/target.cpp | 11 +++++++++- variants/t1000-e/target.cpp | 14 ++++++++++--- variants/thinknode_m3/target.cpp | 14 ++++++++++--- variants/tiny_relay/target.cpp | 12 +++++++++-- variants/wio-e5-dev/target.cpp | 11 +++++++++- variants/wio-e5-mini/target.cpp | 11 +++++++++- variants/wio_wm1110/target.cpp | 16 ++++++++++---- 13 files changed, 151 insertions(+), 51 deletions(-) diff --git a/src/helpers/radiolib/CustomLLCC68.h b/src/helpers/radiolib/CustomLLCC68.h index 82f886c324..6cfa0655aa 100644 --- a/src/helpers/radiolib/CustomLLCC68.h +++ b/src/helpers/radiolib/CustomLLCC68.h @@ -16,16 +16,23 @@ class CustomLLCC68 : public LLCC68 { #endif { #ifdef SX126X_DIO3_TCXO_VOLTAGE - float tcxo = SX126X_DIO3_TCXO_VOLTAGE; + tcxoVoltage = SX126X_DIO3_TCXO_VOLTAGE; #else - float tcxo = 1.6f; + tcxoVoltage = 1.6f; #endif + ConfigLoRa_t cfg; + cfg.frequency = LORA_FREQ; + cfg.bandwidth = LORA_BW; + cfg.spreadingFactor = LORA_SF; #ifdef LORA_CR - uint8_t cr = LORA_CR; + cfg.codingRate = LORA_CR; #else - uint8_t cr = 5; + cfg.codingRate = 5; #endif + cfg.syncWord = RADIOLIB_LORA_SYNC_WORD_PRIVATE; + cfg.power = LORA_TX_POWER; + cfg.preambleLength = 16; #if defined(P_LORA_SCLK) #ifdef NRF52_PLATFORM @@ -42,11 +49,11 @@ class CustomLLCC68 : public LLCC68 { if (spi) spi->begin(P_LORA_SCLK, P_LORA_MISO, P_LORA_MOSI); #endif #endif - int status = begin(LORA_FREQ, LORA_BW, LORA_SF, cr, RADIOLIB_SX126X_SYNC_WORD_PRIVATE, LORA_TX_POWER, 16, tcxo); + int status = begin(cfg); // if radio init fails with -707/-706, try again with tcxo voltage set to 0.0f if (status == RADIOLIB_ERR_SPI_CMD_FAILED || status == RADIOLIB_ERR_SPI_CMD_INVALID) { - tcxo = 0.0f; - status = begin(LORA_FREQ, LORA_BW, LORA_SF, cr, RADIOLIB_SX126X_SYNC_WORD_PRIVATE, LORA_TX_POWER, 16, tcxo); + tcxoVoltage = 0.0f; + status = begin(cfg); } if (status != RADIOLIB_ERR_NONE) { Serial.print("ERROR: radio init failed: "); diff --git a/src/helpers/radiolib/CustomSX1262.h b/src/helpers/radiolib/CustomSX1262.h index ca62fc26af..e37c23595e 100644 --- a/src/helpers/radiolib/CustomSX1262.h +++ b/src/helpers/radiolib/CustomSX1262.h @@ -17,22 +17,27 @@ class CustomSX1262 : public SX1262 { #endif { #ifdef SX126X_DIO3_TCXO_VOLTAGE - float tcxo = SX126X_DIO3_TCXO_VOLTAGE; + tcxoVoltage = SX126X_DIO3_TCXO_VOLTAGE; #else - float tcxo = 1.6f; + tcxoVoltage = 1.6f; #endif - #ifdef LORA_CR - uint8_t cr = LORA_CR; - #else - uint8_t cr = 5; + #ifdef SX126X_USE_REGULATOR_LDO + useRegulatorLDO = SX126X_USE_REGULATOR_LDO; #endif - #ifdef SX126X_USE_REGULATOR_LDO - constexpr bool useRegulatorLDO = SX126X_USE_REGULATOR_LDO; + ConfigLoRa_t cfg; + cfg.frequency = LORA_FREQ; + cfg.bandwidth = LORA_BW; + cfg.spreadingFactor = LORA_SF; + #ifdef LORA_CR + cfg.codingRate = LORA_CR; #else - constexpr bool useRegulatorLDO = false; + cfg.codingRate = 5; #endif + cfg.syncWord = RADIOLIB_LORA_SYNC_WORD_PRIVATE; + cfg.power = LORA_TX_POWER; + cfg.preambleLength = 16; MESH_DEBUG_PRINTLN("SX1262 regulator requested: %s", useRegulatorLDO ? "LDO" : "DC-DC"); @@ -51,12 +56,12 @@ class CustomSX1262 : public SX1262 { if (spi) spi->begin(P_LORA_SCLK, P_LORA_MISO, P_LORA_MOSI); #endif #endif - int status = begin(LORA_FREQ, LORA_BW, LORA_SF, cr, RADIOLIB_SX126X_SYNC_WORD_PRIVATE, LORA_TX_POWER, 16, tcxo, useRegulatorLDO); + int status = begin(cfg); // if radio init fails with -707/-706, try again with tcxo voltage set to 0.0f if (status == RADIOLIB_ERR_SPI_CMD_FAILED || status == RADIOLIB_ERR_SPI_CMD_INVALID) { MESH_DEBUG_PRINTLN("SX1262 init failed with error %d, retrying with TCXO at 0.0V", status); - tcxo = 0.0f; - status = begin(LORA_FREQ, LORA_BW, LORA_SF, cr, RADIOLIB_SX126X_SYNC_WORD_PRIVATE, LORA_TX_POWER, 16, tcxo, useRegulatorLDO); + tcxoVoltage = 0.0f; + status = begin(cfg); } if (status != RADIOLIB_ERR_NONE) { Serial.print("ERROR: radio init failed: "); diff --git a/src/helpers/radiolib/CustomSX1268.h b/src/helpers/radiolib/CustomSX1268.h index cc541e49f3..5537503d03 100644 --- a/src/helpers/radiolib/CustomSX1268.h +++ b/src/helpers/radiolib/CustomSX1268.h @@ -16,16 +16,23 @@ class CustomSX1268 : public SX1268 { #endif { #ifdef SX126X_DIO3_TCXO_VOLTAGE - float tcxo = SX126X_DIO3_TCXO_VOLTAGE; + tcxoVoltage = SX126X_DIO3_TCXO_VOLTAGE; #else - float tcxo = 1.6f; + tcxoVoltage = 1.6f; #endif + ConfigLoRa_t cfg; + cfg.frequency = LORA_FREQ; + cfg.bandwidth = LORA_BW; + cfg.spreadingFactor = LORA_SF; #ifdef LORA_CR - uint8_t cr = LORA_CR; + cfg.codingRate = LORA_CR; #else - uint8_t cr = 5; + cfg.codingRate = 5; #endif + cfg.syncWord = RADIOLIB_LORA_SYNC_WORD_PRIVATE; + cfg.power = LORA_TX_POWER; + cfg.preambleLength = 16; #if defined(P_LORA_SCLK) #ifdef NRF52_PLATFORM @@ -42,11 +49,11 @@ class CustomSX1268 : public SX1268 { if (spi) spi->begin(P_LORA_SCLK, P_LORA_MISO, P_LORA_MOSI); #endif #endif - int status = begin(LORA_FREQ, LORA_BW, LORA_SF, cr, RADIOLIB_SX126X_SYNC_WORD_PRIVATE, LORA_TX_POWER, 16, tcxo); + int status = begin(cfg); // if radio init fails with -707/-706, try again with tcxo voltage set to 0.0f if (status == RADIOLIB_ERR_SPI_CMD_FAILED || status == RADIOLIB_ERR_SPI_CMD_INVALID) { - tcxo = 0.0f; - status = begin(LORA_FREQ, LORA_BW, LORA_SF, cr, RADIOLIB_SX126X_SYNC_WORD_PRIVATE, LORA_TX_POWER, 16, tcxo); + tcxoVoltage = 0.0f; + status = begin(cfg); } if (status != RADIOLIB_ERR_NONE) { Serial.print("ERROR: radio init failed: "); diff --git a/src/helpers/radiolib/CustomSX1276.h b/src/helpers/radiolib/CustomSX1276.h index bee2527431..612aaef001 100644 --- a/src/helpers/radiolib/CustomSX1276.h +++ b/src/helpers/radiolib/CustomSX1276.h @@ -18,11 +18,18 @@ class CustomSX1276 : public SX1276 { bool std_init(SPIClass* spi = NULL) #endif { + ConfigLoRa_t cfg; + cfg.frequency = LORA_FREQ; + cfg.bandwidth = LORA_BW; + cfg.spreadingFactor = LORA_SF; #ifdef LORA_CR - uint8_t cr = LORA_CR; + cfg.codingRate = LORA_CR; #else - uint8_t cr = 5; + cfg.codingRate = 5; #endif + cfg.syncWord = RADIOLIB_LORA_SYNC_WORD_PRIVATE; + cfg.power = LORA_TX_POWER; + cfg.preambleLength = 16; #if defined(P_LORA_SCLK) #ifdef NRF52_PLATFORM @@ -39,8 +46,7 @@ class CustomSX1276 : public SX1276 { if (spi) spi->begin(P_LORA_SCLK, P_LORA_MISO, P_LORA_MOSI); #endif #endif - int status = begin(LORA_FREQ, LORA_BW, LORA_SF, cr, RADIOLIB_SX126X_SYNC_WORD_PRIVATE, LORA_TX_POWER, 16); - // if radio init fails with -707/-706, try again with tcxo voltage set to 0.0f + int status = begin(cfg); if (status != RADIOLIB_ERR_NONE) { Serial.print("ERROR: radio init failed: "); Serial.println(status); diff --git a/variants/ebyte_eora_s3/target.cpp b/variants/ebyte_eora_s3/target.cpp index 91d851ff3e..d867ba7cef 100644 --- a/variants/ebyte_eora_s3/target.cpp +++ b/variants/ebyte_eora_s3/target.cpp @@ -30,15 +30,23 @@ bool radio_init() { rtc_clock.begin(Wire); #ifdef SX126X_DIO3_TCXO_VOLTAGE - float tcxo = SX126X_DIO3_TCXO_VOLTAGE; + radio.tcxoVoltage = SX126X_DIO3_TCXO_VOLTAGE; #else - float tcxo = 1.6f; + radio.tcxoVoltage = 1.6f; #endif #if defined(P_LORA_SCLK) spi.begin(P_LORA_SCLK, P_LORA_MISO, P_LORA_MOSI); #endif - int status = radio.begin(LORA_FREQ, LORA_BW, LORA_SF, LORA_CR, RADIOLIB_SX126X_SYNC_WORD_PRIVATE, LORA_TX_POWER, 8, tcxo); + ConfigLoRa_t cfg; + cfg.frequency = LORA_FREQ; + cfg.bandwidth = LORA_BW; + cfg.spreadingFactor = LORA_SF; + cfg.codingRate = LORA_CR; + cfg.syncWord = RADIOLIB_LORA_SYNC_WORD_PRIVATE; + cfg.power = LORA_TX_POWER; + cfg.preambleLength = 8; + int status = radio.begin(cfg); if (status != RADIOLIB_ERR_NONE) { Serial.print("ERROR: radio init failed: "); Serial.println(status); diff --git a/variants/minewsemi_me25ls01/target.cpp b/variants/minewsemi_me25ls01/target.cpp index 9944a38b93..7128adba7a 100644 --- a/variants/minewsemi_me25ls01/target.cpp +++ b/variants/minewsemi_me25ls01/target.cpp @@ -51,14 +51,22 @@ bool radio_init() { //rtc_clock.begin(Wire); #ifdef LR11X0_DIO3_TCXO_VOLTAGE - float tcxo = LR11X0_DIO3_TCXO_VOLTAGE; + radio.tcxoVoltage = LR11X0_DIO3_TCXO_VOLTAGE; #else - float tcxo = 1.6f; + radio.tcxoVoltage = 1.6f; #endif SPI.setPins(P_LORA_MISO, P_LORA_SCLK, P_LORA_MOSI); SPI.begin(); - int status = radio.begin(LORA_FREQ, LORA_BW, LORA_SF, LORA_CR, RADIOLIB_LR11X0_LORA_SYNC_WORD_PRIVATE, LORA_TX_POWER, 16, tcxo); + ConfigLoRa_t cfg; + cfg.frequency = LORA_FREQ; + cfg.bandwidth = LORA_BW; + cfg.spreadingFactor = LORA_SF; + cfg.codingRate = LORA_CR; + cfg.syncWord = RADIOLIB_LORA_SYNC_WORD_PRIVATE; + cfg.power = LORA_TX_POWER; + cfg.preambleLength = 16; + int status = radio.begin(cfg); if (status != RADIOLIB_ERR_NONE) { Serial.print("ERROR: radio init failed: "); Serial.println(status); diff --git a/variants/rak3x72/target.cpp b/variants/rak3x72/target.cpp index e55543a324..db856befc6 100644 --- a/variants/rak3x72/target.cpp +++ b/variants/rak3x72/target.cpp @@ -38,7 +38,16 @@ bool radio_init() { radio.setRfSwitchTable(rfswitch_pins, rfswitch_table); - int status = radio.begin(LORA_FREQ, LORA_BW, LORA_SF, LORA_CR, RADIOLIB_SX126X_SYNC_WORD_PRIVATE, LORA_TX_POWER, 16, STM32WL_TCXO_VOLTAGE, 0); + radio.tcxoVoltage = STM32WL_TCXO_VOLTAGE; + ConfigLoRa_t cfg; + cfg.frequency = LORA_FREQ; + cfg.bandwidth = LORA_BW; + cfg.spreadingFactor = LORA_SF; + cfg.codingRate = LORA_CR; + cfg.syncWord = RADIOLIB_LORA_SYNC_WORD_PRIVATE; + cfg.power = LORA_TX_POWER; + cfg.preambleLength = 16; + int status = radio.begin(cfg); if (status != RADIOLIB_ERR_NONE) { Serial.print("ERROR: radio init failed: "); diff --git a/variants/t1000-e/target.cpp b/variants/t1000-e/target.cpp index 4253282708..c368058bf6 100644 --- a/variants/t1000-e/target.cpp +++ b/variants/t1000-e/target.cpp @@ -47,14 +47,22 @@ bool radio_init() { //rtc_clock.begin(Wire); #ifdef LR11X0_DIO3_TCXO_VOLTAGE - float tcxo = LR11X0_DIO3_TCXO_VOLTAGE; + radio.tcxoVoltage = LR11X0_DIO3_TCXO_VOLTAGE; #else - float tcxo = 1.6f; + radio.tcxoVoltage = 1.6f; #endif SPI.setPins(P_LORA_MISO, P_LORA_SCLK, P_LORA_MOSI); SPI.begin(); - int status = radio.begin(LORA_FREQ, LORA_BW, LORA_SF, LORA_CR, RADIOLIB_LR11X0_LORA_SYNC_WORD_PRIVATE, LORA_TX_POWER, 16, tcxo); + ConfigLoRa_t cfg; + cfg.frequency = LORA_FREQ; + cfg.bandwidth = LORA_BW; + cfg.spreadingFactor = LORA_SF; + cfg.codingRate = LORA_CR; + cfg.syncWord = RADIOLIB_LORA_SYNC_WORD_PRIVATE; + cfg.power = LORA_TX_POWER; + cfg.preambleLength = 16; + int status = radio.begin(cfg); if (status != RADIOLIB_ERR_NONE) { Serial.print("ERROR: radio init failed: "); Serial.println(status); diff --git a/variants/thinknode_m3/target.cpp b/variants/thinknode_m3/target.cpp index 1e6c2ad13c..ce29451131 100644 --- a/variants/thinknode_m3/target.cpp +++ b/variants/thinknode_m3/target.cpp @@ -51,14 +51,22 @@ bool radio_init() { rtc_clock.begin(Wire); #ifdef LR11X0_DIO3_TCXO_VOLTAGE - float tcxo = LR11X0_DIO3_TCXO_VOLTAGE; + radio.tcxoVoltage = LR11X0_DIO3_TCXO_VOLTAGE; #else - float tcxo = 1.6f; + radio.tcxoVoltage = 1.6f; #endif SPI.setPins(P_LORA_MISO, P_LORA_SCLK, P_LORA_MOSI); SPI.begin(); - int status = radio.begin(LORA_FREQ, LORA_BW, LORA_SF, LORA_CR, RADIOLIB_LR11X0_LORA_SYNC_WORD_PRIVATE, LORA_TX_POWER, 16, tcxo); + ConfigLoRa_t cfg; + cfg.frequency = LORA_FREQ; + cfg.bandwidth = LORA_BW; + cfg.spreadingFactor = LORA_SF; + cfg.codingRate = LORA_CR; + cfg.syncWord = RADIOLIB_LORA_SYNC_WORD_PRIVATE; + cfg.power = LORA_TX_POWER; + cfg.preambleLength = 16; + int status = radio.begin(cfg); if (status != RADIOLIB_ERR_NONE) { Serial.print("ERROR: radio init failed: "); Serial.println(status); diff --git a/variants/tiny_relay/target.cpp b/variants/tiny_relay/target.cpp index aed8a67c64..f664aefb4a 100644 --- a/variants/tiny_relay/target.cpp +++ b/variants/tiny_relay/target.cpp @@ -39,8 +39,16 @@ bool radio_init() radio.setRfSwitchTable(rfswitch_pins, rfswitch_table); - int status = radio.begin(LORA_FREQ, LORA_BW, LORA_SF, LORA_CR, RADIOLIB_SX126X_SYNC_WORD_PRIVATE, LORA_TX_POWER, 16, - STM32WL_TCXO_VOLTAGE, 0); + radio.tcxoVoltage = STM32WL_TCXO_VOLTAGE; + ConfigLoRa_t cfg; + cfg.frequency = LORA_FREQ; + cfg.bandwidth = LORA_BW; + cfg.spreadingFactor = LORA_SF; + cfg.codingRate = LORA_CR; + cfg.syncWord = RADIOLIB_LORA_SYNC_WORD_PRIVATE; + cfg.power = LORA_TX_POWER; + cfg.preambleLength = 16; + int status = radio.begin(cfg); if (status != RADIOLIB_ERR_NONE) { Serial.print("ERROR: radio init failed: "); diff --git a/variants/wio-e5-dev/target.cpp b/variants/wio-e5-dev/target.cpp index 680da631a4..bd230082be 100644 --- a/variants/wio-e5-dev/target.cpp +++ b/variants/wio-e5-dev/target.cpp @@ -35,7 +35,16 @@ bool radio_init() { radio.setRfSwitchTable(rfswitch_pins, rfswitch_table); - int status = radio.begin(LORA_FREQ, LORA_BW, LORA_SF, LORA_CR, RADIOLIB_SX126X_SYNC_WORD_PRIVATE, LORA_TX_POWER, 16, 1.7, 0); + radio.tcxoVoltage = 1.7f; + ConfigLoRa_t cfg; + cfg.frequency = LORA_FREQ; + cfg.bandwidth = LORA_BW; + cfg.spreadingFactor = LORA_SF; + cfg.codingRate = LORA_CR; + cfg.syncWord = RADIOLIB_LORA_SYNC_WORD_PRIVATE; + cfg.power = LORA_TX_POWER; + cfg.preambleLength = 16; + int status = radio.begin(cfg); if (status != RADIOLIB_ERR_NONE) { Serial.print("ERROR: radio init failed: "); diff --git a/variants/wio-e5-mini/target.cpp b/variants/wio-e5-mini/target.cpp index 92775d5511..17ed08a036 100644 --- a/variants/wio-e5-mini/target.cpp +++ b/variants/wio-e5-mini/target.cpp @@ -33,7 +33,16 @@ bool radio_init() { radio.setRfSwitchTable(rfswitch_pins, rfswitch_table); - int status = radio.begin(LORA_FREQ, LORA_BW, LORA_SF, LORA_CR, RADIOLIB_SX126X_SYNC_WORD_PRIVATE, LORA_TX_POWER, 16, 1.7, 0); + radio.tcxoVoltage = 1.7f; + ConfigLoRa_t cfg; + cfg.frequency = LORA_FREQ; + cfg.bandwidth = LORA_BW; + cfg.spreadingFactor = LORA_SF; + cfg.codingRate = LORA_CR; + cfg.syncWord = RADIOLIB_LORA_SYNC_WORD_PRIVATE; + cfg.power = LORA_TX_POWER; + cfg.preambleLength = 16; + int status = radio.begin(cfg); if (status != RADIOLIB_ERR_NONE) { Serial.print("ERROR: radio init failed: "); diff --git a/variants/wio_wm1110/target.cpp b/variants/wio_wm1110/target.cpp index 1bb7cec8cb..c3e8931c15 100644 --- a/variants/wio_wm1110/target.cpp +++ b/variants/wio_wm1110/target.cpp @@ -41,15 +41,23 @@ bool radio_init() { board.enableSensorPower(true); #ifdef LR11X0_DIO3_TCXO_VOLTAGE - float tcxo = LR11X0_DIO3_TCXO_VOLTAGE; + radio.tcxoVoltage = LR11X0_DIO3_TCXO_VOLTAGE; #else - float tcxo = 1.8f; + radio.tcxoVoltage = 1.8f; #endif SPI.setPins(P_LORA_MISO, P_LORA_SCLK, P_LORA_MOSI); SPI.begin(); - - int status = radio.begin(LORA_FREQ, LORA_BW, LORA_SF, LORA_CR, RADIOLIB_LR11X0_LORA_SYNC_WORD_PRIVATE, LORA_TX_POWER, 16, tcxo); + + ConfigLoRa_t cfg; + cfg.frequency = LORA_FREQ; + cfg.bandwidth = LORA_BW; + cfg.spreadingFactor = LORA_SF; + cfg.codingRate = LORA_CR; + cfg.syncWord = RADIOLIB_LORA_SYNC_WORD_PRIVATE; + cfg.power = LORA_TX_POWER; + cfg.preambleLength = 16; + int status = radio.begin(cfg); if (status != RADIOLIB_ERR_NONE) { Serial.print("ERROR: radio init failed: "); Serial.println(status); From 295fa36e55f60d9c9526f5b6bcdc198045ca8bde Mon Sep 17 00:00:00 2001 From: Wessel Nieboer Date: Thu, 9 Jul 2026 16:27:18 +0200 Subject: [PATCH 3/3] update the faq --- docs/faq.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/faq.md b/docs/faq.md index 5ebdb9b614..ac0c577aa2 100644 --- a/docs/faq.md +++ b/docs/faq.md @@ -283,7 +283,7 @@ Best practice is when you set up a new repeater, choose a public key that is not The `` unit is in seconds and is incremented by 4. `set agc.reset.interval 4` works well to cure deafness. -This is a very low-cost operation. AGC reset is done by simply setting `state = STATE_IDLE;` in function `RadioLibWrapper::resetAGC()` in `RadioLibWrappers.cpp` +This is a low-cost operation (a few milliseconds). The reset performs a warm sleep to power down the radio's analog frontend, recalibrates all blocks (ADC, PLL, image rejection, oscillators), and resets the noise floor tracking. See `RadioLibWrapper::resetAGC()` in `RadioLibWrappers.cpp`. ### 3.8. Q: How do I make my repeater an observer on the mesh?