Skip to content

Commit 52509ba

Browse files
committed
OTA update improved error messages
The OTA update class can deliver an error message. old: "Please check your file and retry" new: "Could Not Activate The Firmware. (wrong board type?). Please check your file and retry!"
1 parent 7167db4 commit 52509ba

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

wled00/wled_server.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,15 @@ void initServer()
329329
return;
330330
}
331331
if (Update.hasError() || otaLock) {
332+
#ifdef ARDUINO_ARCH_ESP32
333+
if (Update.hasError()) {
334+
String updErr = Update.getError() == UPDATE_ERROR_ACTIVATE ? String("Could Not Activate The Firmware. (wrong board type?)") : String(Update.errorString());
335+
serveMessage(request, 500, F("Update failed!"), updErr + String("<br>Please check your file and retry!"), 254);
336+
} else
337+
serveMessage(request, 500, F("Update failed!"), F("Please check your file and retry! (OTA may be locked)"), 254);
338+
#else
332339
serveMessage(request, 500, F("Update failed!"), F("Please check your file and retry!"), 254);
340+
#endif
333341
} else {
334342
serveMessage(request, 200, F("Update successful!"), F("Rebooting..."), 131);
335343
doReboot = true;

0 commit comments

Comments
 (0)