Skip to content

Commit

Permalink
signalBandwidth fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
richonguzman committed Mar 20, 2024
1 parent 4c30422 commit fb4b6a2
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/lora_utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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();
Expand Down

0 comments on commit fb4b6a2

Please sign in to comment.