From 0885fde3ec2912acff94da7756b9fba2b877cff3 Mon Sep 17 00:00:00 2001 From: sh123 Date: Sat, 2 Jan 2021 13:57:50 +0200 Subject: [PATCH] Increased lora timeout --- loraprs_service.cpp | 4 ++-- loraprs_service.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/loraprs_service.cpp b/loraprs_service.cpp index 07c4773..1fbd849 100644 --- a/loraprs_service.cpp +++ b/loraprs_service.cpp @@ -310,7 +310,7 @@ void Service::onLoraDataAvailable(int packetSize) } } 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 canSend = false; for (int i = 0; i < CfgLoraTxWaitMs; i++) { if (LoRa.beginPacket() == 1) { return true; @@ -353,6 +352,7 @@ void Service::onBtDataAvailable() if (rxByte != KissMarker::Fend) { if (rxByte == KissCmd::Data) { if (!loraBeginPacketAndWait()) { + Serial.println("LoRa buffer overflow, dropping packet"); kissResetState(); return; } diff --git a/loraprs_service.h b/loraprs_service.h index 803e6ea..fff6b96 100644 --- a/loraprs_service.h +++ b/loraprs_service.h @@ -72,7 +72,7 @@ private: const String CfgLoraprsVersion = "LoRAPRS 0.1"; const int CfgPollDelayMs = 5; - const int CfgLoraTxWaitMs = 500; + const int CfgLoraTxWaitMs = 2000; // tx when lower than this value from random 0..255 // use lower value for high traffic, use 255 for real time