From eb31180a0ee9bfeec707a48b78374116c982c7f7 Mon Sep 17 00:00:00 2001 From: Hieromon Ikasamo Date: Tue, 3 Sep 2019 11:53:51 +0900 Subject: [PATCH] Supprts erase operand --- ESPShaker/ESPShaker.ino | 10 ++++++++-- README.md | 3 +++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/ESPShaker/ESPShaker.ino b/ESPShaker/ESPShaker.ino index 568aeed..bde4808 100644 --- a/ESPShaker/ESPShaker.ino +++ b/ESPShaker/ESPShaker.ino @@ -31,7 +31,7 @@ extern "C" { extern "C" uint32_t _SPIFFS_start; extern "C" uint32_t _SPIFFS_end; -#define _VERSION "1.3.3" +#define _VERSION "1.4" class httpHandler : public RequestHandler { public: @@ -1432,6 +1432,12 @@ void wifiConfig() { Serial.println(")"); Serial.println(WiFi.config(stationIP, stationGW, stationNM, stationDNS1, stationDNS2) ? "OK" : "Fail"); } + else { + if (s_stationIP == "erase") { + Serial.println("ESP.eraseConfig"); + Serial.println(ESP.eraseConfig() ? "OK" : "Fail"); + } + } Serial.print("> "); } @@ -1475,7 +1481,7 @@ static const commandS commands[] = { { "apconfig", "[AP_IP] [GW_IP] [NETMASK]", softAPConfig }, { "autoconnect", "on|off", autoConnect }, { "begin", "[SSID [PASSPHRASE]] [#wait]", beginWiFi }, - { "config", "IP GW [NETMASK] [DNS1] [DNS2]", wifiConfig }, + { "config", "{IP GW [NETMASK] [DNS1] [DNS2]}|erase", wifiConfig }, { "delay", "MILLISECONDS", doDelay }, { "discon", "[ap]", disconnWiFi }, { "eeprom", "{addr [ADDRESS]}|{clear BYTE LENGTH}|{write DATA}|{read LENGTH}", eeprom }, diff --git a/README.md b/README.md index 205aaf7..bc140b4 100644 --- a/README.md +++ b/README.md @@ -463,6 +463,9 @@ ESP8266 UART RX buffer size is 128 bytes also ESPShaker has 128 bytes command bu ### Change log +#### [1.4] 2019-09-03 +- Suppors **erase** operand with **config** command. + #### [1.3.3] 2018-11-28 - Suppors ESP8266 Arduino core release 2.4.2