From d0e3427ec742223df6338c70b00fcc745bdfc53d Mon Sep 17 00:00:00 2001 From: jake-b <1012393+jake-b@users.noreply.github.com> Date: Mon, 9 Dec 2024 20:46:13 -0500 Subject: [PATCH 1/3] Fix detection for some RadSens hardware versions (#5542) Co-authored-by: Jake-B --- src/detect/ScanI2CTwoWire.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/detect/ScanI2CTwoWire.cpp b/src/detect/ScanI2CTwoWire.cpp index d29e5be8e..551b87d27 100644 --- a/src/detect/ScanI2CTwoWire.cpp +++ b/src/detect/ScanI2CTwoWire.cpp @@ -425,11 +425,14 @@ void ScanI2CTwoWire::scanPort(I2CPort port, uint8_t *address, uint8_t asize) case CGRADSENS_ADDR: // Register 0x00 of the RadSens sensor contains is product identifier 0x7D + // Undocumented, but some devices return a product identifier of 0x7A registerValue = getRegisterValue(ScanI2CTwoWire::RegisterLocation(addr, 0x00), 1); - if (registerValue == 0x7D) { + if (registerValue == 0x7D || registerValue == 0x7A) { type = CGRADSENS; logFoundDevice("ClimateGuard RadSens", (uint8_t)addr.address); break; + } else { + LOG_DEBUG("Unexpected Device ID for RadSense: addr=0x%x id=0x%x", CGRADSENS_ADDR, registerValue); } break; From 0e3dae4fec297b459da157872961fef506b808d0 Mon Sep 17 00:00:00 2001 From: Jonathan Bennett Date: Mon, 9 Dec 2024 21:51:55 -0600 Subject: [PATCH 2/3] Initialize dmac array to nulls (#5538) * Initialize dmac array to nulls * Use std::cout for print before console is init. --- src/platform/portduino/PortduinoGlue.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/platform/portduino/PortduinoGlue.cpp b/src/platform/portduino/PortduinoGlue.cpp index b6a017d9f..50b5c5b7b 100644 --- a/src/platform/portduino/PortduinoGlue.cpp +++ b/src/platform/portduino/PortduinoGlue.cpp @@ -86,7 +86,6 @@ void getMacAddr(uint8_t *dmac) if (optionMac != nullptr && strlen(optionMac) > 0) { if (strlen(optionMac) >= 12) { MAC_from_string(optionMac, dmac); - std::cout << optionMac << std::endl; } else { uint32_t hwId = sscanf(optionMac, "%u", &hwId); dmac[0] = 0x80; @@ -98,7 +97,6 @@ void getMacAddr(uint8_t *dmac) } } else if (settingsStrings[mac_address].length() > 11) { MAC_from_string(settingsStrings[mac_address], dmac); - std::cout << settingsStrings[mac_address] << std::endl; exit; } else { @@ -203,14 +201,14 @@ void portduinoSetup() } } - uint8_t dmac[6]; + uint8_t dmac[6] = {0}; getMacAddr(dmac); if (dmac[0] == 0 && dmac[1] == 0 && dmac[2] == 0 && dmac[3] == 0 && dmac[4] == 0 && dmac[5] == 0) { std::cout << "*** Blank MAC Address not allowed!" << std::endl; std::cout << "Please set a MAC Address in config.yaml using either MACAddress or MACAddressSource." << std::endl; exit(EXIT_FAILURE); } - printBytes("MAC Address: ", dmac, 6); + std::cout << "MAC Address: " << std::hex << +dmac[0] << +dmac[1] << +dmac[2] << +dmac[3] << +dmac[4] << +dmac[5] << std::endl; // Rather important to set this, if not running simulated. randomSeed(time(NULL)); @@ -531,4 +529,4 @@ bool MAC_from_string(std::string mac_str, uint8_t *dmac) } else { return false; } -} \ No newline at end of file +} From 438f627e9b856e20f0b537c5133f8cea5c4e795f Mon Sep 17 00:00:00 2001 From: Mark Trevor Birss Date: Tue, 10 Dec 2024 09:46:50 +0200 Subject: [PATCH 3/3] Update OpenWRT_One_mikroBUS_sx1262.yaml (#5544) --- bin/config.d/OpenWRT_One_mikroBUS_sx1262.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/config.d/OpenWRT_One_mikroBUS_sx1262.yaml b/bin/config.d/OpenWRT_One_mikroBUS_sx1262.yaml index f31411a51..6dc1e870d 100644 --- a/bin/config.d/OpenWRT_One_mikroBUS_sx1262.yaml +++ b/bin/config.d/OpenWRT_One_mikroBUS_sx1262.yaml @@ -2,7 +2,7 @@ Lora: Module: sx1262 IRQ: 10 Busy: 12 - Reset: 2 +# Reset: 2 spidev: spidev2.0 DIO2_AS_RF_SWITCH: true DIO3_TCXO_VOLTAGE: true