diff --git a/RX_FSK/RX_FSK.ino b/RX_FSK/RX_FSK.ino index e0a1923..b79e449 100644 --- a/RX_FSK/RX_FSK.ino +++ b/RX_FSK/RX_FSK.ino @@ -308,7 +308,10 @@ void HTMLBODYEND(char *ptr) { strcat(ptr, ""); } void HTMLSAVEBUTTON(char *ptr) { - strcat(ptr, "
"); + strcat(ptr, "
" + "rdzTTGOserver "); + strcat(ptr, version_id); + strcat(ptr, ""); } const char *createQRGForm() { @@ -419,7 +422,8 @@ void setupWifiList() { const char *createWIFIForm() { char *ptr = message; char tmp[4]; - strcpy(ptr, HTMLHEAD); strcat(ptr, ""); + strcpy(ptr, HTMLHEAD); + strcat(ptr, ""); HTMLBODY(ptr, "wifi.html"); strcat(ptr, ""); for (int i = 0; i < MAX_WIFI; i++) { @@ -430,7 +434,7 @@ const char *createWIFIForm() { i + 1, i < nNetworks ? networks[i].id.c_str() : "", i + 1, i < nNetworks ? networks[i].pw.c_str() : ""); } - strcat(ptr, "
NrSSIDPassword
"); + strcat(ptr, ""); //
"); HTMLSAVEBUTTON(ptr); HTMLBODYEND(ptr); @@ -827,7 +831,8 @@ const char *ctrllabel[] = {"Receiver/next freq. (short keypress)", "Scanner (dou const char *createControlForm() { char *ptr = message; - strcpy(ptr, HTMLHEAD); strcat(ptr, ""); + strcpy(ptr, HTMLHEAD); + strcat(ptr, ""); HTMLBODY(ptr, "control.html"); for (int i = 0; i < 9; i++) { strcat(ptr, "

"); } } + strcat(ptr, "\n"); HTMLBODYEND(ptr); Serial.printf("Control form: size=%d bytes\n", strlen(message)); return message; diff --git a/RX_FSK/data/index.html b/RX_FSK/data/index.html index ae68bb8..3e13977 100755 --- a/RX_FSK/data/index.html +++ b/RX_FSK/data/index.html @@ -9,7 +9,6 @@
-

rdzTTGOSonde Server

QRG Data @@ -76,6 +75,7 @@ See https://www.gnu.org/licenses/gpl-2.0.txt for details.
+
diff --git a/RX_FSK/data/rdz.js b/RX_FSK/data/rdz.js index c8c26ad..8eaa998 100644 --- a/RX_FSK/data/rdz.js +++ b/RX_FSK/data/rdz.js @@ -3,10 +3,20 @@ stypes.set('4', 'RS41'); stypes.set('R', 'RS92'); stypes.set('D', 'DFM'); stypes.set('M', 'M10/M20'); -//stypes.set('2', 'M10/M20'); stypes.set('3', 'MP3H'); -/* (no longer) Used by qrg.html in RX_FSK.ino */ +function footer() { + document.addEventListener("DOMContentLoaded", function(){ + var form = document.querySelector(".wrapper"); + form.addEventListener("input", function() { + document.querySelector(".save").disabled = false; + }); + document.querySelector(".save").disabled = true; + document.querySelector(".ttgoinfo").innerHTML = "rdzTTGOserver %VERSION_ID%"; + }); +} + +/* Used by qrg.html in RX_FSK.ino */ function prep() { var stlist=document.querySelectorAll("input.stype"); for(txt of stlist){ @@ -28,16 +38,18 @@ function prep() { function qrgTable() { var tab=document.getElementById("divTable"); - var table = ""; + var table = "
ChActiveFrequencyLaunchsiteDecoder
"; for(i=0; i"; - table += ""; - table += ""; - table += ""; + table += ""; + table += ""; + table += ""; + table += ""; } table += "
ChActiveFrequencyDecoderLaunchsite
" + (i+1) + "
"; tab.innerHTML = table; prep(); + footer(); } + diff --git a/RX_FSK/data/style.css b/RX_FSK/data/style.css index 8d93559..31ab12c 100755 --- a/RX_FSK/data/style.css +++ b/RX_FSK/data/style.css @@ -43,8 +43,18 @@ th.cfg { flex-grow: 1; border: none; margin: 0; padding: 0; } .footer { + background-color: #333; + display: flex; + justify-content: space-between; } +td.ch { + text-align: right; + padding: 0px 8px; +} +td.act { + text-align: center; +} table, th, td { border: 1px solid black; border-collapse: collapse; @@ -71,7 +81,6 @@ td#sfreq { .tabcontent { display: none; flex: 1; - padding: 6px 12px; border-top: none; flex-direction: column; overflow: auto; @@ -90,24 +99,16 @@ h1{ p{ font-size: 1.5rem; } -.canberemoved_button { - display: inline-block; - background-color: #008CBA; - border: none; - border-radius: 4px; - color: white; - padding: 16px 40px; - text-decoration: none; - font-size: 30px; - margin: 2px; - cursor: pointer; -} + .button2 { background-color: #f44336; } +:disabled.save { + opacity: 0.5; +} .save { - background-color: #0F3376; - border: black; + background-color: #CC1111; /* 0F33C6; */ + border: white; border-width: 1; color: white; padding: 8px 30px; @@ -117,6 +118,14 @@ p{ font-size: 14px; margin: 0 } + +.ttgoinfo { + color: white; + padding: 8px 10px; + display: block; + font-size: 14px; + margin: 0 +} .ctlbtn { background-color: #ccc; border: black; diff --git a/RX_FSK/src/json.cpp b/RX_FSK/src/json.cpp index 15b80da..010ae89 100644 --- a/RX_FSK/src/json.cpp +++ b/RX_FSK/src/json.cpp @@ -96,7 +96,7 @@ int sonde2json(char *buf, int maxlen, SondeInfo *si) // add only if available if(s->batteryVoltage > 0) { - n = snprintf(buf, maxlen, ",\"bat\": %.1f", s->batteryVoltage); + n = snprintf(buf, maxlen, ",\"batt\": %.1f", s->batteryVoltage); if(n>=maxlen) return -1; buf += n; maxlen -= n; } diff --git a/RX_FSK/src/mqtt.cpp b/RX_FSK/src/mqtt.cpp index 6b0b044..80b1148 100644 --- a/RX_FSK/src/mqtt.cpp +++ b/RX_FSK/src/mqtt.cpp @@ -62,7 +62,8 @@ void MQTT::publishUptime() // rxlat, rxlon only if not empty snprintf(payload, 256, "{\"uptime\": %lu, \"user\": \"%s\", ", millis(), username); if( !isnan(sonde.config.rxlat) && !isnan(sonde.config.rxlon) ) { - snprintf(payload, 256, "%s\"rxlat\": %.5f, \"rxlon\": %.5f, ", payload, sonde.config.rxlat, sonde.config.rxlon); + snprintf(payload, 256, "%s\"rxlat\": %.5f, \"rxlon\": %.5f, ", payload, sonde.config.rxlat, sonde.config.rxlon); + } snprintf(payload, 256, "%s\"sw\": \"%s\", \"ver\": \"%s\"}", version_name, version_id); Serial.println(payload); char topic[128]; diff --git a/platformio.ini b/platformio.ini index 1326766..6b379a3 100644 --- a/platformio.ini +++ b/platformio.ini @@ -25,7 +25,8 @@ lib_deps_external = https://github.com/dx168b/async-mqtt-client [env:ttgo-lora32] -platform = https://github.com/platformio/platform-espressif32.git#v3.3.2 +#platform = https://github.com/platformio/platform-espressif32.git#v3.3.2 +platform = https://github.com/platformio/platform-espressif32.git#v4.4.0 board = ttgo-lora32-v1 framework = arduino monitor_speed = 115200