This is going to become annoying very quickly, and we are probably going to want to disable this, especially when we start working on power consumption. But:
Add an heartbeat loop. This is a simple loop that sleeps for 200ms and generates a warning if it woke up after more than 300ms. (In addition, it blinks a LED. Because.)
Why?
Because blocking the event loop for a significant amount of time is the death of collaborative multi-tasking. This is a really important thing to keep an eye on, at least while we are working on this initial version.
What do we learn from this?
We can see (as we know) that DNS requests are blocking. We can also see random blocking of the event loop outside of that, possibly related to reading sensors from the I2C bus.
What?
This is going to become annoying very quickly, and we are probably going to want to disable this, especially when we start working on power consumption. But:
Add an heartbeat loop. This is a simple loop that sleeps for 200ms and generates a warning if it woke up after more than 300ms. (In addition, it blinks a LED. Because.)
Why?
Because blocking the event loop for a significant amount of time is the death of collaborative multi-tasking. This is a really important thing to keep an eye on, at least while we are working on this initial version.
What do we learn from this?
We can see (as we know) that DNS requests are blocking. We can also see random blocking of the event loop outside of that, possibly related to reading sensors from the I2C bus.