From 224aa2fac9a5ce187e5029d81bcd21c534b0de9f Mon Sep 17 00:00:00 2001 From: "Hansi, dl9rdz" Date: Sun, 26 Sep 2021 20:09:57 +0200 Subject: [PATCH 1/4] spurious IRQ workaround. probably related to ESP32 errata 3.14 https://www.espressif.com/sites/default/files/documentation/eco_and_workarounds_for_bugs_in_esp32_en.pdf --- RX_FSK/RX_FSK.ino | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/RX_FSK/RX_FSK.ino b/RX_FSK/RX_FSK.ino index a9b5e4c..d21ec86 100644 --- a/RX_FSK/RX_FSK.ino +++ b/RX_FSK/RX_FSK.ino @@ -1896,8 +1896,10 @@ void checkTouchStatus() { } unsigned long bdd1, bdd2; +static bool b1wasdown = false; void IRAM_ATTR buttonISR() { if (digitalRead(button1.pin) == 0) { // Button down + b1wasdown = true; unsigned long now = my_millis(); if (now - button1.keydownTime < 500) { // Double press @@ -1910,6 +1912,8 @@ void IRAM_ATTR buttonISR() { button1.numberKeyPresses += 1; button1.keydownTime = now; } else { //Button up + if(!b1wasdown) return; + b1wasdown = false; unsigned long now = my_millis(); if (button1.doublepress == -1) return; // key was never pressed before, ignore button up unsigned int elapsed = now - button1.keydownTime; @@ -1967,7 +1971,7 @@ int getKeyPress() { button1.pressed = KP_NONE; #if 0 int x = digitalRead(button1.pin); - Serial.printf("Debug: bdd1=%ld, bdd2=%ld\b", bdd1, bdd2); + Serial.printf("Debug: bdd1=%ld, bdd2=%ld\n", bdd1, bdd2); Serial.printf("button1 press (dbl:%d) (now:%d): %d at %ld (%d)\n", button1.doublepress, x, p, button1.keydownTime, button1.numberKeyPresses); #endif return p; From c3213c6f419b83a9631c9aa9403ff2b7433d7535 Mon Sep 17 00:00:00 2001 From: "Hansi, dl9rdz" Date: Mon, 27 Sep 2021 22:02:43 +0200 Subject: [PATCH 2/4] official to-call APRRDZ --- RX_FSK/src/aprs.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/RX_FSK/src/aprs.cpp b/RX_FSK/src/aprs.cpp index ec5fbd3..dc7ff6c 100644 --- a/RX_FSK/src/aprs.cpp +++ b/RX_FSK/src/aprs.cpp @@ -264,7 +264,7 @@ char *aprs_senddata(SondeInfo *si, const char *usercall, const char *sym) { *b=0; aprsstr_append(b, usercall); aprsstr_append(b, ">"); - const char *destcall="APZRDZ"; + const char *destcall="APRRDZ"; // const char *destcall="APRARX,SONDEGATE,TCPIP,qAR,oh3bsg"; aprsstr_append(b, destcall); // uncompressed From 5166e7d950ab3989b85888a99942f75f15aab5f4 Mon Sep 17 00:00:00 2001 From: "Hansi, dl9rdz" Date: Tue, 28 Sep 2021 11:03:48 +0200 Subject: [PATCH 3/4] show configured M10/M20 type as long as no signal has been recevied --- RX_FSK/src/Sonde.cpp | 2 +- RX_FSK/version.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/RX_FSK/src/Sonde.cpp b/RX_FSK/src/Sonde.cpp index 10dd28e..cad1a48 100644 --- a/RX_FSK/src/Sonde.cpp +++ b/RX_FSK/src/Sonde.cpp @@ -717,7 +717,7 @@ void Sonde::clearDisplay() { } SondeType Sonde::realType(SondeInfo *si) { - if(TYPE_IS_METEO(si->type)) { return si->d.subtype==1 ? STYPE_M10:STYPE_M20; } + if(TYPE_IS_METEO(si->type) && si->d.subtype>0 ) { return si->d.subtype==1 ? STYPE_M10:STYPE_M20; } else return si->type; } diff --git a/RX_FSK/version.h b/RX_FSK/version.h index e1db54f..f0a21ff 100644 --- a/RX_FSK/version.h +++ b/RX_FSK/version.h @@ -1,4 +1,4 @@ const char *version_name = "rdzTTGOsonde"; -const char *version_id = "devel20210926"; +const char *version_id = "devel20210928"; const int SPIFFS_MAJOR=2; const int SPIFFS_MINOR=16; From 4c24c8c385fe2437cd917434db2d114082267348 Mon Sep 17 00:00:00 2001 From: "Hansi, dl9rdz" Date: Tue, 28 Sep 2021 17:27:18 +0200 Subject: [PATCH 4/4] less confusing M10/M20 --- RX_FSK/RX_FSK.ino | 8 ++++---- RX_FSK/data/rdz.js | 5 +++-- RX_FSK/src/ShFreqImport.cpp | 4 ++-- RX_FSK/src/Sonde.cpp | 7 +++++-- RX_FSK/src/Sonde.h | 6 +++--- 5 files changed, 17 insertions(+), 13 deletions(-) diff --git a/RX_FSK/RX_FSK.ino b/RX_FSK/RX_FSK.ino index d21ec86..f9d0f0a 100644 --- a/RX_FSK/RX_FSK.ino +++ b/RX_FSK/RX_FSK.ino @@ -253,10 +253,10 @@ void setupChannelList() { type = STYPE_DFM; } else if (space[1] == 'M') { - type = STYPE_M10; + type = STYPE_M10M20; } else if (space[1] == '2') { - type = STYPE_M20; + type = STYPE_M10M20; } else if (space[1] == '3') { type = STYPE_MP3H; @@ -3558,8 +3558,8 @@ enum SHState { SH_DISCONNECTED, SH_CONNECTING, SH_CONN_IDLE, SH_CONN_APPENDING, SHState shState = SH_DISCONNECTED; time_t shStart = 0; -/* Sonde.h: enum SondeType { STYPE_DFM,, STYPE_RS41, STYPE_RS92, STYPE_M10, STYPE_M20, STYPE_MP3H }; */ -const char *sondeTypeStrSH[NSondeTypes] = { "DFM", "RS41", "RS92", "M10", "M20", "MRZ" }; +/* Sonde.h: enum SondeType { STYPE_DFM,, STYPE_RS41, STYPE_RS92, STYPE_M10M20, STYPE_M10, STYPE_M20, STYPE_MP3H }; */ +const char *sondeTypeStrSH[NSondeTypes] = { "DFM", "RS41", "RS92", "Mxx"/*never sent*/, "M10", "M20", "MRZ" }; const char *dfmSubtypeStrSH[16] = { NULL, NULL, NULL, NULL, NULL, NULL, "DFM06", // 0x06 "PS15", // 0x07 diff --git a/RX_FSK/data/rdz.js b/RX_FSK/data/rdz.js index 83bba29..28a5446 100644 --- a/RX_FSK/data/rdz.js +++ b/RX_FSK/data/rdz.js @@ -2,8 +2,8 @@ let stypes=new Map(); stypes.set('4', 'RS41'); stypes.set('R', 'RS92'); stypes.set('D', 'DFM'); -stypes.set('M', 'M10'); -stypes.set('2', 'M20'); +stypes.set('M', 'M10/M20'); +//stypes.set('2', 'M10/M20'); stypes.set('3', 'MP3H'); /* (no longer) Used by qrg.html in RX_FSK.ino */ @@ -11,6 +11,7 @@ function prep() { var stlist=document.querySelectorAll("input.stype"); for(txt of stlist){ var val=txt.getAttribute('value'); var nam=txt.getAttribute('name'); + if(val=='2') { val='M'; } var sel=document.createElement('select'); sel.setAttribute('name',nam); for(stype of stypes) { diff --git a/RX_FSK/src/ShFreqImport.cpp b/RX_FSK/src/ShFreqImport.cpp index 4da63b1..ff0e93e 100644 --- a/RX_FSK/src/ShFreqImport.cpp +++ b/RX_FSK/src/ShFreqImport.cpp @@ -30,8 +30,8 @@ static float homelat, homelon; int ShFreqImport::stringToStype(const char *type) { if(type[2]=='4') return STYPE_RS41; if(type[2]=='9') return STYPE_RS92; - if(type[1]=='1') return STYPE_M10; - if(type[1]=='2') return STYPE_M20; + if(type[1]=='1') return STYPE_M10M20; + if(type[1]=='2') return STYPE_M10M20; if(type[0]=='D') return STYPE_DFM; if(type[2]=='3') return STYPE_MP3H; // TODO: check if '3' is correct return -1; // iMet is not supported diff --git a/RX_FSK/src/Sonde.cpp b/RX_FSK/src/Sonde.cpp index cad1a48..47b06b0 100644 --- a/RX_FSK/src/Sonde.cpp +++ b/RX_FSK/src/Sonde.cpp @@ -21,8 +21,8 @@ const char *evstring[]={"NONE", "KEY1S", "KEY1D", "KEY1M", "KEY1L", "KEY2S", "KE const char *RXstr[]={"RX_OK", "RX_TIMEOUT", "RX_ERROR", "RX_UNKNOWN"}; // Dependency to enum SondeType -const char *sondeTypeStr[NSondeTypes] = { "DFM ", "RS41", "RS92", "M10 ", "M20 ", "MP3H" }; -const char *sondeTypeLongStr[NSondeTypes] = { "DFM (all)", "RS41", "RS92", "M10 ", "M20 ", "MP3-H1" }; +const char *sondeTypeStr[NSondeTypes] = { "DFM ", "RS41", "RS92", "Mxx ", "M10 ", "M20 ", "MP3H" }; +const char *sondeTypeLongStr[NSondeTypes] = { "DFM (all)", "RS41", "RS92", "M10/M20", "M10 ", "M20 ", "MP3-H1" }; const char sondeTypeChar[NSondeTypes] = { 'D', '4', 'R', 'M', '2', '3' }; const char *manufacturer_string[]={"Graw", "Vaisala", "Vaisala", "Meteomodem", "Meteomodem", "Meteo-Radiy"}; @@ -444,6 +444,7 @@ void Sonde::setup() { break; case STYPE_M10: case STYPE_M20: + case STYPE_M10M20: m10m20.setup( sondeList[rxtask.currentSonde].freq * 1000000); break; case STYPE_MP3H: @@ -474,6 +475,7 @@ void Sonde::receive() { break; case STYPE_M10: case STYPE_M20: + case STYPE_M10M20: res = m10m20.receive(); break; case STYPE_DFM: @@ -572,6 +574,7 @@ rxloop: break; case STYPE_M10: case STYPE_M20: + case STYPE_M10M20: m10m20.waitRXcomplete(); break; case STYPE_DFM: diff --git a/RX_FSK/src/Sonde.h b/RX_FSK/src/Sonde.h index e8eb46f..15007f5 100644 --- a/RX_FSK/src/Sonde.h +++ b/RX_FSK/src/Sonde.h @@ -62,8 +62,8 @@ extern const char *RXstr[]; // 01000000 => goto sonde -1 // 01000001 => goto sonde +1 -#define NSondeTypes 6 -enum SondeType { STYPE_DFM, STYPE_RS41, STYPE_RS92, STYPE_M10, STYPE_M20, STYPE_MP3H }; +#define NSondeTypes 7 +enum SondeType { STYPE_DFM, STYPE_RS41, STYPE_RS92, STYPE_M10M20, STYPE_M10, STYPE_M20, STYPE_MP3H }; extern const char *sondeTypeStr[NSondeTypes]; extern const char *sondeTypeLongStr[NSondeTypes]; extern const char sondeTypeChar[NSondeTypes]; @@ -72,7 +72,7 @@ extern const char *manufacturer_string[NSondeTypes]; #define ISOLED(cfg) ((cfg).disptype==0 || (cfg).disptype==2) #define TYPE_IS_DFM(t) ( (t)==STYPE_DFM ) -#define TYPE_IS_METEO(t) ( (t)==STYPE_M10 || (t)==STYPE_M20 ) +#define TYPE_IS_METEO(t) ( (t)==STYPE_M10M20 || (t)==STYPE_M10 || (t)==STYPE_M20 ) typedef struct st_sondedata { // decoded ID