switchdoclabs / OurWeatherWeatherPlus

OurWeather Software for WeatherPlus Board - creates (or you rename) a directory called "SDL_ESP8266_WeatherPlus"
http://www.switchdoc.com
20 stars 32 forks source link

Program stalls at handle REST routine #12

Closed MAKA69 closed 5 years ago

MAKA69 commented 6 years ago

8 minutes after booting and connecting to Wifi the software stalls. Actually it gets stuck in the main loop. I use Arduino 1.8.1 and installed v023.

WiFiClient client = server.available(); if (client) { while (!client.available()) { // potential infinite loop delay(1); } if (client.available()) { rest.handle(client); } }

By adding a counter and a break point at the while (!client.available()) loop it runs like a charm.

while (!client.available()) {
   Serial.print(".");    
   delay(1);   
   timeout++;
    if(timeout>1000) {Serial.print("INFINITE LOOP BREAK!");  break;}
}
switchdoclabs commented 6 years ago

Thanks! Incorporated in V024

BP

On Nov 13, 2017, at 9:38 AM, MAKA69 notifications@github.com wrote:

while (!client.available()) { Serial.print(".");
delay(1);
timeout++; if(timeout>1000) {Serial.print("INFINITE LOOP BREAK!"); break;} }