From d056ec8b762686d1738791b45891dd34f0d6a217 Mon Sep 17 00:00:00 2001
From: "Hans P. Reiser"
Date: Tue, 23 Apr 2019 13:08:02 +0200
Subject: [PATCH] merging pull request #2 by DL2MF to devel branch
---
README.md | 20 ++-
RX_FSK/RX_FSK.ino | 264 +++++++++++++++++++++++----------
RX_FSK/data/config.txt | 45 +++++-
RX_FSK/data/index.html | 27 +++-
RX_FSK/data/networks.txt | 10 +-
RX_FSK/data/qrg.txt | 23 ++-
libraries/SondeLib/DFM.cpp | 8 +-
libraries/SondeLib/RS41.cpp | 2 +-
libraries/SondeLib/Scanner.cpp | 15 +-
libraries/SondeLib/Sonde.cpp | 59 ++++++--
libraries/SondeLib/Sonde.h | 43 ++++--
libraries/SondeLib/aprs.cpp | 6 +-
libraries/SondeLib/aprs.h | 2 +-
13 files changed, 373 insertions(+), 151 deletions(-)
diff --git a/README.md b/README.md
index 432f944..2666c61 100644
--- a/README.md
+++ b/README.md
@@ -4,14 +4,20 @@ RDZ_TTGO_SONDE
This a simple, experimental, not (well) tested, and incomplete decoder for
radiosonde RS41 and DFM06/09 on a TTGO LoRa ESP32 with OLED display board.
+There have been made some additions for TTGO LoRa ESP32 with only RST button.
+Please check also your OLED port settings, both versions use different ports.
+You can setup the depending ports in config.txt, OLED Setup is depending on hardware of LoRa board
+- TTGO v1: SDA=4 SCL=15, RST=16
+- TTGO v2: SDA=21 SCL=22, RST=16
+
## Button commands
You can use the button on the board (not the reset button, the second one) to
issue some commands. The software distinguishes between several inputs:
-SHORT Short button press (<1.5 seconds)
-DOUBLE Short button press, followed by another button press within 0.5 seconds
-MID Medium-length button press (2-4 seconds)
-LONG Long button press (>5 seconds)
+- SHORT Short button press (<1.5 seconds)
+- DOUBLE Short button press, followed by another button press within 0.5 seconds
+- MID Medium-length button press (2-4 seconds)
+- LONG Long button press (>5 seconds)
## Wireless configuration
@@ -39,10 +45,14 @@ for the last 18 frames, if reception was successfull (|) or failed (.)
A DOUBLE press will switch to scanning mode.
A SHORT press will switch to the next channel in channels.txt
-# Spectrum mode
+## Spectrum mode
A medium press will active scan the whole band (400..406 MHz) and display a
spectrum diagram (each line == 50 kHz)
+For TTGO boards without configurable button there are some new parameter in config.txt:
+- spectrum=10 // 0=off / 1-99 number of seconds to show spectrum after restart
+- timer=1 // 0=off / 1= show spectrum countdown timer in spectrum display
+- marker=1 // 0=off / 1= show channel edge freq in spectrum display
## Setup
diff --git a/RX_FSK/RX_FSK.ino b/RX_FSK/RX_FSK.ino
index 9d5e473..557b8f6 100644
--- a/RX_FSK/RX_FSK.ino
+++ b/RX_FSK/RX_FSK.ino
@@ -3,6 +3,7 @@
#include
#include
#include
+#include
#include
#include
@@ -12,11 +13,6 @@
#define LORA_LED 9
-// I2C OLED Display works with SSD1306 driver
-//#define OLED_SDA 4
-//#define OLED_SCL 15
-//#define OLED_RST 16
-
// UNCOMMENT one of the constructor lines below
U8X8_SSD1306_128X64_NONAME_SW_I2C *u8x8=NULL; // initialize later after reading config file
//U8X8_SSD1306_128X64_NONAME_SW_I2C u8x8(/* clock=*/ OLED_SCL, /* data=*/ OLED_SDA, /* reset=*/ OLED_RST); // Unbuffered, basic graphics, software I2C
@@ -29,20 +25,14 @@ AsyncWebServer server(80);
#define LOCALUDPPORT 9002
-// moved to sonde.config
-//const char * udpAddress = "192.168.42.20";
-//const int udpPort = 9002;
-
boolean connected = false;
WiFiUDP udp;
-
// Set LED GPIO
-const int ledPin = 2;
+int ledPin = 1;
// Stores LED state
String ledState;
-
// Replaces placeholder with LED state value
String processor(const String& var){
Serial.println(var);
@@ -91,6 +81,7 @@ void setupChannelList() {
}
int i=0;
sonde.clearSonde();
+ Serial.println("Reading channel config:");
while(file.available()) {
String line = file.readStringUntil('\n');
if(!file.available()) break;
@@ -105,8 +96,9 @@ void setupChannelList() {
else if (space[1]=='6') { type=STYPE_DFM06; }
else continue;
int active = space[3]=='+'?1:0;
- Serial.printf("Adding %f with type %d (active: %d)\n",freq,type,active);
- sonde.addSonde(freq, type, active);
+ char *launchsite = strchr(line.c_str(), ' ');
+ Serial.printf("Add %f - type %d (on/off: %d)- Site: \n",freq,type,active,launchsite);
+ sonde.addSonde(freq, type, active, launchsite);
i++;
}
}
@@ -114,7 +106,7 @@ void setupChannelList() {
const char *createQRGForm() {
char *ptr = message;
strcpy(ptr,"