From 62aa740c93f634a48cf965604c1d358d6d23adaa Mon Sep 17 00:00:00 2001 From: Jm Casler Date: Tue, 19 Jul 2022 07:36:55 -0700 Subject: [PATCH 1/4] Updated channel selection formula --- src/mesh/RadioInterface.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/mesh/RadioInterface.cpp b/src/mesh/RadioInterface.cpp index 109a5f522..6005147eb 100644 --- a/src/mesh/RadioInterface.cpp +++ b/src/mesh/RadioInterface.cpp @@ -421,7 +421,12 @@ void RadioInterface::applyModemConfig() // If user has manually specified a channel num, then use that, otherwise generate one by hashing the name const char *channelName = channels.getName(channels.getPrimaryIndex()); int channel_num = channelSettings.channel_num ? channelSettings.channel_num - 1 : hash(channelName) % numChannels; - float freq = myRegion->freqStart + ((((myRegion->freqEnd - myRegion->freqStart) / numChannels) / 2) * channel_num); + + // Old frequency selection formula + // float freq = myRegion->freqStart + ((((myRegion->freqEnd - myRegion->freqStart) / numChannels) / 2) * channel_num); + + // New frequency selection formula + float freq = myRegion->freqStart + (bw / 2) + ( channel_num * bw); saveChannelNum(channel_num); saveFreq(freq + config.lora.frequency_offset); From 001023117298c2e9f8de92b0d8b750e3fd1aa9e8 Mon Sep 17 00:00:00 2001 From: Jm Casler Date: Tue, 19 Jul 2022 09:43:08 -0700 Subject: [PATCH 2/4] Update to .26 --- version.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version.properties b/version.properties index 8b8697db9..914874f4d 100644 --- a/version.properties +++ b/version.properties @@ -1,4 +1,4 @@ [VERSION] major = 1 minor = 3 -build = 25 +build = 26 From 43733ce15055f04eca9196f72d60398f24bdf4b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20G=C3=B6ttgens?= Date: Thu, 21 Jul 2022 10:07:08 +0200 Subject: [PATCH 3/4] Fix formula to consider Bandwidth in kHz --- src/mesh/RadioInterface.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mesh/RadioInterface.cpp b/src/mesh/RadioInterface.cpp index 6005147eb..8a6bda287 100644 --- a/src/mesh/RadioInterface.cpp +++ b/src/mesh/RadioInterface.cpp @@ -426,7 +426,7 @@ void RadioInterface::applyModemConfig() // float freq = myRegion->freqStart + ((((myRegion->freqEnd - myRegion->freqStart) / numChannels) / 2) * channel_num); // New frequency selection formula - float freq = myRegion->freqStart + (bw / 2) + ( channel_num * bw); + float freq = myRegion->freqStart + (bw / 2000) + ( channel_num * (bw / 1000)); saveChannelNum(channel_num); saveFreq(freq + config.lora.frequency_offset); From c88ba583c6f21be8e9029c8f3abfa8c8d9c581d4 Mon Sep 17 00:00:00 2001 From: Jm Casler Date: Mon, 25 Jul 2022 11:07:16 -0700 Subject: [PATCH 4/4] Bump to .27 --- version.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version.properties b/version.properties index 914874f4d..3eb2c9ab4 100644 --- a/version.properties +++ b/version.properties @@ -1,4 +1,4 @@ [VERSION] major = 1 minor = 3 -build = 26 +build = 27