mirror of
https://github.com/esp8266/Arduino.git
synced 2025-06-12 01:53:07 +03:00
Fix espota completion success/fail check (#7204)
The OTA script was not reporting the actual reported upload status from the ESP8266, and instead always printed "Result: OK" no matter what happened. Now check for ERROR or OK in final message (and ensure the message is not accidentally merged with the final byte count) and report properly. Fixes #7162
This commit is contained in:
committed by
GitHub
parent
1af4ea661f
commit
9632e868d5
@ -328,9 +328,13 @@ void ArduinoOTAClass::_runUpdate() {
|
||||
}
|
||||
|
||||
if (Update.end()) {
|
||||
client.print("OK");
|
||||
client.stop();
|
||||
// Ensure last count packet has been sent out and not combined with the final OK
|
||||
client.flush();
|
||||
delay(1000);
|
||||
client.print("OK");
|
||||
client.flush();
|
||||
delay(1000);
|
||||
client.stop();
|
||||
#ifdef OTA_DEBUG
|
||||
OTA_DEBUG.printf("Update Success\n");
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user