Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Small improvements in update example
- 100ms is too low to get server response
  • Loading branch information
copercini authored Aug 1, 2017
commit e1010a27b3e507f3b7ac5e237f2659bea6464dae
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ bool isValidContentType = false;

// Your SSID and PSWD that the chip needs
// to connect to
char* SSID = "YOUR-SSID";
char* PSWD = "YOUR-SSID-PSWD";
const char* SSID = "YOUR-SSID";
const char* PSWD = "YOUR-SSID-PSWD";

// S3 Bucket Config
String host = "bucket-name.s3.ap-south-1.amazonaws.com"; // Host => bucket-name.s3.region.amazonaws.com
Expand Down Expand Up @@ -65,7 +65,14 @@ void execOTA() {
// "Cache-Control: no-cache\r\n" +
// "Connection: close\r\n\r\n");

delay(100);
unsigned long timeout = millis();
while (client.available() == 0) {
if (millis() - timeout > 5000) {
Serial.println("Client Timeout !");
client.stop();
return;
}
}
// Once the response is available,
// check stuff

Expand Down