From c9187502b3f7911d24fac9336ca34dc075bbb79e Mon Sep 17 00:00:00 2001 From: richonguzman Date: Sun, 19 Feb 2023 21:15:28 -0300 Subject: [PATCH] mas pruebas --- src/Lora_APRS_iGate_DIY.cpp | 38 +++++++++++++++++++++---------------- src/iGate_config.h | 10 +++++++++- 2 files changed, 31 insertions(+), 17 deletions(-) diff --git a/src/Lora_APRS_iGate_DIY.cpp b/src/Lora_APRS_iGate_DIY.cpp index e7b4cbe..fe4f89e 100644 --- a/src/Lora_APRS_iGate_DIY.cpp +++ b/src/Lora_APRS_iGate_DIY.cpp @@ -1,3 +1,4 @@ +#include #include #include #include @@ -109,7 +110,9 @@ void valida_y_procesa_packet(String mensaje) { } } -void APRS_IS_READ(){ + + +void APRS_connect(){ int count = 0; String aprsauth; Serial.println("Conectando a APRS-IS"); @@ -128,30 +131,33 @@ void APRS_IS_READ(){ } else { Serial.println("Connected with server: " + String(SERVER) + " APRSPORT: " + String(APRSPORT)); - String aprsisData; - while (espClient.connected()) { - aprsauth = "user " + iGate_Callsign + " pass " + passcode_igate + "\n"; //info igate - espClient.write(aprsauth.c_str()); - delay(200); - char c = espClient.read(); - //if (c == '\r') continue; - if (c == '\n') { - Serial.println(aprsisData); - aprsisData = ""; - } - aprsisData += c; - - } - + aprsauth = "user " + iGate_Callsign + " pass " + passcode_igate + " vers " + "ESP32_TEST" + " " + "0.2" + " filter " + "b/CD*/CA*/CE*/XQ*" + "\n\r"; //info igate + espClient.write(aprsauth.c_str()); + delay(200); } } + +void APRS_IS_READ(){ + String aprsisData; + while (espClient.connected()) { + char c = espClient.read(); + if (c == '\n') { + Serial.print(aprsisData); + aprsisData = ""; + } + aprsisData += c; + } +} + + void setup() { Serial.begin(115200); setup_wifi(); btStop(); setup_lora(); Serial.println("Starting iGate\n"); + //APRS_connect(); } void loop() { diff --git a/src/iGate_config.h b/src/iGate_config.h index b445e8d..804af50 100644 --- a/src/iGate_config.h +++ b/src/iGate_config.h @@ -1,12 +1,14 @@ #ifndef IGATE_CONFIG_H_ #define IGATE_CONFIG_H_ +#include + #define WIFI_SSID "Richon" #define WIFI_PASSWORD "k4fPnmg5qnyf" #define BeaconInterval 900000 // 15 minutes = 900000 seg -String iGate_Callsign = "CD2RXU-10"; +String iGate_Callsign = "CD2RXU-11"; String passcode_igate = "23201"; const String LAT = "3302.03S"; // por corregir // write your latitude @@ -16,8 +18,14 @@ const String iGate_Comment = "DIY ESP32 - LoRa APRS iGATE https://github.com/ric const String SERVER = "brazil.aprs2.net"; // write the address of the aprs server const int APRSPORT = 14579; // write the aprs server APRSPORT +//funciona con 14579 y 14580 + +//const String SERVER = "radioaficion.pro"; // write the address of the aprs server +//const int APRSPORT = 14580; // write the aprs server APRSPORT + String iGateBeaconPacket = iGate_Callsign + ">APLG01,TCPIP*,qAC,T2BRAZIL:=" + LAT + "L" + LON + "&" + iGate_Comment + "\n"; +//String iGateBeaconPacket = iGate_Callsign + ">APLG01,TCPIP*,qAC,CHILE:=" + LAT + "L" + LON + "&" + iGate_Comment + "\n"; #endif \ No newline at end of file