From 5e0a98512b3b80833aaeddef952f6d526f837603 Mon Sep 17 00:00:00 2001 From: michael carter Date: Tue, 21 Sep 2021 12:24:01 +0100 Subject: [PATCH 1/7] Add battery voltage --- RX_FSK/src/RS41.cpp | 1 + RX_FSK/src/Sonde.h | 1 + 2 files changed, 2 insertions(+) diff --git a/RX_FSK/src/RS41.cpp b/RX_FSK/src/RS41.cpp index aa66d46..83d2a5b 100644 --- a/RX_FSK/src/RS41.cpp +++ b/RX_FSK/src/RS41.cpp @@ -685,6 +685,7 @@ int RS41::decode41(byte *data, int maxlen) Serial.print("; RS41 ID "); snprintf(buf, 10, "%.8s ", data+p+2); Serial.print(buf); + sonde.si()->batteryVoltage = data[p+10] / 10.0f; si->type=STYPE_RS41; if(strncmp(si->id, (const char *)(data+p+2), 8)) { // ID changed, i.e. new sonde on same frequency. clear calibration data diff --git a/RX_FSK/src/Sonde.h b/RX_FSK/src/Sonde.h index d16dbd0..fdf79cb 100644 --- a/RX_FSK/src/Sonde.h +++ b/RX_FSK/src/Sonde.h @@ -110,6 +110,7 @@ typedef struct st_sondeinfo { float temperature = -300.0; // platinum resistor temperature float tempRHSensor = -300.0; // temperature of relative humidity sensor float relativeHumidity = -1.0; // relative humidity + float batteryVoltage = -1; } SondeInfo; // rxStat: 3=undef[empty] 1=timeout[.] 2=errro[E] 0=ok[|] 4=no valid position[°] From 5cf8266f404fcb55c1cd7a12226876f59daf82e5 Mon Sep 17 00:00:00 2001 From: Luke Prior <22492406+LukePrior@users.noreply.github.com> Date: Sun, 3 Oct 2021 11:43:00 +1100 Subject: [PATCH 2/7] Update Compatibility Table --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index dea6982..aacd81d 100644 --- a/README.md +++ b/README.md @@ -25,8 +25,8 @@ Manufacturer | Model | Position | Temperature | Humidity | Pressure -------------|-------|----------|-------------|----------|---------- Vaisala | RS92-SGP/NGP | :heavy_check_mark: | :heavy_check_mark: | :x: | :x: Vaisala | RS41-SG/SGP/SGM | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: (for -SGP) -Graw | DFM06/09/17 | :heavy_check_mark: | :x: | :x: | :x: -Meteomodem | M10 | :heavy_check_mark: | :heavy_check_mark: | :x: | Not Sent +Graw | DFM06/09/17 | :heavy_check_mark: | :heavy_check_mark: | :x: | :x: +Meteomodem | M10 | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | Not Sent Meteomodem | M20 | :heavy_check_mark: | :x: | :x: | Not Sent Meteo-Radiy | MP3-H1 (MRZ-H1) | :heavy_check_mark: | :x: | :x: | :x: From 9ae8b790f0b2ba156e210b13f3f77f838d6c5fa1 Mon Sep 17 00:00:00 2001 From: michael carter Date: Mon, 4 Oct 2021 07:04:51 +0100 Subject: [PATCH 3/7] add values to mqtt --- RX_FSK/src/mqtt.cpp | 21 +++++++++++++++++++-- RX_FSK/src/mqtt.h | 1 + 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/RX_FSK/src/mqtt.cpp b/RX_FSK/src/mqtt.cpp index 435fd9e..727eb19 100644 --- a/RX_FSK/src/mqtt.cpp +++ b/RX_FSK/src/mqtt.cpp @@ -3,6 +3,7 @@ #include #include #include +#include "RS41.h" TimerHandle_t mqttReconnectTimer; @@ -85,8 +86,7 @@ void MQTT::publishPacket(SondeInfo *si) "\"launchKT\": %d," "\"burstKT\": %d," "\"countKT\": %d," - "\"crefKT\": %d" - "}", + "\"crefKT\": %d", (int)si->active, si->freq, s->id, @@ -116,6 +116,23 @@ void MQTT::publishPacket(SondeInfo *si) s->countKT, s->crefKT ); + if ( !isnan( s->temperature ) ) { + snprintf(payload, 1024, "%s%s%.1f", payload, ",\"temperature\": ", s->temperature ); + } + if ( !isnan( s->relativeHumidity ) ) { + snprintf(payload, 1024, "%s%s%.1f", payload, ",\"relativeHumidity\": ", s->relativeHumidity ); + } + if ( !isnan( s->pressure ) ) { + snprintf(payload, 1024, "%s%s%.1f", payload, ",\"pressure\": ", s->pressure ); + } + if ( !isnan( s->batteryVoltage && s->batteryVoltage > 0 ) ) { + snprintf(payload, 1024, "%s%s%.1f", payload, ",\"batteryVoltage\": ", s->batteryVoltage ); + } + char subtype[11]; + if ( RS41::getSubtype( subtype, 11, si) == 0 ) { + snprintf(payload, 1024, "%s%s%s%s", payload, ",\"subtype\": \"", subtype, "\"" ); + } + snprintf(payload, 1024, "%s%s", payload, "}" ); // terminate payload string char topic[128]; snprintf(topic, 128, "%s%s", this->prefix, "packet"); diff --git a/RX_FSK/src/mqtt.h b/RX_FSK/src/mqtt.h index 0ccd377..a24a8b1 100644 --- a/RX_FSK/src/mqtt.h +++ b/RX_FSK/src/mqtt.h @@ -4,6 +4,7 @@ #include #include #include "Sonde.h" +#include "RS41.h" class MQTT { From 4f63242afccd6e79786ff84ecb7422b0854d71b8 Mon Sep 17 00:00:00 2001 From: "Hansi, dl9rdz" Date: Tue, 5 Oct 2021 21:41:21 +0200 Subject: [PATCH 4/7] screens minor update, add large tft portrait --- RX_FSK/data/screens1.txt | 22 +++ RX_FSK/data/screens5.txt | 308 ++++++++++++++++++++++++++------------- 2 files changed, 231 insertions(+), 99 deletions(-) diff --git a/RX_FSK/data/screens1.txt b/RX_FSK/data/screens1.txt index a915e77..baa0fd5 100644 --- a/RX_FSK/data/screens1.txt +++ b/RX_FSK/data/screens1.txt @@ -241,3 +241,25 @@ fonts=0,1 4,9=Mh%rH 6,0=MphPa 6,11=MbV + +############# +@GPS-Data +timer=-1,-1,-1 +key1action=+,0,F,W +key2action=>,#,#,# +timeaction=#,#,# +fonts=0,1 +0,0=xGPS-Data +1,0=xLAT : +1,6=gA +2,0=xLONG: +2,6=gO +3,0=xALT : +3,9=gH +4,0=xSonde +5,0=xAlt : +5,6=a +6,0=xDist: +6,6=gD + + diff --git a/RX_FSK/data/screens5.txt b/RX_FSK/data/screens5.txt index b2ec5e7..857b5cc 100644 --- a/RX_FSK/data/screens5.txt +++ b/RX_FSK/data/screens5.txt @@ -108,110 +108,220 @@ # => Button press activates default receiver view, double press does nothing # Mid press activates Spectrum display, long press activates Wifi scan # - key2 has no function -@ScannerPortrait +########### +@ScannerTFT-D timer=-1,0,0 key1action=D,#,F,W -key2action=>,#,#,# +key2action=#,#,#,# timeaction=#,D,+ -0,0=XScan -0,5=S#: -0,9,4.5=T -6,0=XHoehe -6,5=GH -color=ffff00 -2,0=F MHz +scale=11,10 +fonts=0,2 +color=B0B0B0 +0,0=Xsuche.. +color=6C757D +3,0=xStartort +color=B0B0B0 4,0=S -color=00ff00,444444 -7,5=n -7,0=bV +color=6C757D +3,15=xFreq. Platz +color=B0B0B0 +4,15,23=S# +color=6C757D +6,0=xTyp +color=B0B0B0 +7,0,5=T +color=6C757D +6,15=xFrequenz +color=B0B0B0 +7,15=F +color=6C757D +28,0=Scanner +28,9=n +28,21=bVV ############ -# Default configuration for "Legacy" display: -# - view timer=-1, rx timer=-1 (disabled); norx timer=20 (or -1 for "old" behaviour) -# => norx timer fires after not receiving a singla for 20 seconds -# - key1 actions: +,0,F,W -# => Button1 press: next sonde; double press => @Scanner display -# => Mid press activates Spectrum display, long press activates Wifi scan -# - key2 actions: 2,#,#,# -# => BUtton2 activates display 2 (@Field) -# - timer actions: #,#,0 -# (norx timer: if no signal for >20 seconds: go back to scanner mode) -# -@LegacyPortrait -timer=-1,-1,N -key1action=+,0,F,W -key2action=>,#,#,# -timeaction=#,#,0 -9,10=f -9,0=r -9,4=Q -5,0=g0NCS,35,ffff00,000044,6,33ff33,5,eeaa00 -5,7=g0CCS,35,ffff00,000044,6,55ff55,5,eeaa00 -0,0=s -0,9=is -2,0=L -3,0=O -color=FFFF00 -1,6=Hk km/h -color=FF0000 -1,0=GD -color=FFFFFF -4,9=GH -3,9=V -4,0=A - -############ -@PeilungTFTPortrait -timer=-1,-1,N -key1action=+,0,F,W -key2action=>,#,#,# -timeaction=#,#,# -color=ffff00,000033 -color=bbbbbb,000000 -0,2=xN Top: -0,8=xCourse Top: -color=ffff00,000033 -1,0=g0NCS,35,ffff00,000044,6,33ff33,5,eeaa00 -1,7=g0CCS,35,ffff00,000044,6,55ff55,5,eeaa00 -color=ffffff,000000 -6,0=xDirection: -6,8,4=gI -7,0=xCOG: -7,4,4=gC -7,8=xturn: -7,12,4=gB - -############ -@GPSdataTFTPortrait -timer=-1,-1,N -key1action=+,0,F,W -key2action=>,#,#,# -timeaction=#,#,# -0,0=xOn-board GPS: -1,0,8=gA -2,0,8=gO -3,0,8=gH -4,0,8=gC -5,0=xGPS vs Sonde: -6,0,8=gD -7,0,8=gI -7,8,8=gB - -############ -@BatteryTFTPortrait +@MainTFT-D timer=-1,-1,-1 -key1action=+,0,F,W -key2action=>,#,#,# -timeaction=#,#,# -0,0=xBattery status: -0,14=bS -1,0=xBatt: -1,5,5=bVV -2,0,16=bCmA(charging) -3,0,16=bDmA(discharging) -4.4,0=xUSB: -4.4,5,5=bUV -5.4,0,10=bImA -6.4,0=xTemp: -6.4,5,5=bT C +key1action=>,0,F,W +key2action=+,#,#,# +timeaction=#,#,0 +scale=11,10 +fonts=0,2 +color=6C757D +0,0=xSerial +0,6=t +color=B0B0B0 +1,0=Is +color=6C757D +0,14=xFreq. +0,17.5=s +color=B0B0B0 +1,14=F +color=6C757D +3,0=xLatitude +color=B0B0B0 +4,0,10=L +color=6C757D +3,14=xLongitude +color=B0B0B0 +4,14,23=O +color=6C757D +6,0=xHoriz. Geschw. +color=B0B0B0 +7,0,10=Hkkm/h +color=6C757D +6,14=xVert. Geschw. +color=B0B0B0 +7,13.5,23=Vm/s +color=6C757D +9.5,14=xHoehe Sonde +color=ffff00 +10.5,13.5,23=A +color=ffff00,000033 +9,1=g0CCS,45,ffff00,000044,4,55ff55,4,eeaa00 +color=bbbbbb,000000 +color=6C757D +12.5,14=xHoehe RX +color=ffff00 +13.5,14=GH +color=6C757D +15.5,14=xEntfernung +color=ffff00 +16.5,14,23=GD +color=6C757D +19,0=xTimer +color=B0B0B0 +20,0,10=Kc4 +color=6C757D +19,14=xRSSI +color=B0B0B0 +20,14,23=R +color=6C757D +22,0=xLufttemperatur +color=B0B0B0 +23,0,10=Mt°C +color=6C757D +22,14=xLuftfeuchtigkeit +color=B0B0B0 +23,14,23=Mh%rH +color=6C757D +25,0=xLuftdruck +color=B0B0B0 +26,0,10=MphPa +color=6C757D +25,14=xZellenspannung +color=B0B0B0 +26,14,23=MbV +color=6C757D +28,0=Q +28,13=c +28,21=bVV +########### +@ScannerTFT-E +timer=-1,0,0 +key1action=D,#,F,W +key2action=#,#,#,# +timeaction=#,D,+ +scale=11,10 +fonts=0,2 +color=B0B0B0 +0,0=XScan... +color=6C757D +3,0=xLaunchsize +color=B0B0B0 +4,0=S +color=6C757D +3,15=xFreq.index +color=B0B0B0 +4,15,23=S# +color=6C757D +6,0=xType +color=B0B0B0 +7,0,5=T +color=6C757D +6,15=xFrequency +color=B0B0B0 +7,15=F +color=6C757D +28,0=Scanner +28,9=n +28,21=bVV + +############ +@MainTFT +timer=-1,-1,-1 +key1action=>,0,F,W +key2action=+,#,#,# +timeaction=#,#,0 +scale=11,10 +fonts=0,2 +color=6C757D +0,0=xSerial +0,6=t +color=B0B0B0 +1,0=Is +color=6C757D +0,14=xFreq. +0,17.5=s +color=B0B0B0 +1,14=F +color=6C757D +3,0=xLatitude +color=B0B0B0 +4,0,10=L +color=6C757D +3,14=xLongitude +color=B0B0B0 +4,14,23=O +color=6C757D +6,0=xHor.Velocity +color=B0B0B0 +7,0,10=Hkkm/h +color=6C757D +6,14=xVert.Velocity +color=B0B0B0 +7,13.5,23=Vm/s +color=6C757D +9.5,14=xAltitude +color=ffff00 +10.5,13.5,23=A +color=ffff00,000033 +9,1=g0CCS,45,ffff00,000044,4,55ff55,4,eeaa00 +color=bbbbbb,000000 +color=6C757D +12.5,14=xRX Altitude +color=ffff00 +13.5,14=GH +color=6C757D +15.5,14=xDistance +color=ffff00 +16.5,14,23=GD +color=6C757D +19,0=xTimer +color=B0B0B0 +20,0,10=Kc4 +color=6C757D +19,14=xRSSI +color=B0B0B0 +20,14,23=R +color=6C757D +22,0=xTemperature +color=B0B0B0 +23,0,10=Mt°C +color=6C757D +22,14=xHumidity +color=B0B0B0 +23,14,23=Mh%rH +color=6C757D +25,0=xPressure +color=B0B0B0 +26,0,10=MphPa +color=6C757D +25,14=xSonde Battery +color=B0B0B0 +26,14,23=MbV +color=6C757D +28,0=Q +28,13=c +28,21=bVV From ab474e9816cc406adafbb4335970b64d770ac289 Mon Sep 17 00:00:00 2001 From: "Hansi, dl9rdz" Date: Tue, 5 Oct 2021 21:47:13 +0200 Subject: [PATCH 5/7] more consistent names in json --- README.md | 2 +- RX_FSK/src/mqtt.cpp | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index aacd81d..56c7411 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ based on a TTGO LoRa ESP32 board. It supports OLED displays (SSD1306, SH1106) and TFT displays (ILI9225, ILI9341/9342). It also supports feeding data to external applications using WiFi (NOT bluetooth): -- Arduino app by dl9rdz (see https://github.com/dl9rdz/rdzwx-go for apk download) +- Android app by dl9rdz (see https://github.com/dl9rdz/rdzwx-go for apk download) - AXUDP (for aprsmap application by oe5dxl, among others) - KISS TNC (aprs format, mainly useful for APRSdroid app) - MQTT diff --git a/RX_FSK/src/mqtt.cpp b/RX_FSK/src/mqtt.cpp index d041737..fd40760 100644 --- a/RX_FSK/src/mqtt.cpp +++ b/RX_FSK/src/mqtt.cpp @@ -118,16 +118,16 @@ void MQTT::publishPacket(SondeInfo *si) s->crefKT ); if ( !isnan( s->temperature ) ) { - snprintf(payload, 1024, "%s%s%.1f", payload, ",\"temperature\": ", s->temperature ); + snprintf(payload, 1024, "%s%s%.1f", payload, ",\"temp\": ", s->temperature ); } if ( !isnan( s->relativeHumidity ) ) { - snprintf(payload, 1024, "%s%s%.1f", payload, ",\"relativeHumidity\": ", s->relativeHumidity ); + snprintf(payload, 1024, "%s%s%.1f", payload, ",\"humidity\": ", s->relativeHumidity ); } if ( !isnan( s->pressure ) ) { snprintf(payload, 1024, "%s%s%.1f", payload, ",\"pressure\": ", s->pressure ); } if ( !isnan( s->batteryVoltage && s->batteryVoltage > 0 ) ) { - snprintf(payload, 1024, "%s%s%.1f", payload, ",\"batteryVoltage\": ", s->batteryVoltage ); + snprintf(payload, 1024, "%s%s%.1f", payload, ",\"batt\": ", s->batteryVoltage ); } char subtype[11]; if ( RS41::getSubtype( subtype, 11, si) == 0 ) { From 63f303f226206d5dd7a51d490d1d43a0df85945f Mon Sep 17 00:00:00 2001 From: "Hansi, dl9rdz" Date: Tue, 5 Oct 2021 21:50:12 +0200 Subject: [PATCH 6/7] version update --- RX_FSK/version.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/RX_FSK/version.h b/RX_FSK/version.h index 90e2ecd..7843c18 100644 --- a/RX_FSK/version.h +++ b/RX_FSK/version.h @@ -1,4 +1,4 @@ const char *version_name = "rdzTTGOsonde"; -const char *version_id = "devel20211003"; +const char *version_id = "devel20211005"; const int SPIFFS_MAJOR=2; const int SPIFFS_MINOR=16;