diff --git a/src/LoRa_APRS_iGate.cpp b/src/LoRa_APRS_iGate.cpp index 4f2e700..c1d9f4b 100644 --- a/src/LoRa_APRS_iGate.cpp +++ b/src/LoRa_APRS_iGate.cpp @@ -182,13 +182,14 @@ void loop() { Utils::checkDisplayInterval(); Utils::checkBeaconInterval(); - String packet; + + APRS_IS_Utils::checkStatus(); // Need that to update display, maybe split this and send APRSIS status to display func? + + String packet = ""; if (Config.loramodule.rxActive) { packet = LoRa_Utils::receivePacket(); // We need to fetch LoRa packet above APRSIS and Digi - } - - APRS_IS_Utils::checkStatus(); // Need that to update display, maybe split this and send APRSIS status to display func? + } if (packet != "") { if (Config.aprs_is.active) { // If APRSIS enabled diff --git a/src/lora_utils.cpp b/src/lora_utils.cpp index 8946d48..80ae3c1 100644 --- a/src/lora_utils.cpp +++ b/src/lora_utils.cpp @@ -97,9 +97,9 @@ namespace LoRa_Utils { changeFreqTx(); } - #ifdef HAS_INTERNAL_LED + #ifdef HAS_INTERNAL_LED digitalWrite(internalLedPin, HIGH); - #endif + #endif int state = radio.transmit("\x3c\xff\x01" + newPacket); transmissionFlag = true; if (state == RADIOLIB_ERR_NONE) { @@ -116,9 +116,9 @@ namespace LoRa_Utils { Utils::print(F("failed, code ")); Utils::println(String(state)); } - #ifdef HAS_INTERNAL_LED + #ifdef HAS_INTERNAL_LED digitalWrite(internalLedPin, LOW); - #endif + #endif if (Config.loramodule.txFreq != Config.loramodule.rxFreq) { changeFreqRx(); } @@ -169,7 +169,7 @@ namespace LoRa_Utils { freqError = radio.getFrequencyError(); Utils::println("<--- LoRa Packet Rx : " + loraPacket); Utils::println("(RSSI:" + String(rssi) + " / SNR:" + String(snr) + " / FreqErr:" + String(freqError) + ")"); - if (Config.syslog.active && WiFi.status() == WL_CONNECTED && loraPacket != "") { + if (Config.syslog.active && WiFi.status() == WL_CONNECTED) { SYSLOG_Utils::log("Rx", loraPacket, rssi, snr, freqError); } return loraPacket;