esp8266_deauther/Reset_Sketch/Reset_Sketch.ino

48 lines
795 B
Arduino
Raw Normal View History

2018-03-24 18:15:59 +01:00
#include <EEPROM.h>
2020-07-05 15:49:44 +02:00
#include <LittleFS.h>
2018-03-24 18:15:59 +01:00
/*
Upload this sketch to your ESP8266 to erase
- all files in the SPIFFS,
- all data in the EEPROM
- WiFi credentials (SSID, password)
Also overwrites the previous program with this one (obviously).
*/
void setup() {
Serial.begin(115200);
Serial.println();
Serial.println("STARTING...");
EEPROM.begin(4096);
Serial.println("EEPROM initialized");
for (int i = 0; i < 4096; ++i){
EEPROM.write(i,0x00);
}
Serial.println("EEPROM cleaned");
2020-07-05 15:49:44 +02:00
LittleFS.begin();
2018-03-24 18:15:59 +01:00
Serial.println("SPIFFS initialized");
2020-07-05 15:49:44 +02:00
LittleFS.format();
2018-03-24 18:15:59 +01:00
Serial.println("SPIFFS cleaned");
ESP.eraseConfig();
Serial.println("WiFi credentials erased");
Serial.println("DONE!");
2018-03-25 11:34:58 +02:00
delay(10000);
2018-03-24 18:15:59 +01:00
ESP.reset();
}
void loop() {
2020-07-05 15:49:44 +02:00
}