From d92a003d8e8cc5d28728c0299f0f49b4ee297a06 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 13 Mar 2023 14:07:28 -0500 Subject: [PATCH 1/6] [create-pull-request] automated change (#2354) Co-authored-by: thebentern --- version.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version.properties b/version.properties index b282100fe..ebd839bbb 100644 --- a/version.properties +++ b/version.properties @@ -1,4 +1,4 @@ [VERSION] major = 2 minor = 1 -build = 2 +build = 3 From e03a2f8f7f1e004f00ffe63f016082c3b9c76439 Mon Sep 17 00:00:00 2001 From: rcarteraz Date: Mon, 13 Mar 2023 14:31:34 -0700 Subject: [PATCH 2/6] Add V3 and TBeam S3 to hardware --- .github/ISSUE_TEMPLATE/Bug Report.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/ISSUE_TEMPLATE/Bug Report.yml b/.github/ISSUE_TEMPLATE/Bug Report.yml index b8c24ab2b..795c1b1a0 100644 --- a/.github/ISSUE_TEMPLATE/Bug Report.yml +++ b/.github/ISSUE_TEMPLATE/Bug Report.yml @@ -32,6 +32,7 @@ body: options: - Not Applicable - T-Beam + - T-Beam S3 - T-Beam 0.7 - T-Lora v1 - T-Lora v1.3 @@ -42,6 +43,7 @@ body: - Heltec v1 - Heltec v2 - Heltec v2.1 + - Heltec V3 - Relay v1 - Relay v2 - DIY From b398f31b64de5162549cedbb5e7d3ae9964e6f61 Mon Sep 17 00:00:00 2001 From: Manuel <71137295+mverch67@users.noreply.github.com> Date: Tue, 14 Mar 2023 22:50:32 +0100 Subject: [PATCH 3/6] Fix heap leak mentioned in #2358 (#2359) * Fix heap leak mentioned in #2358 * Additional fix for #2359 --- src/mesh/MeshService.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/mesh/MeshService.cpp b/src/mesh/MeshService.cpp index 650f6882b..ee4ddcd77 100644 --- a/src/mesh/MeshService.cpp +++ b/src/mesh/MeshService.cpp @@ -82,7 +82,7 @@ int MeshService::handleFromRadio(const meshtastic_MeshPacket *mp) } printPacket("Forwarding to phone", mp); - sendToPhone((meshtastic_MeshPacket *)mp); + sendToPhone(packetPool.allocCopy(*mp)); return 0; } @@ -231,7 +231,7 @@ void MeshService::sendToMesh(meshtastic_MeshPacket *p, RxSource src, bool ccToPh } if (ccToPhone) { - sendToPhone(p); + sendToPhone(packetPool.allocCopy(*p)); } } @@ -262,9 +262,8 @@ void MeshService::sendToPhone(meshtastic_MeshPacket *p) releaseToPool(d); } - meshtastic_MeshPacket *copied = packetPool.allocCopy(*p); - perhapsDecode(copied); - assert(toPhoneQueue.enqueue(copied, 0)); + perhapsDecode(p); + assert(toPhoneQueue.enqueue(p, 0)); fromNum++; } From 7bbfa48b5db83a5aeab43d0f380ae4ed9ca2ca8c Mon Sep 17 00:00:00 2001 From: Andre K Date: Fri, 17 Mar 2023 15:36:10 -0300 Subject: [PATCH 4/6] fix channel_num log (#2361) * fix channel_num variable * fix channel_num log instead --- src/mesh/RadioInterface.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/mesh/RadioInterface.cpp b/src/mesh/RadioInterface.cpp index 9a8c2d502..063ae5374 100644 --- a/src/mesh/RadioInterface.cpp +++ b/src/mesh/RadioInterface.cpp @@ -454,6 +454,7 @@ 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()); + // channel_num is actually (channel_num - 1), since modulus (%) returns values from 0 to (numChannels - 1) int channel_num = (loraConfig.channel_num ? loraConfig.channel_num - 1 : hash(channelName)) % numChannels; // Old frequency selection formula @@ -480,7 +481,7 @@ void RadioInterface::applyModemConfig() LOG_INFO("Radio myRegion->freqStart -> myRegion->freqEnd: %f -> %f (%f mhz)\n", myRegion->freqStart, myRegion->freqEnd, myRegion->freqEnd - myRegion->freqStart); LOG_INFO("Radio myRegion->numChannels: %d x %.3fkHz\n", numChannels, bw); - LOG_INFO("Radio channel_num: %d\n", channel_num); + LOG_INFO("Radio channel_num: %d\n", channel_num + 1); LOG_INFO("Radio frequency: %f\n", getFreq()); LOG_INFO("Slot time: %u msec\n", slotTimeMsec); } From 1f99d4756af1be4d1bd1fc074c14462e426fbbc9 Mon Sep 17 00:00:00 2001 From: Manuel <71137295+mverch67@users.noreply.github.com> Date: Sat, 18 Mar 2023 01:53:29 +0100 Subject: [PATCH 5/6] Fix: Sporadig crashes and reboot (#2366) * Fix: Sporadig crashes with reboot * Revert "Fix: Sporadig crashes with reboot" This reverts commit 59b65749f59b500fe8a6af6a20a993a70bd56b4f. * Fix: Sporadig crashes and reboot --- src/mesh/ReliableRouter.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/mesh/ReliableRouter.cpp b/src/mesh/ReliableRouter.cpp index 774be9c17..7f5c9b7fc 100644 --- a/src/mesh/ReliableRouter.cpp +++ b/src/mesh/ReliableRouter.cpp @@ -164,13 +164,13 @@ bool ReliableRouter::stopRetransmission(GlobalPacketId key) { auto old = findPendingPacket(key); if (old) { + auto p = old->packet; auto numErased = pending.erase(key); assert(numErased == 1); // remove the 'original' (identified by originator and packet->id) from the txqueue and free it - cancelSending(getFrom(old->packet), old->packet->id); - // now free the pooled copy for retransmission too. tryfix for #2228 - if (old->packet) - packetPool.release(old->packet); + cancelSending(getFrom(p), p->id); + // now free the pooled copy for retransmission too + packetPool.release(p); return true; } else return false; From 8c68d888c80f0199021c6753b088d670d4a8f7bd Mon Sep 17 00:00:00 2001 From: GUVWAF <78759985+GUVWAF@users.noreply.github.com> Date: Sat, 18 Mar 2023 13:23:37 +0100 Subject: [PATCH 6/6] SX126x: Try next Interface when chip not found (#2363) * If chip was not found, return false for init() * SX1268: Only overwrite frequency when out of bounds Happens when region is still UNSET --- src/mesh/SX1268Interface.cpp | 9 +++++++++ src/mesh/SX1268Interface.h | 3 +-- src/mesh/SX126xInterface.cpp | 2 ++ 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/src/mesh/SX1268Interface.cpp b/src/mesh/SX1268Interface.cpp index cae4bac41..62cdfefe0 100644 --- a/src/mesh/SX1268Interface.cpp +++ b/src/mesh/SX1268Interface.cpp @@ -6,4 +6,13 @@ SX1268Interface::SX1268Interface(RADIOLIB_PIN_TYPE cs, RADIOLIB_PIN_TYPE irq, RA SPIClass &spi) : SX126xInterface(cs, irq, rst, busy, spi) { +} + +float SX1268Interface::getFreq() +{ + // Set frequency to default of EU_433 if outside of allowed range (e.g. when region is UNSET) + if (savedFreq < 410 || savedFreq > 810) + return 433.125f; + else + return savedFreq; } \ No newline at end of file diff --git a/src/mesh/SX1268Interface.h b/src/mesh/SX1268Interface.h index a288cdd09..f40fcf37b 100644 --- a/src/mesh/SX1268Interface.h +++ b/src/mesh/SX1268Interface.h @@ -8,8 +8,7 @@ class SX1268Interface : public SX126xInterface { public: - /// override frequency of the SX1268 module regardless of the region (use EU433 value) - virtual float getFreq() override { return 433.175f; } + virtual float getFreq() override; SX1268Interface(RADIOLIB_PIN_TYPE cs, RADIOLIB_PIN_TYPE irq, RADIOLIB_PIN_TYPE rst, RADIOLIB_PIN_TYPE busy, SPIClass &spi); }; diff --git a/src/mesh/SX126xInterface.cpp b/src/mesh/SX126xInterface.cpp index c4145a30c..acf84d1b6 100644 --- a/src/mesh/SX126xInterface.cpp +++ b/src/mesh/SX126xInterface.cpp @@ -47,6 +47,8 @@ template bool SX126xInterface::init() int res = lora.begin(getFreq(), bw, sf, cr, syncWord, power, preambleLength, tcxoVoltage, useRegulatorLDO); // \todo Display actual typename of the adapter, not just `SX126x` LOG_INFO("SX126x init result %d\n", res); + if (res == RADIOLIB_ERR_CHIP_NOT_FOUND) + return false; LOG_INFO("Frequency set to %f\n", getFreq()); LOG_INFO("Bandwidth set to %f\n", bw);