Increased lora timeout

pull/15/head
sh123 2021-01-02 13:57:50 +02:00
rodzic 4afb1cfd2b
commit 0885fde3ec
2 zmienionych plików z 3 dodań i 3 usunięć

Wyświetl plik

@ -310,7 +310,7 @@ void Service::onLoraDataAvailable(int packetSize)
} }
} }
else { else {
Serial.println("Invalid or unsupported payload from LoRA"); Serial.println("Skipping non-AX25 payload");
} }
} }
} }
@ -323,7 +323,6 @@ void Service::kissResetState()
bool Service::loraBeginPacketAndWait() bool Service::loraBeginPacketAndWait()
{ {
bool canSend = false;
for (int i = 0; i < CfgLoraTxWaitMs; i++) { for (int i = 0; i < CfgLoraTxWaitMs; i++) {
if (LoRa.beginPacket() == 1) { if (LoRa.beginPacket() == 1) {
return true; return true;
@ -353,6 +352,7 @@ void Service::onBtDataAvailable()
if (rxByte != KissMarker::Fend) { if (rxByte != KissMarker::Fend) {
if (rxByte == KissCmd::Data) { if (rxByte == KissCmd::Data) {
if (!loraBeginPacketAndWait()) { if (!loraBeginPacketAndWait()) {
Serial.println("LoRa buffer overflow, dropping packet");
kissResetState(); kissResetState();
return; return;
} }

Wyświetl plik

@ -72,7 +72,7 @@ private:
const String CfgLoraprsVersion = "LoRAPRS 0.1"; const String CfgLoraprsVersion = "LoRAPRS 0.1";
const int CfgPollDelayMs = 5; const int CfgPollDelayMs = 5;
const int CfgLoraTxWaitMs = 500; const int CfgLoraTxWaitMs = 2000;
// tx when lower than this value from random 0..255 // tx when lower than this value from random 0..255
// use lower value for high traffic, use 255 for real time // use lower value for high traffic, use 255 for real time