From 5edc872c31dda13674d69fe3f132fc00d3418a23 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sat, 3 Jun 2023 06:19:38 -0500 Subject: [PATCH 1/5] [create-pull-request] automated change (#2540) Co-authored-by: thebentern --- version.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version.properties b/version.properties index d131e4cc8..c3cd821a8 100644 --- a/version.properties +++ b/version.properties @@ -1,4 +1,4 @@ [VERSION] major = 2 minor = 1 -build = 15 +build = 16 From 365a91f3d9e6ab8b811c701384472c9943214753 Mon Sep 17 00:00:00 2001 From: GUVWAF <78759985+GUVWAF@users.noreply.github.com> Date: Tue, 6 Jun 2023 18:59:44 +0200 Subject: [PATCH 2/5] Add Raspberry Pi Pico and RAK11310 to bug report --- .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 795c1b1a0..d4e00b4ed 100644 --- a/.github/ISSUE_TEMPLATE/Bug Report.yml +++ b/.github/ISSUE_TEMPLATE/Bug Report.yml @@ -40,10 +40,12 @@ body: - T-Echo - Rak4631 - Rak11200 + - Rak11310 - Heltec v1 - Heltec v2 - Heltec v2.1 - Heltec V3 + - Raspberry Pi Pico (W) - Relay v1 - Relay v2 - DIY From fb14487f2fbb2d7293fd8e0f4bf15a50c241f2f3 Mon Sep 17 00:00:00 2001 From: rcarteraz Date: Tue, 6 Jun 2023 15:31:27 -0700 Subject: [PATCH 3/5] Update pull_request_template.md (#2547) Swap clang-format with trunk check --- .github/pull_request_template.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index 9ef8f77c6..32f280a04 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -7,7 +7,8 @@ is appreciated." This will allow other devs to potentially save you time by not accidentially duplicating work etc... - Please do not check in files that don't have real changes - Please do not reformat lines that you didn't have to change the code on -- We recommend using the [Visual Studio Code](https://platformio.org/install/ide?install=vscode) editor and the 'clang-format' extension, - because automatically follows our indentation rules and it's auto reformatting will not cause spurious changes to lines. +- We recommend using the [Visual Studio Code](https://platformio.org/install/ide?install=vscode) editor along with the ['Trunk Check' extension](https://marketplace.visualstudio.com/items?itemName=trunk.io) (WSL2 is required on windows), + because it automatically follows our indentation rules and its auto reformatting will not cause spurious changes to lines. - If your PR fixes a bug, mention "fixes #bugnum" somewhere in your pull request description. - If your other co-developers have comments on your PR please tweak as needed. +- Please also enable "Allow edits by maintainers". From 207d421fca1f0200628a1dd21cc120f3da88c072 Mon Sep 17 00:00:00 2001 From: Andre K Date: Tue, 6 Jun 2023 19:33:51 -0300 Subject: [PATCH 4/5] refactor tx delay calculation for routers and non-routers (#2542) --- 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 1eee86c8e..00af93e15 100644 --- a/src/mesh/RadioInterface.cpp +++ b/src/mesh/RadioInterface.cpp @@ -232,7 +232,8 @@ uint32_t RadioInterface::getTxDelayMsecWeighted(float snr) delay = random(0, 2 * CWsize) * slotTimeMsec; LOG_DEBUG("rx_snr found in packet. As a router, setting tx delay:%d\n", delay); } else { - delay = random(0, pow(2, CWsize)) * slotTimeMsec; + // offset the maximum delay for routers: (2 * CWmax * slotTimeMsec) + delay = (2 * CWmax * slotTimeMsec) + random(0, pow(2, CWsize)) * slotTimeMsec; LOG_DEBUG("rx_snr found in packet. Setting tx delay:%d\n", delay); } From 194833d77f77127e578bfe74980b57a170b253e0 Mon Sep 17 00:00:00 2001 From: Michel Jung Date: Wed, 7 Jun 2023 02:26:13 +0200 Subject: [PATCH 5/5] Fix static ethernet config (#2544) With static ethernet config, `status` stayed `0` which let the function return without setting `ethEvent`. Therefore, `reconnectETH` was never called and network services were never started. Also, the RAK4631 uses little endian, which is why the IP addresses need to be converted before setting them. Fixes #2543 --- src/mesh/eth/ethClient.cpp | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/mesh/eth/ethClient.cpp b/src/mesh/eth/ethClient.cpp index 659de05f8..c60e35394 100644 --- a/src/mesh/eth/ethClient.cpp +++ b/src/mesh/eth/ethClient.cpp @@ -98,6 +98,11 @@ static int32_t reconnectETH() return 5000; // every 5 seconds } +static uint32_t bigToLittleEndian(uint32_t value) +{ + return ((value >> 24) & 0xFF) | ((value >> 8) & 0xFF00) | ((value << 8) & 0xFF0000) | ((value << 24) & 0xFF000000); +} + // Startup Ethernet bool initEthernet() { @@ -126,7 +131,15 @@ bool initEthernet() status = Ethernet.begin(mac); } else if (config.network.address_mode == meshtastic_Config_NetworkConfig_AddressMode_STATIC) { LOG_INFO("starting Ethernet Static\n"); - Ethernet.begin(mac, config.network.ipv4_config.ip, config.network.ipv4_config.dns, config.network.ipv4_config.subnet); + + IPAddress ip = IPAddress(bigToLittleEndian(config.network.ipv4_config.ip)); + IPAddress dns = IPAddress(bigToLittleEndian(config.network.ipv4_config.dns)); + IPAddress gateway = IPAddress(bigToLittleEndian(config.network.ipv4_config.gateway)); + IPAddress subnet = IPAddress(bigToLittleEndian(config.network.ipv4_config.subnet)); + + Ethernet.begin(mac, ip, dns, gateway, subnet); + + status = 1; } else { LOG_INFO("Ethernet Disabled\n"); return false;