0 votes
in Touch Interface by (170 points)
I've gotten WeatherStation Color to run on ESP8266 library version 3.0.2, with no compiler complaints.  I updated the code to use LittleFS.  Everything appears to work.  I have some timing issue with forecasts.  Without change, I was not getting forecasts.  If I insert a delay(1) in OpenWeatherMapForecast::value it works.  I really don't understand this, but while I was debugging I inserted some Serial.println() statements to see what was happening.  It started working.  So I backed out the print and inserted the delay, and found I could get it down to delay(1) and still work.  This is clearly a hack but it works.  All 4 screens appear to work and have good data.  I may be able to manage a pull request if you want it.  Or I can describe what I did.
by (17.8k points)
On the single-core ESP8266 application code shares CPU resources with the SDK. This requires that application yields control back to SDK from time to time. This is to ensure that e.g. the WiFi stack does not starve. Besides delay(1) you could also use yield(). This is what we do here https://github.com/ThingPulse/esp8266-weather-station/blob/master/src/OpenWeatherMapForecast.cpp#L82 for instance.

Please log in or register to answer this question.

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