SondeHub Fix Chase Cars (#104)

* fix chase cars

* update version ID

* fix version

Co-authored-by: Uskompuf <22492406+Uskompuf@users.noreply.github.com>
Co-authored-by: dl9rdz <dl9rdz@darc.de>
pull/103/head^2
Luke Prior 2021-07-27 05:11:33 +10:00 zatwierdzone przez GitHub
rodzic 4dc3ea6974
commit 5987c92fab
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
1 zmienionych plików z 17 dodań i 13 usunięć

Wyświetl plik

@ -2221,22 +2221,10 @@ void loopDecoder() {
}
#if FEATURE_SONDEHUB
if (sonde.config.sondehub.active) {
unsigned long time_now = millis();
// time_delta will be correct, even if time_now overflows
unsigned long time_delta = time_now - time_last_update;
if ((sonde.config.sondehub.chase == 0) && (time_delta >= SONDEHUB_STATION_UPDATE_TIME)) { // 60 min
sondehub_station_update(&shclient, &sonde.config.sondehub);
time_last_update = time_now;
}
else if ((sonde.config.sondehub.chase == 1) && (time_delta >= SONDEHUB_MOBILE_STATION_UPDATE_TIME)) { // 30 sec
sondehub_station_update(&shclient, &sonde.config.sondehub);
time_last_update = time_now;
}
sondehub_send_data(&shclient, s, &sonde.config.sondehub);
}
#endif
#if FEATURE_MQTT
// send to MQTT if enabled
if (connected && mqttEnabled) {
@ -3010,6 +2998,22 @@ void loop() {
lastMqttUptime = now;
}
#endif
#if FEATURE_SONDEHUB
if (sonde.config.sondehub.active) {
unsigned long time_now = millis();
// time_delta will be correct, even if time_now overflows
unsigned long time_delta = time_now - time_last_update;
if ((sonde.config.sondehub.chase == 0) && (time_delta >= SONDEHUB_STATION_UPDATE_TIME) && (wifi_state != WIFI_APMODE)) { // 60 min
sondehub_station_update(&shclient, &sonde.config.sondehub);
time_last_update = time_now;
}
else if ((sonde.config.sondehub.chase == 1) && (time_delta >= SONDEHUB_MOBILE_STATION_UPDATE_TIME) && (wifi_state != WIFI_APMODE)) { // 30 sec
sondehub_station_update(&shclient, &sonde.config.sondehub);
time_last_update = time_now;
}
}
#endif
}
#if FEATURE_SONDEHUB
@ -3052,7 +3056,7 @@ void sondehub_station_update(WiFiClient *client, struct st_sondehub *conf) {
else if (gpsPos.valid && gpsPos.lat != 0 && gpsPos.lon != 0) {
sprintf(w,
"\"uploader_position\": [%.6f, %.6f, %d],"
"\"uploader_antenna\": \"%s\""
"\"uploader_antenna\": \"%s\","
"\"mobile\": \"true\""
"}",
gpsPos.lat, gpsPos.lon, gpsPos.alt, conf->antenna);