From 56c0010a3be38f28e8beaa0a08a6772bda13673b Mon Sep 17 00:00:00 2001 From: richonguzman Date: Fri, 9 Jun 2023 00:23:11 -0400 Subject: [PATCH] betaTestDigirepeater --- data/igate_conf.json | 4 +--- src/LoRa_APRS_iGate.cpp | 2 +- src/configuration.cpp | 2 -- src/configuration.h | 2 -- src/digi_utils.cpp | 39 +++++++++++++++++++++++++-------------- src/utils.cpp | 6 +++--- 6 files changed, 30 insertions(+), 25 deletions(-) diff --git a/data/igate_conf.json b/data/igate_conf.json index 02edb31..de8aa7c 100644 --- a/data/igate_conf.json +++ b/data/igate_conf.json @@ -42,8 +42,6 @@ }, "other": { "beaconInterval": 15, - "rememberStationTime": 30, - "statusAfterBoot": true, - "defaultStatus": "https://github.com/richonguzman/LoRa_APRS_iGate" + "rememberStationTime": 30 } } \ No newline at end of file diff --git a/src/LoRa_APRS_iGate.cpp b/src/LoRa_APRS_iGate.cpp index 3486874..8db22ba 100644 --- a/src/LoRa_APRS_iGate.cpp +++ b/src/LoRa_APRS_iGate.cpp @@ -26,7 +26,7 @@ WiFiClient espClient; int myWiFiAPIndex = 0; int myWiFiAPSize = Config.wifiAPs.size(); WiFi_AP *currentWiFi = &Config.wifiAPs[myWiFiAPIndex]; -bool statusAfterBoot = Config.statusAfterBoot; +bool statusAfterBoot = true; int stationMode = Config.stationMode; bool beacon_update = true; diff --git a/src/configuration.cpp b/src/configuration.cpp index afcc7b2..f5eaae5 100644 --- a/src/configuration.cpp +++ b/src/configuration.cpp @@ -34,8 +34,6 @@ void Configuration::readFile(fs::FS &fs, const char *fileName) { iGateComment = data["iGateComment"].as(); beaconInterval = data["other"]["beaconInterval"].as(); rememberStationTime = data["other"]["rememberStationTime"].as(); - statusAfterBoot = data["other"]["statusAfterBoot"].as(); - defaultStatus = data["other"]["defaultStatus"].as(); digi.comment = data["digi"]["comment"].as(); digi.latitude = data["digi"]["latitude"].as(); diff --git a/src/configuration.h b/src/configuration.h index aad2ef0..f45bf66 100644 --- a/src/configuration.h +++ b/src/configuration.h @@ -56,8 +56,6 @@ public: String iGateComment; int beaconInterval; int rememberStationTime; - bool statusAfterBoot; - String defaultStatus; std::vector wifiAPs; DIGI digi; APRS_IS aprs_is; diff --git a/src/digi_utils.cpp b/src/digi_utils.cpp index e59c34e..e376b96 100644 --- a/src/digi_utils.cpp +++ b/src/digi_utils.cpp @@ -32,22 +32,33 @@ void processPacket(String packet) { String firstPart, lastPart, loraPacket; if (packet != "") { Serial.print("Received Lora Packet : " + String(packet)); - if ((packet.substring(0, 3) == "\x3c\xff\x01") && (packet.indexOf("NOGATE") == -1) && (packet.indexOf("WIDE1-1") > 10)) { // confirmar lo de WIDE1-1 !!! + if ((packet.substring(0, 3) == "\x3c\xff\x01") && (packet.indexOf("NOGATE") == -1)) { Serial.println(" ---> APRS LoRa Packet"); - typeOfPacket(packet); - firstPart = packet.substring(3,packet.indexOf(",")+1); - lastPart = packet.substring(packet.indexOf(":")); - loraPacket = firstPart + Config.callsign + "*" + lastPart; - delay(500); - if (stationMode == 4) { // Digirepeating with Freq Rx != Tx - LoRa_Utils::changeFreqTx(); + if ((stationMode==3) && (packet.indexOf("WIDE1-1") > 10)) { + typeOfPacket(packet); + firstPart = packet.substring(3,packet.indexOf(",")+1); + lastPart = packet.substring(packet.indexOf(":")); + loraPacket = firstPart + Config.callsign + "*" + lastPart; + delay(500); + LoRa_Utils::sendNewPacket("APRS", loraPacket); + display_toggle(true); + lastScreenOn = millis(); + } else { // stationMode = 4 + typeOfPacket(packet); + firstPart = packet.substring(3,packet.indexOf(",")+1); + lastPart = packet.substring(packet.indexOf(",")+1); + loraPacket = firstPart + Config.callsign + lastPart; // se agrega "*"" ??? + delay(500); + if (stationMode == 4) { // Digirepeating with Freq Rx != Tx + LoRa_Utils::changeFreqTx(); + } + LoRa_Utils::sendNewPacket("APRS", loraPacket); + if (stationMode == 4) { + LoRa_Utils::changeFreqRx(); + } + display_toggle(true); + lastScreenOn = millis(); } - LoRa_Utils::sendNewPacket("APRS", loraPacket); - if (stationMode == 4) { - LoRa_Utils::changeFreqRx(); - } - display_toggle(true); - lastScreenOn = millis(); } else { Serial.println(" ---> LoRa Packet Ignored (first 3 bytes or NOGATE)\n"); } diff --git a/src/utils.cpp b/src/utils.cpp index b5b0c9b..4da494d 100644 --- a/src/utils.cpp +++ b/src/utils.cpp @@ -24,12 +24,12 @@ void processStatus() { String status = Config.callsign + ">APLRG1"; if (stationMode==1 || stationMode==2) { delay(1000); - status += ",qAC:>" + Config.defaultStatus; + status += ",qAC:>https://github.com/richonguzman/LoRa_APRS_iGate"; espClient.write((status + "\n").c_str()); } else { delay(5000); - status += ":>" + Config.defaultStatus; - if (stationMode == 4) { // Digirepeating with Freq Rx != Tx + status += ":>https://github.com/richonguzman/LoRa_APRS_iGate"; + if (stationMode == 4) { LoRa_Utils::changeFreqTx(); } LoRa_Utils::sendNewPacket("APRS", status);