Skip to content

Commit 8a67733

Browse files
authored
Update ESP32OTAHelper.h
1 parent 7d2dfd6 commit 8a67733

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

examples/OTAUpdate/ESP32OTAHelper.h

+5-5
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,14 @@ String startOtaUpdate(const String &url) {
1717
Serial.print("[startOtaUpdate()] GET...\n");
1818
// start connection and send HTTP header
1919
int httpCode = https.GET();
20-
if (httpCode < 0) return "GET... failed, error: " + https.errorToString(httpCode);
21-
if (httpCode != HTTP_CODE_OK || httpCode != HTTP_CODE_MOVED_PERMANENTLY) return "HTTP response code: " + String(httpCode);
22-
20+
if (httpCode != HTTP_CODE_OK) return "GET... failed, error: " + https.errorToString(httpCode);
21+
2322
int contentLength = https.getSize();
24-
Serial.printf("Content-Length: %d\n", contentLength);
23+
Serial.printf("OTA size: %d bytes \n", contentLength);
2524

2625
if (contentLength == 0) return "There was no content length in the response";
2726

27+
Serial.printf("Beginning update..!\n");
2828
bool canBegin = Update.begin(contentLength);
2929

3030
if (!canBegin) return "Not enough space to begin OTA";
@@ -45,4 +45,4 @@ String startOtaUpdate(const String &url) {
4545
return "";
4646
}
4747

48-
#endif
48+
#endif

0 commit comments

Comments
 (0)