#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "version.h" // 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 //U8G2_SSD1306_128X64_NONAME_1_SW_I2C Display(U8G2_R0, /* clock=*/ OLED_SCL, /* data=*/ OLED_SDA, /* reset=*/ OLED_RST); // Page buffer, SW I2C //U8G2_SSD1306_128X64_NONAME_F_SW_I2C Display(U8G2_R0, /* clock=*/ OLED_SCL, /* data=*/ OLED_SDA, /* reset=*/ OLED_RST); // Full framebuffer, SW I2C int LORA_LED = 9; // default POUT for LORA LED used as serial monitor int e; enum MainState { ST_DECODER, ST_SCANNER, ST_SPECTRUM, ST_WIFISCAN, ST_UPDATE }; static MainState mainState = ST_WIFISCAN; // ST_WIFISCAN; AsyncWebServer server(80); String updateHost = "rdzsonde.my.to"; int updatePort = 80; String updateBinM = "/master/update.ino.bin"; String updateBinD = "/devel/update.ino.bin"; String *updateBin = &updateBinM; #define LOCALUDPPORT 9002 boolean connected = false; WiFiUDP udp; WiFiClient client; enum KeyPress { KP_NONE = 0, KP_SHORT, KP_DOUBLE, KP_MID, KP_LONG }; struct Button { uint8_t pin; uint32_t numberKeyPresses; KeyPress pressed; unsigned long press_ts; boolean doublepress; }; Button button1 = {0, 0, KP_NONE, 0, false}; // Set LED GPIO int ledPin = 1; // Stores LED state String ledState; // timestamp when spectrum display was activated static unsigned long specTimer; // Replaces placeholder with LED state value String processor(const String& var) { Serial.println(var); if (var == "STATE") { if (digitalRead(ledPin)) { ledState = "ON"; } else { ledState = "OFF"; } Serial.print(ledState); return ledState; } if (var == "VERSION_NAME") { return String(version_name); } if (var == "VERSION_ID") { return String(version_id); } return String(); } const String sondeTypeSelect(int activeType) { String sts = ""; for (int i = 0; i < 3; i++) { sts += "