From 07b90a61e18d4b5e8e6388d32865539102ff2e6c Mon Sep 17 00:00:00 2001 From: Ben Meadors Date: Thu, 16 Feb 2023 13:51:20 -0600 Subject: [PATCH 1/2] For science --- src/mesh/RadioInterface.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mesh/RadioInterface.h b/src/mesh/RadioInterface.h index 1a84c87f9..b9511fd5d 100644 --- a/src/mesh/RadioInterface.h +++ b/src/mesh/RadioInterface.h @@ -63,7 +63,7 @@ class RadioInterface - Tx/Rx turnaround time (maximum of SX126x and SX127x); - MAC processing time (measured on T-beam) */ uint32_t slotTimeMsec = 8.5 * pow(2, sf) / bw + 0.2 + 0.4 + 7; - uint16_t preambleLength = 32; // 8 is default, but we use longer to increase the amount of sleep time when receiving + uint16_t preambleLength = 16; // 8 is default, but we use longer to increase the amount of sleep time when receiving const uint32_t PROCESSING_TIME_MSEC = 4500; // time to construct, process and construct a packet again (empirically determined) const uint8_t CWmin = 2; // minimum CWsize From 8aede61adb2fc6e92553352b9c9fc2cc3a898ff1 Mon Sep 17 00:00:00 2001 From: GUVWAF Date: Thu, 16 Feb 2023 20:58:10 +0100 Subject: [PATCH 2/2] Fix setting preambleLength for SX127x Don't set currentLimit, it is set automatically in begin() --- src/mesh/RF95Interface.cpp | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/src/mesh/RF95Interface.cpp b/src/mesh/RF95Interface.cpp index f4344941d..2e378aacb 100644 --- a/src/mesh/RF95Interface.cpp +++ b/src/mesh/RF95Interface.cpp @@ -67,19 +67,12 @@ bool RF95Interface::init() #endif setTransmitEnable(false); - int res = lora->begin(getFreq(), bw, sf, cr, syncWord, power, currentLimit, preambleLength); + int res = lora->begin(getFreq(), bw, sf, cr, syncWord, power, preambleLength); LOG_INFO("RF95 init result %d\n", res); - LOG_INFO("Frequency set to %f\n", getFreq()); LOG_INFO("Bandwidth set to %f\n", bw); LOG_INFO("Power output set to %d\n", power); - // current limit was removed from module' ctor - // override default value (60 mA) - res = lora->setCurrentLimit(currentLimit); - LOG_DEBUG("Current limit set to %f\n", currentLimit); - LOG_DEBUG("Current limit set result %d\n", res); - if (res == RADIOLIB_ERR_NONE) res = lora->setCRC(RADIOLIB_SX126X_LORA_CRC_ON);