Timer Function won't run after Blynk Functions

Using a Nodemcu, I have the device enter deep-sleep at the end of a Blynk Timer function. Due to this I want the Timer function to run after the BLYNK functions so it can update the virtual pins. However I am running into an issue where the Timer function will not run if I set it to a time long enough for the BLYNK functions to run first.

Using BlynkTimer with deep sleep is a bad idea. The normal rules about keeping the void loop clean, and not using (short) delays don’t apply when you’re using deep sleep.

Personally, I normally put all of the code either in void setup or void loop, which will execute only once.

The exception to this is when you need to retrieve values from the Blynk server, in which case I tend to put most of the code in BLYNK_CONNECTED.

Pete.

1 Like