From 7fadeb303c0e27b7186994d02d13676b7cbd01d4 Mon Sep 17 00:00:00 2001 From: Morgan Diepart Date: Tue, 20 Dec 2022 22:18:18 +0100 Subject: [PATCH 1/7] LoRa32 V2 does not have a power management chip --- lib/BoardFinder/BoardFinder.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/BoardFinder/BoardFinder.cpp b/lib/BoardFinder/BoardFinder.cpp index 797d229..37dd058 100644 --- a/lib/BoardFinder/BoardFinder.cpp +++ b/lib/BoardFinder/BoardFinder.cpp @@ -131,7 +131,7 @@ bool BoardFinder::checkPowerConfig(BoardConfig const *boardConfig, logging::Logg // clang-format off BoardConfig TTGO_LORA32_V1 ("TTGO_LORA32_V1", eTTGO_LORA32_V1, 4, 15, 0x3C, 0, 5, 19, 27, 18, 14, 26, 0, 0, 0); -BoardConfig TTGO_LORA32_V2 ("TTGO_LORA32_V2", eTTGO_LORA32_V2, 21, 22, 0x3C, 0, 5, 19, 27, 18, 14, 26, 0, 0, 0, true); +BoardConfig TTGO_LORA32_V2 ("TTGO_LORA32_V2", eTTGO_LORA32_V2, 21, 22, 0x3C, 0, 5, 19, 27, 18, 14, 26, 0, 0, 0); BoardConfig TTGO_T_Beam_V0_7 ("TTGO_T_Beam_V0_7", eTTGO_T_Beam_V0_7, 21, 22, 0x3C, 0, 5, 19, 27, 18, 14, 26, 15, 12, 38, true); BoardConfig TTGO_T_Beam_V1_0 ("TTGO_T_Beam_V1_0", eTTGO_T_Beam_V1_0, 21, 22, 0x3C, 0, 5, 19, 27, 18, 14, 26, 12, 34, 38, true, true); BoardConfig ETH_BOARD ("ETH_BOARD", eETH_BOARD, 33, 32, 0x3C, 0, 14, 2, 15, 12, 4, 36, 0, 0, 0); From da77afcbe5aa3aa20e338984741d8982364c9f49 Mon Sep 17 00:00:00 2001 From: Morgan Diepart Date: Tue, 20 Dec 2022 22:19:34 +0100 Subject: [PATCH 2/7] Closing comm devices When checking for the board, close the communication devices. If we do not do that, successive calls to begin will not configure the pins properly and thus the board check might fail... --- lib/BoardFinder/BoardFinder.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/lib/BoardFinder/BoardFinder.cpp b/lib/BoardFinder/BoardFinder.cpp index 37dd058..cc87d6f 100644 --- a/lib/BoardFinder/BoardFinder.cpp +++ b/lib/BoardFinder/BoardFinder.cpp @@ -21,6 +21,7 @@ BoardConfig const *BoardFinder::searchBoardConfig(logging::Logger &logger) { Wire.begin(boardconf->OledSda, boardconf->OledScl); powerManagement.begin(Wire); powerManagement.activateOLED(); + Wire.end(); } else if (boardconf->needCheckPowerChip) { continue; } @@ -38,6 +39,7 @@ BoardConfig const *BoardFinder::searchBoardConfig(logging::Logger &logger) { Wire.begin(boardconf->OledSda, boardconf->OledScl); powerManagement.begin(Wire); powerManagement.activateLoRa(); + Wire.end(); } if (checkModemConfig(boardconf)) { logger.log(logging::LoggerLevel::LOGGER_LEVEL_INFO, MODULE_NAME, "found a board config: %s", boardconf->Name.c_str()); @@ -75,8 +77,10 @@ bool BoardFinder::checkOledConfig(BoardConfig const *boardConfig, logging::Logge } Wire.beginTransmission(boardConfig->OledAddr); if (!Wire.endTransmission()) { + Wire.end(); return true; } + Wire.end(); return false; } @@ -98,9 +102,8 @@ bool BoardFinder::checkModemConfig(BoardConfig const *boardConfig) { SPI.transfer(0x42); uint8_t response = SPI.transfer(0x00); SPI.endTransaction(); - digitalWrite(boardConfig->LoraCS, HIGH); - + SPI.end(); if (response == 0x12) { return true; } @@ -120,6 +123,8 @@ bool BoardFinder::checkPowerConfig(BoardConfig const *boardConfig, logging::Logg int response = Wire.read(); Wire.endTransmission(); + Wire.end(); + logger.log(logging::LoggerLevel::LOGGER_LEVEL_DEBUG, MODULE_NAME, "wire response: %d", response); if (response == 0x03) { logger.log(logging::LoggerLevel::LOGGER_LEVEL_DEBUG, MODULE_NAME, "power chip found!"); From 1df06c66d58c07c65923c813a1993a4baad293b6 Mon Sep 17 00:00:00 2001 From: Morgan Diepart Date: Tue, 20 Dec 2022 22:19:34 +0100 Subject: [PATCH 3/7] Revert "Closing comm devices" This reverts commit da77afcbe5aa3aa20e338984741d8982364c9f49. --- lib/BoardFinder/BoardFinder.cpp | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/lib/BoardFinder/BoardFinder.cpp b/lib/BoardFinder/BoardFinder.cpp index cc87d6f..37dd058 100644 --- a/lib/BoardFinder/BoardFinder.cpp +++ b/lib/BoardFinder/BoardFinder.cpp @@ -21,7 +21,6 @@ BoardConfig const *BoardFinder::searchBoardConfig(logging::Logger &logger) { Wire.begin(boardconf->OledSda, boardconf->OledScl); powerManagement.begin(Wire); powerManagement.activateOLED(); - Wire.end(); } else if (boardconf->needCheckPowerChip) { continue; } @@ -39,7 +38,6 @@ BoardConfig const *BoardFinder::searchBoardConfig(logging::Logger &logger) { Wire.begin(boardconf->OledSda, boardconf->OledScl); powerManagement.begin(Wire); powerManagement.activateLoRa(); - Wire.end(); } if (checkModemConfig(boardconf)) { logger.log(logging::LoggerLevel::LOGGER_LEVEL_INFO, MODULE_NAME, "found a board config: %s", boardconf->Name.c_str()); @@ -77,10 +75,8 @@ bool BoardFinder::checkOledConfig(BoardConfig const *boardConfig, logging::Logge } Wire.beginTransmission(boardConfig->OledAddr); if (!Wire.endTransmission()) { - Wire.end(); return true; } - Wire.end(); return false; } @@ -102,8 +98,9 @@ bool BoardFinder::checkModemConfig(BoardConfig const *boardConfig) { SPI.transfer(0x42); uint8_t response = SPI.transfer(0x00); SPI.endTransaction(); + digitalWrite(boardConfig->LoraCS, HIGH); - SPI.end(); + if (response == 0x12) { return true; } @@ -123,8 +120,6 @@ bool BoardFinder::checkPowerConfig(BoardConfig const *boardConfig, logging::Logg int response = Wire.read(); Wire.endTransmission(); - Wire.end(); - logger.log(logging::LoggerLevel::LOGGER_LEVEL_DEBUG, MODULE_NAME, "wire response: %d", response); if (response == 0x03) { logger.log(logging::LoggerLevel::LOGGER_LEVEL_DEBUG, MODULE_NAME, "power chip found!"); From b8ad764b35b889c757f6c40563645b4315c87ae8 Mon Sep 17 00:00:00 2001 From: root Date: Fri, 20 Jan 2023 10:44:25 +0000 Subject: [PATCH 4/7] Bump TinyGPSPlus to 1.0.3 --- platformio.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platformio.ini b/platformio.ini index 75d41b9..dbd2036 100644 --- a/platformio.ini +++ b/platformio.ini @@ -14,7 +14,7 @@ lib_deps = peterus/esp-logger @ 1.0.0 peterus/ESP-FTP-Server-Lib @ 0.9.5 knolleary/PubSubClient@^2.8 - mikalhart/TinyGPSPlus @ 1.0.2 + mikalhart/TinyGPSPlus @ 1.0.3 shaggydog/OneButton @ 1.5.0 jgromes/RadioLib @ 5.1.2 check_tool = cppcheck From f6e9136b7c8fb54592112b502a710464bad839e7 Mon Sep 17 00:00:00 2001 From: root Date: Fri, 20 Jan 2023 10:44:33 +0000 Subject: [PATCH 5/7] Bump ArduinoJson to 6.20.0 --- platformio.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platformio.ini b/platformio.ini index 75d41b9..df65ab4 100644 --- a/platformio.ini +++ b/platformio.ini @@ -8,7 +8,7 @@ lib_ldf_mode = deep+ monitor_speed = 115200 monitor_raw = yes lib_deps = - bblanchon/ArduinoJson @ 6.17.0 + bblanchon/ArduinoJson @ 6.20.0 lewisxhe/AXP202X_Library @ 1.1.2 peterus/APRS-Decoder-Lib @ 0.0.6 peterus/esp-logger @ 1.0.0 From a1300f926644a5f7f7a5744f1bddb7e562ac1917 Mon Sep 17 00:00:00 2001 From: root Date: Fri, 20 Jan 2023 10:44:41 +0000 Subject: [PATCH 6/7] Bump AXP202X_Library to 1.1.3 --- platformio.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platformio.ini b/platformio.ini index 75d41b9..2098c7d 100644 --- a/platformio.ini +++ b/platformio.ini @@ -9,7 +9,7 @@ monitor_speed = 115200 monitor_raw = yes lib_deps = bblanchon/ArduinoJson @ 6.17.0 - lewisxhe/AXP202X_Library @ 1.1.2 + lewisxhe/AXP202X_Library @ 1.1.3 peterus/APRS-Decoder-Lib @ 0.0.6 peterus/esp-logger @ 1.0.0 peterus/ESP-FTP-Server-Lib @ 0.9.5 From ccefe0f9878736379a424cc166a8c80fea1c147a Mon Sep 17 00:00:00 2001 From: root Date: Fri, 20 Jan 2023 10:44:45 +0000 Subject: [PATCH 7/7] Bump RadioLib to 5.6.0 --- platformio.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platformio.ini b/platformio.ini index 75d41b9..0104029 100644 --- a/platformio.ini +++ b/platformio.ini @@ -16,7 +16,7 @@ lib_deps = knolleary/PubSubClient@^2.8 mikalhart/TinyGPSPlus @ 1.0.2 shaggydog/OneButton @ 1.5.0 - jgromes/RadioLib @ 5.1.2 + jgromes/RadioLib @ 5.6.0 check_tool = cppcheck check_flags = cppcheck: --suppress=*:*.pio\* --inline-suppr -DCPPCHECK --force lib -ilib/TimeLib -ilib/LoRa -ilib/NTPClient