diff --git a/Build-instructions-Bestway-WiFi-remote.pdf b/Build-instructions-Bestway-WiFi-remote.pdf index 01138386..619153a8 100644 Binary files a/Build-instructions-Bestway-WiFi-remote.pdf and b/Build-instructions-Bestway-WiFi-remote.pdf differ diff --git a/Code/fw/firmware.bin b/Code/fw/firmware.bin index 97b7330e..c023a16a 100644 Binary files a/Code/fw/firmware.bin and b/Code/fw/firmware.bin differ diff --git a/Code/fw/version.txt b/Code/fw/version.txt index 1d458b4a..ced1ede8 100644 --- a/Code/fw/version.txt +++ b/Code/fw/version.txt @@ -1 +1 @@ -2023-03-10-1230 \ No newline at end of file +2023-03-12-1600 \ No newline at end of file diff --git a/Code/src/config.h b/Code/src/config.h index 7def899a..0e7f8fb5 100644 --- a/Code/src/config.h +++ b/Code/src/config.h @@ -5,7 +5,7 @@ #include #endif #define DEVICE_NAME "layzspa" -#define FW_VERSION "2023-03-10-1230" +#define FW_VERSION "2023-03-12-1600" // String FW_VERSION = String(__DATE__) + "-" + __TIME__ + "-beta"; #define HA_PREFIX "homeassistant" diff --git a/Code/src/main.cpp b/Code/src/main.cpp index f2b5f7e8..d167dc6d 100644 --- a/Code/src/main.cpp +++ b/Code/src/main.cpp @@ -55,23 +55,18 @@ void setup() char stack; stack_start = &stack; + bwc.setup(); + bwc.loop(); Serial.begin(115200); Serial.println(F("\nStart")); -Serial.printf("Heap: %d, frag: %d\n", ESP.getFreeHeap(), ESP.getHeapFragmentation()); periodicTimer.attach(periodicTimerInterval, []{ periodicTimerFlag = true; }); // delayed mqtt start startComplete.attach(60, []{ if(useMqtt) enableMqtt = true; startComplete.detach(); }); - // update webpage every 2 seconds. (will also be updated on state changes) updateWSTimer.attach(2.0, []{ sendWSFlag = true; }); - // when NTP time is valid we save bootlog.txt and this timer stops bootlogTimer.attach(5, []{ if(DateTime.isTimeValid()) {bwc.saveRebootInfo(); bootlogTimer.detach();} }); - - bwc.setup(); - // needs to be loaded here for reading files - // LittleFS.begin(); loadWifi(); loadWebConfig(); startWiFi(); @@ -87,29 +82,8 @@ Serial.printf("Heap: %d, frag: %d\n", ESP.getFreeHeap(), ESP.getHeapFragmentatio bwc.print(FW_VERSION); Serial.println(F("End of setup()")); heap_water_mark = ESP.getFreeHeap(); - - // setClock(); - } -// void setClock() { -// // Set time via NTP, as required for x.509 validation -// configTime(3 * 3600, 0, "pool.ntp.org", "time.nist.gov"); -// Serial.print("Waiting for NTP time sync: "); -// time_t now = time(nullptr); -// while (now < 8 * 3600 * 2) { -// delay(500); -// Serial.print("."); -// now = time(nullptr); -// } -// Serial.println(""); -// struct tm timeinfo; -// gmtime_r(&now, &timeinfo); -// Serial.print("Current time: "); -// Serial.print(asctime(&timeinfo)); -// } - - void loop() { uint32_t freeheap = ESP.getFreeHeap(); diff --git a/Code/src/main.h b/Code/src/main.h index 94e2ac38..a719e629 100644 --- a/Code/src/main.h +++ b/Code/src/main.h @@ -9,7 +9,7 @@ #include #include #include -#include "certs.h" +// #include "certs.h" #include BearSSL::CertStore certStore; #include @@ -81,8 +81,6 @@ bool enableMqtt = false; /** used for handleAUX() */ bool runonce = true; -// void setClock(); - void sendWS(); String getOtherInfo(); void sendMQTT();