diff --git a/RX_FSK/RX_FSK.ino b/RX_FSK/RX_FSK.ino index 38f9202..67a97e2 100644 --- a/RX_FSK/RX_FSK.ino +++ b/RX_FSK/RX_FSK.ino @@ -809,6 +809,7 @@ const char *handleConfigPost(AsyncWebServerRequest * request) { f.close(); Serial.printf("Re-reading file file\n"); setupConfigData(); + if(!gpsPos.valid) fixedToPosInfo(); // TODO: Check if this is better done elsewhere? // Use new config (whereever this is feasible without a reboot) disp.setContrast(); @@ -1975,6 +1976,7 @@ void setup() NULL); /* task handle*/ #endif sonde.setup(); + fixedToPosInfo(); initGPS(); #if FEATURE_APRS connAPRS.init(); diff --git a/RX_FSK/data/map.html b/RX_FSK/data/map.html index dab510f..89cb171 100644 --- a/RX_FSK/data/map.html +++ b/RX_FSK/data/map.html @@ -15,6 +15,7 @@ document.addEventListener("DOMContentLoaded", function(){ fetch('live.json') .then((response) => response.json()) .then((data) => { + if (data.gps===undefined) { data.gps={} }; console.log(data.gps.lat, data.gps.lon, data.sonde.ser); if( (data.sonde.ser||'')=='' && !(data.gps.lat===undefined) ) { urlarg = maps[maptype][2](data.gps.lat, data.gps.lon); diff --git a/RX_FSK/src/conn-aprs.cpp b/RX_FSK/src/conn-aprs.cpp index 5d1c0b8..a4d4d4f 100644 --- a/RX_FSK/src/conn-aprs.cpp +++ b/RX_FSK/src/conn-aprs.cpp @@ -100,7 +100,7 @@ void ConnAPRS::updateStation( PosInfo *pi ) { // We check for stalled connection and possibly close it Serial.printf("last_in - now: %ld\n", millis() - last_in); if ( sonde.config.tcpfeed.timeout > 0) { - if ( last_in && ( (millis() - last_in) > sonde.config.tcpfeed.timeout ) ) { + if ( last_in && ( (millis() - last_in) > sonde.config.tcpfeed.timeout*1000 ) ) { Serial.println("APRS timeout - closing connection"); close(tcpclient); tcpclient_state = TCS_DISCONNECTED; diff --git a/RX_FSK/src/posinfo.cpp b/RX_FSK/src/posinfo.cpp index 7a8ca91..bcc10a0 100644 --- a/RX_FSK/src/posinfo.cpp +++ b/RX_FSK/src/posinfo.cpp @@ -33,6 +33,7 @@ void fixedToPosInfo() { posInfo.lat = sonde.config.rxlat; posInfo.lon = sonde.config.rxlon; posInfo.alt = sonde.config.rxalt; + posInfo.valid = 1; } diff --git a/RX_FSK/src/posinfo.h b/RX_FSK/src/posinfo.h index e8c7e76..760eb4c 100644 --- a/RX_FSK/src/posinfo.h +++ b/RX_FSK/src/posinfo.h @@ -33,5 +33,7 @@ void initGPS(); // Update position from app (if not local GPS chip) void parseGpsJson(char *data, int len); +// Update position from static config +void fixedToPosInfo(); #endif diff --git a/RX_FSK/version.h b/RX_FSK/version.h index 1c906ad..3c47cb2 100644 --- a/RX_FSK/version.h +++ b/RX_FSK/version.h @@ -1,4 +1,4 @@ const char *version_name = "rdzTTGOsonde"; -const char *version_id = "devel20230819"; +const char *version_id = "devel20230822"; const int SPIFFS_MAJOR=2; const int SPIFFS_MINOR=17;