0 votes
asked in Touch Interface by (180 points)
I'm revisiting the weather station color code.  I've checked to make sure the libs and code are new and up to date but I'm getting timeouts on getting/parsing the json response in OpenWeatherForecast.cpp.  Returns "lost in client with a timeout" four times out of five. I've tried upping the timeout value but, of course, it doesn't change the error rate.

Just checking to see if anyone else is seeing this or is this a one off local problem?
commented by (3.9k points)
That timeout code is similar or the same in all clients (Wunderground, Aeris, OpenWeatherMap). As the discussion in https://github.com/ThingPulse/esp8266-weather-station/issues/93 shows lots of factors may contribute to instability. Maybe give the ideas discussed there a try.
commented by (180 points)
Thanks, I'll check it out...
commented by (180 points)
I went back to an old copy of weather-station-color which uses WU and it works fine.  That copy was just built against the current libraries so I assuming the issue lies between the new weather-color code and OpenWeather.

The timeout always occurs at the same point in the "Forecast" json stream within a character or two.   Looks a lot like a blown stack but I'll dig some more...

1 Answer

0 votes
answered by (180 points)
edited by
http.end() needs to be called at the end of doUpdate() in both OpenWeatherMapForecast and Current.

Also had to a delay in following code in OpenWeatherMapForecast.cpp:

  if(httpCode > 0) {


    WiFiClient * client = http.getStreamPtr();

Why, I'm not sure, but it's been running for three days now where before it would not run at all.
commented by (3.9k points)
Thanks for the feedback Carl, much appreciated! Are you willing to put up a PR on GitHub for us to analyze?

Welcome to ThingPulse Q&A, where you can ask questions and receive answers from other members of the community.