From 2cb5cb0363f9cc34a2d51a3ca3559e810243dabf Mon Sep 17 00:00:00 2001 From: Torsten Ruger Date: Sun, 4 Jul 2021 19:32:01 +0300 Subject: [PATCH] wiring done, move to basic for real debugging --- fan_control/include/serial.hpp | 4 +++- fan_control/platformio.ini | 3 +-- fan_control/src/collector.cpp | 4 ++-- fan_control/src/ota.cpp | 9 ++++++--- 4 files changed, 12 insertions(+), 8 deletions(-) diff --git a/fan_control/include/serial.hpp b/fan_control/include/serial.hpp index 2395333..8c162e1 100644 --- a/fan_control/include/serial.hpp +++ b/fan_control/include/serial.hpp @@ -7,7 +7,8 @@ class WsSerial{ public: inline void print(const String& line){ println(line); } inline void println(const String& line){ - // enable debug the debugging Serial.println(line.c_str()); + // enable debug the debugging + Serial.println(line.c_str()); if(debug.size() > 100 ) debug.pop_back(); debug.push_front(line); } @@ -16,6 +17,7 @@ class WsSerial{ inline const String& first(){ return debug.front();}; inline void pop(){ return debug.pop_front();}; inline bool empty(){ return debug.empty();}; + inline void clear(){ debug.clear();} }; extern WsSerial debug_out; diff --git a/fan_control/platformio.ini b/fan_control/platformio.ini index 86bba67..65d9d3b 100644 --- a/fan_control/platformio.ini +++ b/fan_control/platformio.ini @@ -10,8 +10,7 @@ [env:sonoff_basic] platform = espressif8266 -;board = sonoff_basic -board = d1_mini_lite +board = sonoff_basic framework = arduino board_build.filesystem = littlefs diff --git a/fan_control/src/collector.cpp b/fan_control/src/collector.cpp index c555111..ae25740 100644 --- a/fan_control/src/collector.cpp +++ b/fan_control/src/collector.cpp @@ -18,8 +18,8 @@ WsSerial debug_out; // mini https://chewett.co.uk/blog/1066/pin-numbering-for-wemos-d1-mini-esp8266/ -DHT dht_in(4, DHT11); // D2 on mini -DHT dht_out(5, DHT11); // D1 on mini +DHT dht_in(1, DHT11); // D2 on mini , tx, 01 on basic +DHT dht_out(3, DHT11); // D1 on mini , rx 03 on basic Collector collector; diff --git a/fan_control/src/ota.cpp b/fan_control/src/ota.cpp index ae9a1d5..850eeeb 100644 --- a/fan_control/src/ota.cpp +++ b/fan_control/src/ota.cpp @@ -1,5 +1,6 @@ #include "ota.hpp" #include "serial.hpp" +#include void ota_setup(const char* ssid) { @@ -29,10 +30,12 @@ void ota_setup(const char* ssid) { String type; if (ArduinoOTA.getCommand() == U_FLASH) type = "sketch"; - else // U_SPIFFS + else{ // U_SPIFFS type = "filesystem"; - - // NOTE: if updating SPIFFS this would be the place to unmount SPIFFS using SPIFFS.end() + // NOTE: if updating SPIFFS this would be the place to unmount SPIFFS using SPIFFS.end() + LittleFS.end(); + } + if(DEBUG_SERIAL == false) debug_out.clear(); DEBUG_OUT.println("Start updating " + type); }); ArduinoOTA.onEnd([]() {