wiring done, move to basic for real debugging
This commit is contained in:
parent
8f32fb0c94
commit
2cb5cb0363
@ -7,7 +7,8 @@ class WsSerial{
|
|||||||
public:
|
public:
|
||||||
inline void print(const String& line){ println(line); }
|
inline void print(const String& line){ println(line); }
|
||||||
inline void println(const String& 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();
|
if(debug.size() > 100 ) debug.pop_back();
|
||||||
debug.push_front(line);
|
debug.push_front(line);
|
||||||
}
|
}
|
||||||
@ -16,6 +17,7 @@ class WsSerial{
|
|||||||
inline const String& first(){ return debug.front();};
|
inline const String& first(){ return debug.front();};
|
||||||
inline void pop(){ return debug.pop_front();};
|
inline void pop(){ return debug.pop_front();};
|
||||||
inline bool empty(){ return debug.empty();};
|
inline bool empty(){ return debug.empty();};
|
||||||
|
inline void clear(){ debug.clear();}
|
||||||
};
|
};
|
||||||
|
|
||||||
extern WsSerial debug_out;
|
extern WsSerial debug_out;
|
||||||
|
@ -10,8 +10,7 @@
|
|||||||
|
|
||||||
[env:sonoff_basic]
|
[env:sonoff_basic]
|
||||||
platform = espressif8266
|
platform = espressif8266
|
||||||
;board = sonoff_basic
|
board = sonoff_basic
|
||||||
board = d1_mini_lite
|
|
||||||
framework = arduino
|
framework = arduino
|
||||||
board_build.filesystem = littlefs
|
board_build.filesystem = littlefs
|
||||||
|
|
||||||
|
@ -18,8 +18,8 @@ WsSerial debug_out;
|
|||||||
|
|
||||||
|
|
||||||
// mini https://chewett.co.uk/blog/1066/pin-numbering-for-wemos-d1-mini-esp8266/
|
// mini https://chewett.co.uk/blog/1066/pin-numbering-for-wemos-d1-mini-esp8266/
|
||||||
DHT dht_in(4, DHT11); // D2 on mini
|
DHT dht_in(1, DHT11); // D2 on mini , tx, 01 on basic
|
||||||
DHT dht_out(5, DHT11); // D1 on mini
|
DHT dht_out(3, DHT11); // D1 on mini , rx 03 on basic
|
||||||
|
|
||||||
Collector collector;
|
Collector collector;
|
||||||
|
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
#include "ota.hpp"
|
#include "ota.hpp"
|
||||||
#include "serial.hpp"
|
#include "serial.hpp"
|
||||||
|
#include <LittleFS.h>
|
||||||
|
|
||||||
void ota_setup(const char* ssid) {
|
void ota_setup(const char* ssid) {
|
||||||
|
|
||||||
@ -29,10 +30,12 @@ void ota_setup(const char* ssid) {
|
|||||||
String type;
|
String type;
|
||||||
if (ArduinoOTA.getCommand() == U_FLASH)
|
if (ArduinoOTA.getCommand() == U_FLASH)
|
||||||
type = "sketch";
|
type = "sketch";
|
||||||
else // U_SPIFFS
|
else{ // U_SPIFFS
|
||||||
type = "filesystem";
|
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);
|
DEBUG_OUT.println("Start updating " + type);
|
||||||
});
|
});
|
||||||
ArduinoOTA.onEnd([]() {
|
ArduinoOTA.onEnd([]() {
|
||||||
|
Loading…
Reference in New Issue
Block a user