Skip to content

Commit 9c36ff9

Browse files
sk1tt1shigrr
authored andcommitted
Fix example for ESP8266httpUpdate (esp8266#2251)
* Fix minor typo in spelling of failed. Removed s from http paths. * add check if we are just updating spiffs to not reboot. example now works with this change.
1 parent 3f1ab1f commit 9c36ff9

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

libraries/ESP8266httpUpdate/examples/httpUpdateSPIFFS/httpUpdateSPIFFS.ino

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,14 +41,14 @@ void loop() {
4141
if((WiFiMulti.run() == WL_CONNECTED)) {
4242

4343
USE_SERIAL.println("Update SPIFFS...");
44-
t_httpUpdate_return ret = ESPhttpUpdate.updateSpiffs("https://server/spiffs.bin");
44+
t_httpUpdate_return ret = ESPhttpUpdate.updateSpiffs("http://server/spiffs.bin");
4545
if(ret == HTTP_UPDATE_OK) {
4646
USE_SERIAL.println("Update sketch...");
47-
ret = ESPhttpUpdate.update("https://server/file.bin");
47+
ret = ESPhttpUpdate.update("http://server/file.bin");
4848

4949
switch(ret) {
5050
case HTTP_UPDATE_FAILED:
51-
USE_SERIAL.printf("HTTP_UPDATE_FAILD Error (%d): %s", ESPhttpUpdate.getLastError(), ESPhttpUpdate.getLastErrorString().c_str());
51+
USE_SERIAL.printf("HTTP_UPDATE_FAILED Error (%d): %s", ESPhttpUpdate.getLastError(), ESPhttpUpdate.getLastErrorString().c_str());
5252
break;
5353

5454
case HTTP_UPDATE_NO_UPDATES:

libraries/ESP8266httpUpdate/src/ESP8266httpUpdate.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,7 @@ HTTPUpdateResult ESP8266HTTPUpdate::handleUpdate(HTTPClient& http, const String&
297297
DEBUG_HTTP_UPDATE("[httpUpdate] Update ok\n");
298298
http.end();
299299

300-
if(_rebootOnUpdate) {
300+
if(_rebootOnUpdate && !spiffs) {
301301
ESP.restart();
302302
}
303303

0 commit comments

Comments
 (0)