wiring done, move to basic for real debugging

This commit is contained in:
Torsten Ruger 2021-07-04 19:32:01 +03:00
parent 8f32fb0c94
commit 2cb5cb0363
4 changed files with 12 additions and 8 deletions

View File

@ -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;

View File

@ -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

View File

@ -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;

View File

@ -1,5 +1,6 @@
#include "ota.hpp"
#include "serial.hpp"
#include <LittleFS.h>
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([]() {