From 7b58febb457a71bc4bde944898a6b0bb874cf048 Mon Sep 17 00:00:00 2001 From: Hansi Reiser Date: Mon, 8 Apr 2019 19:22:08 +0200 Subject: [PATCH] some web interface updates --- README.md | 17 ++ RX_FSK/RX_FSK.ino | 278 ++++++++++++++++++++++++++------- RX_FSK/data/index.html | 52 ++++-- RX_FSK/data/networks.txt | 2 + RX_FSK/data/qrg.txt | 8 +- RX_FSK/data/style.css | 37 +++++ libraries/SondeLib/Scanner.cpp | 34 ++-- libraries/SondeLib/Sonde.cpp | 32 +++- libraries/SondeLib/Sonde.h | 10 +- 9 files changed, 376 insertions(+), 94 deletions(-) diff --git a/README.md b/README.md index 0b60bc9..562f1bc 100644 --- a/README.md +++ b/README.md @@ -43,3 +43,20 @@ A SHORT press will switch to the next channel in channels.txt A medium press will active scan the whole band (400..406 MHz) and display a spectrum diagram (each line == 50 kHz) + +## Setup + +Download https://github.com/me-no-dev/ESPAsyncWebServer/archive/master.zip +and move to your Arduino IDE's libraries directory +Rename to (name without "-master") + +Download https://github.com/me-no-dev/AsyncTCP/archive/master.zip +and move to your Arduino IDE's libraries directory +Rename to (name without "-master") + +Install Arduino ESP32 file system uploader +https://randomnerdtutorials.com/install-esp32-filesystem-uploader-arduino-ide/ +Download https://github.com/me-no-dev/arduino-esp32fs-plugin/releases/download/1.0/ESP32FS-1.0.zip +Move to your Arduino IDE's tools directory + + diff --git a/RX_FSK/RX_FSK.ino b/RX_FSK/RX_FSK.ino index bf5118a..ad8e961 100644 --- a/RX_FSK/RX_FSK.ino +++ b/RX_FSK/RX_FSK.ino @@ -48,58 +48,29 @@ String processor(const String& var){ return String(); } -void SetupAsyncServer() { -// Route for root / web page - server.on("/", HTTP_GET, [](AsyncWebServerRequest *request){ - request->send(200, "text/plain", "Hello, world"); - }); - - server.on("/index.html", HTTP_GET, [](AsyncWebServerRequest *request){ - request->send(SPIFFS, "/index.html", String(), false, processor); - }); - - // Route to load style.css file - server.on("/style.css", HTTP_GET, [](AsyncWebServerRequest *request){ - request->send(SPIFFS, "/style.css", "text/css"); - }); +#define MAX_QRG 10 - // Route to set GPIO to HIGH - server.on("/on", HTTP_GET, [](AsyncWebServerRequest *request){ - digitalWrite(ledPin, HIGH); - request->send(SPIFFS, "/index.html", String(), false, processor); - }); - - // Route to set GPIO to LOW - server.on("/off", HTTP_GET, [](AsyncWebServerRequest *request){ - digitalWrite(ledPin, LOW); - request->send(SPIFFS, "/index.html", String(), false, processor); - }); - - // Start server - server.begin(); +const String sondeTypeSelect(int activeType) { + String sts = ""; + for(int i=0; i<3; i++) { + sts += "