Closed dogmatic69 closed 5 years ago
Paging @kalj for a little review :)
Looks fine. I'm a little confused by the concurrency execution model of the ESP8266. Apparently things can get problematic if you spin too tightly in loop since you need to explicitly defer execution for background things to get done, typically by calling yield()
. However, it also seems like the main.cpp
for ESP8266 defers implicitly during each iteration of loop()
(https://www.esp8266.com/viewtopic.php?p=59073#p59073), so perhaps it is fine like this. Let's keep this in the back of our heads if something goes bad later. :)
As noted in this comment, there should be a delay in the client.loop calls. As the sparsnas seems to only publish every 15 seconds a 2.5 second delay should be sufficient whilst leaving plenty free cycles to do other stuff.
This will fix the issue in #30