fix posInfo bug; aprs timeout convert seconds to ms

pull/354/head^2
Hansi, dl9rdz 2023-08-22 22:28:37 +00:00
rodzic deec0d362f
commit 082b6ccdf5
6 zmienionych plików z 8 dodań i 2 usunięć

Wyświetl plik

@ -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();

Wyświetl plik

@ -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);

Wyświetl plik

@ -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;

Wyświetl plik

@ -33,6 +33,7 @@ void fixedToPosInfo() {
posInfo.lat = sonde.config.rxlat;
posInfo.lon = sonde.config.rxlon;
posInfo.alt = sonde.config.rxalt;
posInfo.valid = 1;
}

Wyświetl plik

@ -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

Wyświetl plik

@ -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;