From 51dadb64e302fcd309b1fb0c50ec146f7ae2f762 Mon Sep 17 00:00:00 2001 From: richonguzman Date: Sat, 11 Feb 2023 17:45:44 -0300 Subject: [PATCH] comments update --- src/Lora_1W_APRS_Tracker.cpp | 14 +++++++++++--- src/beacon_config.h | 2 +- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/src/Lora_1W_APRS_Tracker.cpp b/src/Lora_1W_APRS_Tracker.cpp index 6ef5c1b..f5adb1e 100644 --- a/src/Lora_1W_APRS_Tracker.cpp +++ b/src/Lora_1W_APRS_Tracker.cpp @@ -115,7 +115,8 @@ void setup() { } uint8_t tx_buffer[256]; -uint32_t lastTxTime = 0; +uint32_t lastTxTime = 0; +uint32_t lastCommentTxTime = 0; char *ax25_base91enc(char *s, uint8_t n, uint32_t v) { /* Creates a Base-91 representation of the value in v in the string */ @@ -144,6 +145,7 @@ void loop() { static double lastTxLongitude = 0.0; static double lastTxDistance = 0.0; static uint32_t txInterval = 60000L; + uint32_t txCommentInterval = 15*60*1000; int CurrentSpeed = (int)gps.speed.kmph(); //static int speed_zero_sent = 0; @@ -241,8 +243,14 @@ void loop() { } if (SendComment) { - //AprsPacketMsg += APRS_COMMENT; - AprsPacketMsg += mensaje_test; + uint32_t lastCommentTx = millis() - lastCommentTxTime; + if (lastCommentTx >= txCommentInterval) { + AprsPacketMsg += AprsComment; + lastCommentTxTime = millis(); + } else { + AprsPacketMsg += mensaje_test; //esto es solo para validar giro distancia y otras cosas + } + } Serial.print(F("GPS coordinates: ")); // Only for Serial Monitor diff --git a/src/beacon_config.h b/src/beacon_config.h index 88a2b27..1e187bf 100644 --- a/src/beacon_config.h +++ b/src/beacon_config.h @@ -6,7 +6,7 @@ #define AprsOverlay "/" #define SendAltitude true // "true" adds Altitude to the APRS packet/message, "false" add Course+Speed #define SendComment true // "true" adds comment to the APRS packet/message -#define APRS_COMMENT "https://github.com/richonguzman/LoRa_1W_APRS_Tracker" // To send this comment --> SendComment = true (edit the comment as you like) +#define AprsComment "https://github.com/richonguzman/LoRa_1W_APRS_Tracker" // To send this comment --> SendComment = true (edit the comment as you like) #define User1_Callsign "CD2RXU-7" // This is my Callsign , so go on and change it to yours!!! #define User1_Symbol "[" // Runner