diff --git a/src/TTGO_T-Beam_LoRa_APRS.ino b/src/TTGO_T-Beam_LoRa_APRS.ino index 9437234..071ddfa 100644 --- a/src/TTGO_T-Beam_LoRa_APRS.ino +++ b/src/TTGO_T-Beam_LoRa_APRS.ino @@ -71,6 +71,10 @@ String LatShown=""; String LongFixed=""; String LatFixed=""; +#if defined(ENABLE_TNC_SELF_TELEMETRY) && defined(KISS_PROTOCOL) + time_t nextTelemetryFrame; +#endif + //byte arrays byte lora_TXBUFF[BG_RF95_MAX_MESSAGE_LEN]; //buffer for packet to send byte lora_RXBUFF[BG_RF95_MAX_MESSAGE_LEN]; //buffer for packet to send @@ -163,12 +167,8 @@ void prepareAPRSFrame(){ //} outString = ""; - for (i=0; iAPLM0" + ":"; + sendToTNC(telemetryBase + telemetryParamsNames); + sendToTNC(telemetryBase + telemetryUnitNames); + sendToTNC(telemetryBase + telemetryEquations); + sendToTNC(telemetryBase + telemetryData); + #else + #endif +} +#endif // + SETUP --------------------------------------------------------------+// @@ -361,7 +394,7 @@ void setup(){ } writedisplaytext("LoRa-APRS","","Init:","Display OK!","","",1000); - Tcall = CALLSIGN; + Tcall = prepareCallsign(String(CALLSIGN)); relay_path = DIGI_PATH; if (!rf95.init()) { @@ -580,6 +613,12 @@ void loop() { } } } + #if defined(ENABLE_TNC_SELF_TELEMETRY) && defined(KISS_PROTOCOL) + if (nextTelemetryFrame < millis()){ + nextTelemetryFrame = millis() + TNC_SELF_TELEMETRY_INTERVAL; + sendTelemetryFrame(); + } + #endif #ifdef KISS_PROTOCOL #ifdef KISS_DEBUG static auto last_debug_send_time = millis(); diff --git a/src/TTGO_T-Beam_LoRa_APRS_config.h b/src/TTGO_T-Beam_LoRa_APRS_config.h index f86cf3f..b3e6583 100644 --- a/src/TTGO_T-Beam_LoRa_APRS_config.h +++ b/src/TTGO_T-Beam_LoRa_APRS_config.h @@ -24,10 +24,12 @@ //#define SHOW_GPS_DATA // uncomment to show on serial port, received data from GPS and debug information #define ENABLE_BLUETOOTH // bluetooth KISS interface enable //#define BLUETOOTH_PIN "0000" -//#define KISS_DEBUG +//#define ENABLE_TNC_SELF_TELEMETRY //#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 //#define KISS_DEBUG #define MAX_TIME_TO_NEXT_TX 360000L // TRANSMIT INTERVAL set here MAXIMUM time in ms(!) for smart beaconing - minimum time is always 1 min = 60 secs = 60000L !!! -#define FIX_BEACON_INTERVAL 1800000L // Fixed beacon interwal (when GPS is disabled and FIXED_BEACON_EN is enabled) 30min default \ No newline at end of file +#define FIX_BEACON_INTERVAL 1800000L // Fixed beacon interwal (when GPS is disabled and FIXED_BEACON_EN is enabled) 30min default +#define TNC_SELF_TELEMETRY_INTERVAL (5*60*1000) +