From b6dbbe73ba491892b0ab22a13aeab3fefd067cad Mon Sep 17 00:00:00 2001 From: "Hansi, dl9rdz" Date: Sun, 19 Sep 2021 22:46:27 +0200 Subject: [PATCH 1/9] typo-- --- RX_FSK/data/cfg.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/RX_FSK/data/cfg.js b/RX_FSK/data/cfg.js index 5dc7fc3..2b117f3 100644 --- a/RX_FSK/data/cfg.js +++ b/RX_FSK/data/cfg.js @@ -4,7 +4,7 @@ var cfgs = [ [ "mdnsname", "Network mDNS name"], [ "ephftp", "FTP server for ephemeris data (RS92 decoder)"], [ "debug", "Debug mode (0/1)" ], -[ "maxsonde", "Maxumum number of QRG entries (must be ⋚50)" ], +[ "maxsonde", "Maxumum number of QRG entries (must be ≤ 50)" ], [ "rxlat", "Receiver fixed latitude"], [ "rxlon", "Receiver fixed longitude"], [ "rxalt", "Receiver fixed altitude"], From 9a60db96d631cae4b19c932bfb43e54810fea191 Mon Sep 17 00:00:00 2001 From: "Hansi, dl9rdz" Date: Sun, 19 Sep 2021 22:46:56 +0200 Subject: [PATCH 2/9] typo-- --- RX_FSK/data/cfg.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/RX_FSK/data/cfg.js b/RX_FSK/data/cfg.js index 2b117f3..4e36234 100644 --- a/RX_FSK/data/cfg.js +++ b/RX_FSK/data/cfg.js @@ -4,7 +4,7 @@ var cfgs = [ [ "mdnsname", "Network mDNS name"], [ "ephftp", "FTP server for ephemeris data (RS92 decoder)"], [ "debug", "Debug mode (0/1)" ], -[ "maxsonde", "Maxumum number of QRG entries (must be ≤ 50)" ], +[ "maxsonde", "Maximum number of QRG entries (must be ≤ 50)" ], [ "rxlat", "Receiver fixed latitude"], [ "rxlon", "Receiver fixed longitude"], [ "rxalt", "Receiver fixed altitude"], From 775b7ff3e058cfdd81d64e55b5c1102fc28d43e5 Mon Sep 17 00:00:00 2001 From: Luke Prior <22492406+LukePrior@users.noreply.github.com> Date: Mon, 20 Sep 2021 17:27:11 +1000 Subject: [PATCH 3/9] Update RX_FSK.ino --- RX_FSK/RX_FSK.ino | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/RX_FSK/RX_FSK.ino b/RX_FSK/RX_FSK.ino index 5c941b3..7e9164b 100644 --- a/RX_FSK/RX_FSK.ino +++ b/RX_FSK/RX_FSK.ino @@ -3714,8 +3714,8 @@ void sondehub_send_data(WiFiClient * client, SondeInfo * s, struct st_sondehub * } // Only send burst timer if RS41 and not 0 - if ((realtype == STYPE_RS41) && ((int)s->burstKT != 0)) { - sprintf(w, "\"burst_timer\": %d,", (int)s->burstKT); + if ((realtype == STYPE_RS41) && ((int)s->countKT != 0)) { + sprintf(w, "\"burst_timer\": %d,", (int)s->countKT); w += strlen(w); } From 99ccf581e45706236b5bc2cc1275ae067604d3b4 Mon Sep 17 00:00:00 2001 From: "Hansi, dl9rdz" Date: Mon, 20 Sep 2021 11:09:33 +0200 Subject: [PATCH 4/9] add dbg msg --- RX_FSK/RX_FSK.ino | 3 ++- RX_FSK/src/RS41.cpp | 3 +++ RX_FSK/version.h | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/RX_FSK/RX_FSK.ino b/RX_FSK/RX_FSK.ino index 5c941b3..4cbc3ef 100644 --- a/RX_FSK/RX_FSK.ino +++ b/RX_FSK/RX_FSK.ino @@ -2051,7 +2051,7 @@ void setup() { char buf[12]; // Open serial communications and wait for port to open: - Serial.begin(921600 /*115200*/); + Serial.begin(/*921600 */115200); for (int i = 0; i < 39; i++) { int v = gpio_get_level((gpio_num_t)i); Serial.printf("%d:%d ", i, v); @@ -2428,6 +2428,7 @@ void loopDecoder() { i = 0; rtc_wdt_protect_off(); rtc_wdt_disable(); + // Requires serial speed 921600, otherweise interrupt wdt will occur heap_caps_dump(MALLOC_CAP_8BIT); } #endif diff --git a/RX_FSK/src/RS41.cpp b/RX_FSK/src/RS41.cpp index aa66d46..6f8d637 100644 --- a/RX_FSK/src/RS41.cpp +++ b/RX_FSK/src/RS41.cpp @@ -500,6 +500,8 @@ void ProcessSubframe( byte *subframeBytes, int subframeNumber ) { memcpy( s->rawData+16*subframeNumber, subframeBytes, 16); s->valid |= (1ULL << subframeNumber); Serial.printf("subframe %d; valid: %x%032x\n", subframeNumber, (uint32_t)(s->valid>>32), (uint32_t)s->valid); + for(int i=0; i<16; i++) { Serial.printf("%02x[%c]", subframeBytes[i],( subframeBytes[i]>20 && subframeBytes[i]<127)? subframeBytes[i] : '.'); } + Serial.println(""); // subframeReceived[subframeNumber] = true; // mark this row of the total subframe as complete #if 0 @@ -865,6 +867,7 @@ int RS41::getSubtype(char *buf, int buflen, SondeInfo *si) { strncpy(buf, sf->value.names.variant, buflen); buf[buflen-1]=0; if(*buf==0) return -1; + Serial.printf("subframe valid: %x%032x; subtype=%s\n", (uint32_t)(sf->valid>>32), (uint32_t)sf->valid, buf); return 0; } diff --git a/RX_FSK/version.h b/RX_FSK/version.h index cee9f1d..ec175bc 100644 --- a/RX_FSK/version.h +++ b/RX_FSK/version.h @@ -1,4 +1,4 @@ const char *version_name = "rdzTTGOsonde"; -const char *version_id = "devel20210919"; +const char *version_id = "devel20210920"; const int SPIFFS_MAJOR=2; const int SPIFFS_MINOR=16; From d366a3d1efdf41d4791ef8920bca9fa552910de5 Mon Sep 17 00:00:00 2001 From: "Hansi, dl9rdz" Date: Mon, 20 Sep 2021 11:23:46 +0200 Subject: [PATCH 5/9] don't use u8g2 2.31.1 due to https://github.com/olikraus/u8g2/issues/1594 --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 573c0d4..d9c57b1 100644 --- a/.travis.yml +++ b/.travis.yml @@ -47,7 +47,7 @@ install: - arduino --pref "build.path=$PWD/build" --save-prefs - arduino --install-boards esp32:esp32:1.0.6 --save-prefs - ln -s $PWD/libraries/SondeLib /usr/local/share/arduino/libraries/SondeLib - - arduino --install-library "U8g2" + - arduino --install-library "U8g2:2.28.8" - arduino --install-library "MicroNMEA" - arduino --install-library "GFX Library for Arduino" script: From 71c42c938b7a4790f1a3e33bdd8cefbcd548ffc8 Mon Sep 17 00:00:00 2001 From: "Hansi, dl9rdz" Date: Mon, 20 Sep 2021 11:53:50 +0200 Subject: [PATCH 6/9] don't use u8g2 2.31.1 due to https://github.com/olikraus/u8g2/issues/1594 --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index d9c57b1..8a080d5 100644 --- a/.travis.yml +++ b/.travis.yml @@ -47,7 +47,7 @@ install: - arduino --pref "build.path=$PWD/build" --save-prefs - arduino --install-boards esp32:esp32:1.0.6 --save-prefs - ln -s $PWD/libraries/SondeLib /usr/local/share/arduino/libraries/SondeLib - - arduino --install-library "U8g2:2.28.8" + - arduino --install-library "U8g2:2.29.11" - arduino --install-library "MicroNMEA" - arduino --install-library "GFX Library for Arduino" script: From 2dcbcc31419de773e4c25425276c1aad29187c32 Mon Sep 17 00:00:00 2001 From: "Hansi, dl9rdz" Date: Mon, 20 Sep 2021 16:20:53 +0200 Subject: [PATCH 7/9] fix RS41 subtype --- RX_FSK/src/RS41.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/RX_FSK/src/RS41.cpp b/RX_FSK/src/RS41.cpp index 6f8d637..801c402 100644 --- a/RX_FSK/src/RS41.cpp +++ b/RX_FSK/src/RS41.cpp @@ -862,7 +862,7 @@ int RS41::waitRXcomplete() { int RS41::getSubtype(char *buf, int buflen, SondeInfo *si) { struct subframeBuffer *sf = (struct subframeBuffer *)si->extra; if(!sf) return -1; - if( (sf->valid & (3<<21)) != (3<<21) ) return -1; // or 1 instead of 3 for the first 8 chars only, as in autorx? + if( (sf->valid & (3<<0x21)) != (3<<0x21) ) return -1; // or 1 instead of 3 for the first 8 chars only, as in autorx? if(buflen>11) buflen=11; // then buflen should be capped at 9 (8+trailing \0) strncpy(buf, sf->value.names.variant, buflen); buf[buflen-1]=0; From f5281e523cbde86a311bd1d972ef59ba4eff9623 Mon Sep 17 00:00:00 2001 From: "Hansi, dl9rdz" Date: Mon, 20 Sep 2021 16:57:37 +0200 Subject: [PATCH 8/9] really fix RS41 subtype --- RX_FSK/src/RS41.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/RX_FSK/src/RS41.cpp b/RX_FSK/src/RS41.cpp index 801c402..9b0c2bb 100644 --- a/RX_FSK/src/RS41.cpp +++ b/RX_FSK/src/RS41.cpp @@ -499,7 +499,7 @@ void ProcessSubframe( byte *subframeBytes, int subframeNumber ) { } memcpy( s->rawData+16*subframeNumber, subframeBytes, 16); s->valid |= (1ULL << subframeNumber); - Serial.printf("subframe %d; valid: %x%032x\n", subframeNumber, (uint32_t)(s->valid>>32), (uint32_t)s->valid); + Serial.printf("subframe %d; valid: %x%08x\n", subframeNumber, (uint32_t)(s->valid>>32), (uint32_t)s->valid); for(int i=0; i<16; i++) { Serial.printf("%02x[%c]", subframeBytes[i],( subframeBytes[i]>20 && subframeBytes[i]<127)? subframeBytes[i] : '.'); } Serial.println(""); // subframeReceived[subframeNumber] = true; // mark this row of the total subframe as complete @@ -862,12 +862,12 @@ int RS41::waitRXcomplete() { int RS41::getSubtype(char *buf, int buflen, SondeInfo *si) { struct subframeBuffer *sf = (struct subframeBuffer *)si->extra; if(!sf) return -1; - if( (sf->valid & (3<<0x21)) != (3<<0x21) ) return -1; // or 1 instead of 3 for the first 8 chars only, as in autorx? + if( ( (sf->valid>>0x21) &3) != 3 ) return -1; // or 1 instead of 3 for the first 8 chars only, as in autorx? if(buflen>11) buflen=11; // then buflen should be capped at 9 (8+trailing \0) strncpy(buf, sf->value.names.variant, buflen); buf[buflen-1]=0; if(*buf==0) return -1; - Serial.printf("subframe valid: %x%032x; subtype=%s\n", (uint32_t)(sf->valid>>32), (uint32_t)sf->valid, buf); + Serial.printf("subframe valid: %x%08x; subtype=%s\n", (uint32_t)(sf->valid>>32), (uint32_t)sf->valid, buf); return 0; } From 86566c042710f4062fa20a2912925d85cb2591d6 Mon Sep 17 00:00:00 2001 From: "Hansi, dl9rdz" Date: Mon, 20 Sep 2021 18:18:09 +0200 Subject: [PATCH 9/9] sync sh import / sh telemetry --- RX_FSK/RX_FSK.ino | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/RX_FSK/RX_FSK.ino b/RX_FSK/RX_FSK.ino index 40b9bb7..441120f 100644 --- a/RX_FSK/RX_FSK.ino +++ b/RX_FSK/RX_FSK.ino @@ -3358,12 +3358,6 @@ void loop() { } #endif -#if FEATURE_SONDEHUB - if (sonde.config.sondehub.active) { - // interval check moved to sondehub_station_update to avoid having to calculate distance in auto mode twice - sondehub_station_update(&shclient, &sonde.config.sondehub); - } -#endif } #if FEATURE_SONDEHUB @@ -3472,6 +3466,7 @@ void sondehub_station_update(WiFiClient *client, struct st_sondehub *conf) { Serial.println(strlen(data)); Serial.println(data); Serial.println("Waiting for response"); + // TODO: better do this asyncrhonously String response = client->readString(); Serial.println(response); Serial.println("Response done..."); @@ -3530,7 +3525,6 @@ void sondehub_reply_handler(WiFiClient *client) { } } } - // send import requests if needed if (sonde.config.sondehub.fiactive) { if (shImport == 2) { @@ -3547,6 +3541,13 @@ void sondehub_reply_handler(WiFiClient *client) { sondehub_send_fimport(&shclient); } } + + // also handle periodic station updates here... + // interval check moved to sondehub_station_update to avoid having to calculate distance in auto mode twice + if(shState == SH_CONN_IDLE) { + // (do not set station update while a telemetry report is being sent + sondehub_station_update(&shclient, &sonde.config.sondehub); + } } void sondehub_send_fimport(WiFiClient * client) {