This commit is contained in:
richonguzman 2023-04-27 13:00:20 -04:00
parent 023abfb330
commit 05748754b3
2 changed files with 11 additions and 10 deletions

View File

@ -5,7 +5,7 @@
"wifi": { "wifi": {
"AP": [ "AP": [
{ "SSID": "WiFi_AP_1", { "SSID": "WiFi_AP_1",
"Password": "password_WiFi_1", "Password": "password_WiFi_2",
"Latitude": 0.0000000, "Latitude": 0.0000000,
"Longitude": 0.0000000 "Longitude": 0.0000000
}, },
@ -17,7 +17,7 @@
] ]
}, },
"aprs_is": { "aprs_is": {
"passcode": "", "passcode": "23201",
"server": "soam.aprs2.net", "server": "soam.aprs2.net",
"port": 14580, "port": 14580,
"software_name" : "ESP32_LoRa_iGate", "software_name" : "ESP32_LoRa_iGate",

View File

@ -158,15 +158,16 @@ String create_lat_aprs(double lat) {
String north_south, latitude, convDeg3; String north_south, latitude, convDeg3;
float convDeg, convDeg2; float convDeg, convDeg2;
if (abs(degrees.toFloat()) < 10) {
latitude += "0";
}
Serial.println(latitude);
if (degrees.indexOf("-") == 0) { if (degrees.indexOf("-") == 0) {
north_south = "S"; north_south = "S";
latitude = degrees.substring(1,degrees.indexOf(".")); latitude += degrees.substring(1,degrees.indexOf("."));
} else { } else {
north_south = "N"; north_south = "N";
latitude = degrees.substring(0,degrees.indexOf(".")); latitude += degrees.substring(0,degrees.indexOf("."));
}
if (latitude.length() == 1) {
latitude = "0" + latitude;
} }
convDeg = abs(degrees.toFloat()) - abs(int(degrees.toFloat())); convDeg = abs(degrees.toFloat()) - abs(int(degrees.toFloat()));
convDeg2 = (convDeg * 60)/100; convDeg2 = (convDeg * 60)/100;
@ -184,6 +185,9 @@ String create_lng_aprs(double lng) {
if (abs(degrees.toFloat()) < 100) { if (abs(degrees.toFloat()) < 100) {
longitude += "0"; longitude += "0";
} }
if (abs(degrees.toFloat()) < 10) {
longitude += "0";
}
if (degrees.indexOf("-") == 0) { if (degrees.indexOf("-") == 0) {
east_west = "W"; east_west = "W";
longitude += degrees.substring(1,degrees.indexOf(".")); longitude += degrees.substring(1,degrees.indexOf("."));
@ -191,9 +195,6 @@ String create_lng_aprs(double lng) {
east_west = "E"; east_west = "E";
longitude += degrees.substring(0,degrees.indexOf(".")); longitude += degrees.substring(0,degrees.indexOf("."));
} }
if (longitude.length() == 1) {
longitude = "0" + longitude;
}
convDeg = abs(degrees.toFloat()) - abs(int(degrees.toFloat())); convDeg = abs(degrees.toFloat()) - abs(int(degrees.toFloat()));
convDeg2 = (convDeg * 60)/100; convDeg2 = (convDeg * 60)/100;
convDeg3 = String(convDeg2,6); convDeg3 = String(convDeg2,6);