minor polishing of pull request for sondehub chase mode

This commit is contained in:
Hansi, dl9rdz 2021-06-14 06:38:19 +02:00
parent 8861458421
commit 890fef7f29
2 changed files with 4 additions and 12 deletions

View File

@ -29,8 +29,7 @@ Meteomodem | M10 | :heavy_check_mark: | :x: | :x: | Not Sent
Meteomodem | M20 | :heavy_check_mark: | :x: | :x: | Not Sent Meteomodem | M20 | :heavy_check_mark: | :x: | :x: | Not Sent
Meteo-Radiy | MP3-H1 (MRZ-H1) | :heavy_check_mark: | :x: | :x: | :x: Meteo-Radiy | MP3-H1 (MRZ-H1) | :heavy_check_mark: | :x: | :x: | :x:
SondeHub integration has mainly been tested with RS41 and DFM. MP3-H1 currently lacks decoding SondeHub integration has mainly been tested with RS41 and DFM.
timestamps from telemetry, thus not yet suitable for SondeHub.
Support for other radiosondes that use AFSK modulation is not feasible with the TTGO hardware. Support for other radiosondes that use AFSK modulation is not feasible with the TTGO hardware.

View File

@ -58,9 +58,7 @@ WiFiClient client;
#define SONDEHUB_STATION_UPDATE_TIME (60*60*1000) // 60 min #define SONDEHUB_STATION_UPDATE_TIME (60*60*1000) // 60 min
#define SONDEHUB_MOBILE_STATION_UPDATE_TIME (30*1000) // 30 sec #define SONDEHUB_MOBILE_STATION_UPDATE_TIME (30*1000) // 30 sec
WiFiClient shclient; // Sondehub v2 WiFiClient shclient; // Sondehub v2
unsigned long time_now = 0;
unsigned long time_last_update = 0; unsigned long time_last_update = 0;
unsigned long time_delta = 0;
#endif #endif
// KISS over TCP for communicating with APRSdroid // KISS over TCP for communicating with APRSdroid
@ -2177,14 +2175,9 @@ void loopDecoder() {
} }
#if FEATURE_SONDEHUB #if FEATURE_SONDEHUB
if (sonde.config.sondehub.active) { if (sonde.config.sondehub.active) {
time_now = millis(); unsigned long time_now = millis();
if (time_now < time_last_update) { // time_delta will be correct, even if time_now overflows
// counter overflow unsigned long time_delta = time_now - time_last_update;
time_delta = SONDEHUB_STATION_UPDATE_TIME;
}
else {
time_delta = time_now - time_last_update;
}
if ((sonde.config.sondehub.chase == 0) && (time_delta >= SONDEHUB_STATION_UPDATE_TIME)) { // 60 min if ((sonde.config.sondehub.chase == 0) && (time_delta >= SONDEHUB_STATION_UPDATE_TIME)) { // 60 min
sondehub_station_update(&shclient, &sonde.config.sondehub); sondehub_station_update(&shclient, &sonde.config.sondehub);
time_last_update = time_now; time_last_update = time_now;