From a39ad747eae33f97783297c71115b950f13538ad Mon Sep 17 00:00:00 2001 From: Rysiek Labus Date: Sun, 14 Feb 2021 23:08:00 +0100 Subject: [PATCH] KISS ECHO disable option --- src/TTGO_T-Beam_LoRa_APRS.ino | 23 ++++++++++++----------- src/TTGO_T-Beam_LoRa_APRS_config.h | 11 ++++++----- 2 files changed, 18 insertions(+), 16 deletions(-) diff --git a/src/TTGO_T-Beam_LoRa_APRS.ino b/src/TTGO_T-Beam_LoRa_APRS.ino index 2b56a6b..0dd1cad 100644 --- a/src/TTGO_T-Beam_LoRa_APRS.ino +++ b/src/TTGO_T-Beam_LoRa_APRS.ino @@ -334,10 +334,14 @@ void handleKISSData(char character) { #ifdef KISS_PROTOCOLL const String &TNC2DataFrame = decode_kiss(inTNCData); - Serial.print(inTNCData); + #ifdef LOCAL_KISS_ECHO + Serial.print(inTNCData); + #endif #ifdef ENABLE_BLUETOOTH if (SerialBT.connected()) { - SerialBT.print(inTNCData); + #ifdef LOCAL_KISS_ECHO + SerialBT.print(inTNCData); + #endif } #endif #endif @@ -489,7 +493,6 @@ void loop() { } } #endif - #endif if (rf95.waitAvailableTimeout(100)) { @@ -598,14 +601,13 @@ void loop() { } } }else{ - if (millis() > time_to_refresh){ - if (gps.location.age() < 2000) { - writedisplaytext(" "+Tcall,"Time to TX: "+String(((lastTX+nextTX)-millis())/1000)+"sec","LAT: "+LatShown,"LON: "+LongShown,"SPD: "+String(gps.speed.kmph(),1)+" CRS: "+String(gps.course.deg(),1),getSatAndBatInfo() ,1); - } else { - displayInvalidGPS(); - } + if (millis() > time_to_refresh){ + if (gps.location.age() < 2000) { + writedisplaytext(" "+Tcall,"Time to TX: "+String(((lastTX+nextTX)-millis())/1000)+"sec","LAT: "+LatShown,"LON: "+LongShown,"SPD: "+String(gps.speed.kmph(),1)+" CRS: "+String(gps.course.deg(),1),getSatAndBatInfo() ,1); + } else { + displayInvalidGPS(); } - + } } #ifdef KISS_PROTOCOLL #ifdef KISS_DEBUG @@ -632,5 +634,4 @@ void loop() { #endif #endif } - // end of main loop diff --git a/src/TTGO_T-Beam_LoRa_APRS_config.h b/src/TTGO_T-Beam_LoRa_APRS_config.h index 74ffabd..f577648 100644 --- a/src/TTGO_T-Beam_LoRa_APRS_config.h +++ b/src/TTGO_T-Beam_LoRa_APRS_config.h @@ -11,8 +11,8 @@ #define DIGI_PATH "WIDE1-1" // one hope please (WIDE1-1) #define APRS_SYMBOL_TABLE "/" #define APRS_SYMBOL "[" // other symbols are: "[" => RUNNER, "b" => BICYCLE, "<" => MOTORCYCLE, "R" => Recreation Vehicle -#define MY_COMMENT "LoRa tracker TTGO" // add your coment here - if empty then no comment is sent -//#define SHOW_ALT // send Altitude in frame +#define MY_COMMENT "LoRa tracker" // add your coment here - if empty then no comment is sent +//#define SHOW_ALT // send Altitude in frame #define SHOW_BATT // send battery voltage at the end of comment (we need beggining for QSY message format) #define SHOW_RX_PACKET // uncomment to show received LoRa APS packets for the time given below #define SHOW_RX_TIME 30000 // show RX packet for milliseconds (5000 = 5secs) @@ -20,8 +20,9 @@ #define TXdbmW 20 // Transmit power in dBm 17-50mW, 18-63mW, 19-80mW, 20-100mW //#define SHOW_GPS_DATA // uncomment to show on serial port, received data from GPS and debug information #define ENABLE_BLUETOOTH -//#define BLUETOOTH_PIN "0000" -#define KISS_DEBUG +#define BLUETOOTH_PIN "0000" +//#define KISS_DEBUG +//#define LOCAL_KISS_ECHO // echoing KISS frame back #define T_BEAM_V1_0 // if enabled t-beam v1.0 disabled t-beam V.0.7 -unsigned long max_time_to_nextTX = 180000L; // TRANSMIT INTERVAL set here MAXIMUM time in ms(!) for smart beaconing - minimum time is always 1 min = 60 secs = 60000L !!! \ No newline at end of file +unsigned long max_time_to_nextTX = 360000L; // TRANSMIT INTERVAL set here MAXIMUM time in ms(!) for smart beaconing - minimum time is always 1 min = 60 secs = 60000L !!! \ No newline at end of file