electronicsguy / ESP8266

ESP8266 Projects
242 stars 183 forks source link

Timeout for GET request #98

Open PyreDev opened 3 years ago

PyreDev commented 3 years ago

Hello,

Thanks for this useful librairy. I'm trying to the buildin led blinking during a GET request, to then also add a timeout there. It is used with a google script web app to add some data in a spreadsheet.

I tried the following but it's not working, the code seems totally stopped until the GET request is finished :

client->GET(urltest2, host);
while (!client->available()) {
  for (byte i = 0; i <= 2; i++) {
    delay(50);
    digitalWrite(LED_BUILTIN, LOW);
    delay(50);
    digitalWrite(LED_BUILTIN, HIGH);
  }
}

With that code the GET request is properly sending to google sheet and I have my data updated but the LED never blinks.

I also have tried with :

while (!client->GET(urltest2, host)) {
  for (byte i = 0; i <= 2; i++) {
    delay(50);
    digitalWrite(LED_BUILTIN, LOW);
    delay(50);
    digitalWrite(LED_BUILTIN, HIGH);
  }
}

But the result is the same.

Does someone have a solution or could explain me where I'm wrong ?

regards,

github-actions[bot] commented 3 years ago

Welcome to HTTPSRedirect! Please provide enough info to debug the issue.