ESP32 DeepSleep problem + BME280

There are some potential problems when you use Blynk.begin with deepsleep.
Because Blynk.begin is a blocking function, if your device can’t connect to WiFi or the Blynk server, code processing will stop at Blynk.begin and your battery will be drained.

A better approach is to use Blunk.config and Blynk.connect.

Also, it doesn’t really matter where you put your code when you are using deepsleep, but this approach works well.
I don’t like using timers with deepsleep because you don’t want to loop until a timer kicks-in, you just want to run through one set of commands and then go to sleep, and you want this to happen as quickly as possible so that your wake time is as low as possible.
Take a look at this example…

Pete.

2 Likes