From fb4b6a25bda77ebcf8120b2f8e213056b1f5c253 Mon Sep 17 00:00:00 2001 From: richonguzman Date: Tue, 19 Mar 2024 22:41:07 -0300 Subject: [PATCH] signalBandwidth fixed --- src/lora_utils.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/lora_utils.cpp b/src/lora_utils.cpp index d6c3190b..d36d5e8e 100644 --- a/src/lora_utils.cpp +++ b/src/lora_utils.cpp @@ -63,7 +63,8 @@ namespace LoRa_Utils { } radio.setDio1Action(setFlag); radio.setSpreadingFactor(Config.loramodule.spreadingFactor); - radio.setBandwidth(Config.loramodule.signalBandwidth); + float signalBandwidth = Config.loramodule.signalBandwidth/1000; + radio.setBandwidth(signalBandwidth); radio.setCodingRate(Config.loramodule.codingRate4); radio.setCRC(true); #if defined(ESP32_DIY_1W_LoRa) @@ -195,7 +196,9 @@ namespace LoRa_Utils { radio.startReceive(); int state = radio.readData(loraPacket); if (state == RADIOLIB_ERR_NONE) { - Serial.println("LoRa Rx ---> " + loraPacket); + if(!loraPacket.isEmpty()) { + Serial.println("LoRa Rx ---> " + loraPacket); + } rssi = radio.getRSSI(); snr = radio.getSNR(); freqError = radio.getFrequencyError();