File tree 1 file changed +5
-5
lines changed
1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -17,14 +17,14 @@ String startOtaUpdate(const String &url) {
17
17
Serial .print ("[startOtaUpdate()] GET...\n" );
18
18
// start connection and send HTTP header
19
19
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
+
23
22
int contentLength = https .getSize ();
24
- Serial .printf ("Content-Length : %d\n" , contentLength );
23
+ Serial .printf ("OTA size : %d bytes \n" , contentLength );
25
24
26
25
if (contentLength == 0 ) return "There was no content length in the response" ;
27
26
27
+ Serial .printf ("Beginning update..!\n" );
28
28
bool canBegin = Update .begin (contentLength );
29
29
30
30
if (!canBegin ) return "Not enough space to begin OTA" ;
@@ -45,4 +45,4 @@ String startOtaUpdate(const String &url) {
45
45
return "" ;
46
46
}
47
47
48
- #endif
48
+ #endif
You can’t perform that action at this time.
0 commit comments