diff --git a/libraries/OTAUpdate/examples/OTA/OTA.ino b/libraries/OTAUpdate/examples/OTA/OTA.ino index 586026f8..758b0beb 100644 --- a/libraries/OTAUpdate/examples/OTA/OTA.ino +++ b/libraries/OTAUpdate/examples/OTA/OTA.ino @@ -67,9 +67,10 @@ void setup() { Serial.println((int)ret); return; } - if(ota.download(OTA_FILE_LOCATION, "/update.bin") <= 0) { + int ota_size = ota.download(OTA_FILE_LOCATION, "/update.bin"); + if(ota_size <= 0) { Serial.println("ota.download() error: "); - Serial.println((int)ret); + Serial.println(ota_size); return; } ret = ota.verify(); diff --git a/libraries/OTAUpdate/examples/WiFiFirmwareOTA/WiFiFirmwareOTA.ino b/libraries/OTAUpdate/examples/WiFiFirmwareOTA/WiFiFirmwareOTA.ino index 8bde1808..73a04fd9 100644 --- a/libraries/OTAUpdate/examples/WiFiFirmwareOTA/WiFiFirmwareOTA.ino +++ b/libraries/OTAUpdate/examples/WiFiFirmwareOTA/WiFiFirmwareOTA.ino @@ -77,9 +77,10 @@ void setup() { Serial.println((int)ret); return; } - if(ota.download(OTA_FILE_LOCATION) <= 0) { + int ota_size = ota.download(OTA_FILE_LOCATION); + if(ota_size <= 0) { Serial.println("ota.download() error: "); - Serial.println((int)ret); + Serial.println(ota_size); return; } ret = ota.verify();