From 0f9936a0e0c6c2acc4d1ec042b49ab884a7ba0a3 Mon Sep 17 00:00:00 2001 From: GUVWAF <78759985+GUVWAF@users.noreply.github.com> Date: Thu, 2 Nov 2023 15:21:07 +0100 Subject: [PATCH] Change default Coding Rate to 4/5 for <=LongFast (#2920) Increases througput at the cost of a little bit of sensitivity Non-breaking as the CR is sent in the LoRa header --- src/mesh/RadioInterface.cpp | 12 ++++++------ src/mesh/RadioInterface.h | 4 ++-- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/mesh/RadioInterface.cpp b/src/mesh/RadioInterface.cpp index 0d2238396..4b4072dcc 100644 --- a/src/mesh/RadioInterface.cpp +++ b/src/mesh/RadioInterface.cpp @@ -384,27 +384,27 @@ void RadioInterface::applyModemConfig() switch (loraConfig.modem_preset) { case meshtastic_Config_LoRaConfig_ModemPreset_SHORT_FAST: bw = (myRegion->wideLora) ? 812.5 : 250; - cr = 8; + cr = 5; sf = 7; break; case meshtastic_Config_LoRaConfig_ModemPreset_SHORT_SLOW: bw = (myRegion->wideLora) ? 812.5 : 250; - cr = 8; + cr = 5; sf = 8; break; case meshtastic_Config_LoRaConfig_ModemPreset_MEDIUM_FAST: bw = (myRegion->wideLora) ? 812.5 : 250; - cr = 8; + cr = 5; sf = 9; break; case meshtastic_Config_LoRaConfig_ModemPreset_MEDIUM_SLOW: bw = (myRegion->wideLora) ? 812.5 : 250; - cr = 8; + cr = 5; sf = 10; break; default: // Config_LoRaConfig_ModemPreset_LONG_FAST is default. Gracefully use this is preset is something illegal. bw = (myRegion->wideLora) ? 812.5 : 250; - cr = 8; + cr = 5; sf = 11; break; case meshtastic_Config_LoRaConfig_ModemPreset_LONG_MODERATE: @@ -546,4 +546,4 @@ size_t RadioInterface::beginSending(meshtastic_MeshPacket *p) sendingPacket = p; return p->encrypted.size + sizeof(PacketHeader); -} +} \ No newline at end of file diff --git a/src/mesh/RadioInterface.h b/src/mesh/RadioInterface.h index 9c5d66293..85ce116dc 100644 --- a/src/mesh/RadioInterface.h +++ b/src/mesh/RadioInterface.h @@ -56,7 +56,7 @@ class RadioInterface float bw = 125; uint8_t sf = 9; - uint8_t cr = 7; + uint8_t cr = 5; /** Slottime is the minimum time to wait, consisting of: - CAD duration (maximum of SX126x and SX127x); - roundtrip air propagation time (assuming max. 30km between nodes); @@ -223,4 +223,4 @@ class RadioInterface }; /// Debug printing for packets -void printPacket(const char *prefix, const meshtastic_MeshPacket *p); +void printPacket(const char *prefix, const meshtastic_MeshPacket *p); \ No newline at end of file