From d10b1e1d00034b1d80ea063a110f6651b47e9a11 Mon Sep 17 00:00:00 2001 From: Jonathan Bennett Date: Sun, 26 Nov 2023 20:31:52 -0600 Subject: [PATCH] Add better error reporting for RF95 init failure --- src/mesh/RadioLibRF95.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/mesh/RadioLibRF95.cpp b/src/mesh/RadioLibRF95.cpp index 0fa6c7fe8..eca2509aa 100644 --- a/src/mesh/RadioLibRF95.cpp +++ b/src/mesh/RadioLibRF95.cpp @@ -14,8 +14,10 @@ int16_t RadioLibRF95::begin(float freq, float bw, uint8_t sf, uint8_t cr, uint8_ { // execute common part int16_t state = SX127x::begin(RF95_CHIP_VERSION, syncWord, preambleLength); - if (state != RADIOLIB_ERR_NONE) + if (state != RADIOLIB_ERR_NONE) { + LOG_WARN("Initial probe for RF95 failed with %d, trying again with alternative hardware version\n", state); state = SX127x::begin(RF95_ALT_VERSION, syncWord, preambleLength); + } RADIOLIB_ASSERT(state); // current limit was removed from module' ctor @@ -80,4 +82,4 @@ bool RadioLibRF95::isReceiving() uint8_t RadioLibRF95::readReg(uint8_t addr) { return mod->SPIreadRegister(addr); -} \ No newline at end of file +}