File tree Expand file tree Collapse file tree 1 file changed +10
-3
lines changed
libraries/Update/examples/AWS_S3_OTA_Update Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -31,8 +31,8 @@ bool isValidContentType = false;
3131
3232// Your SSID and PSWD that the chip needs
3333// to connect to
34- char * SSID = " YOUR-SSID" ;
35- char * PSWD = " YOUR-SSID-PSWD" ;
34+ const char * SSID = " YOUR-SSID" ;
35+ const char * PSWD = " YOUR-SSID-PSWD" ;
3636
3737// S3 Bucket Config
3838String host = " bucket-name.s3.ap-south-1.amazonaws.com" ; // Host => bucket-name.s3.region.amazonaws.com
@@ -65,7 +65,14 @@ void execOTA() {
6565 // "Cache-Control: no-cache\r\n" +
6666 // "Connection: close\r\n\r\n");
6767
68- delay (100 );
68+ unsigned long timeout = millis ();
69+ while (client.available () == 0 ) {
70+ if (millis () - timeout > 5000 ) {
71+ Serial.println (" Client Timeout !" );
72+ client.stop ();
73+ return ;
74+ }
75+ }
6976 // Once the response is available,
7077 // check stuff
7178
You can’t perform that action at this time.
0 commit comments