mas pruebas

This commit is contained in:
richonguzman 2023-02-19 21:15:28 -03:00
parent c675552b5f
commit c9187502b3
2 changed files with 31 additions and 17 deletions

View file

@ -1,3 +1,4 @@
#include <Arduino.h>
#include <SPI.h>
#include <LoRa.h>
#include <WiFi.h>
@ -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() {

View file

@ -1,12 +1,14 @@
#ifndef IGATE_CONFIG_H_
#define IGATE_CONFIG_H_
#include <Arduino.h>
#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