Dynamic BlynkProvisioning with Ultra Low Power in ESP32

Hello, does anybody have any idea of how to implement Blynk Dynamic Provisioning along with ULP (ultra low power, also known as Deep Sleep) on ESP32? The idea is to drastically lower battery consumption by having the ESP32 go into deep sleep for the major part of the time and wake up just to read some measurements and send them to the Blynk app. I’m using Blynk Dynamic Provisioning because my idea is to launch my product to the market and have hopefully lots of customers ; ) . The thing is that I’ve seen that BlynkProvisioning.run() needs to be inside “void loop()” or inside an infinite loop in “void setup()”, in either case, I can’t figure out how to get to the esp_deep_sleep_start() function because it has to be out of the loop in which BlynkProvisioning.run() is, for if I include the esp_deep_sleep_start() function in the loop, BlynkProvisioning.run() stops working and in the app I get a disconnect message. Any high level of detailed ideas will be much appreciated !

Wemos TTGO ESP32 WiFi Bluetooth 18650 Battery 0.96 inch OLED
Arduino IDE 1.8.7
iPhone iOS 12
Blynk Server

Not sure if I understand you question but I suppose you can call esp_deep_sleep_start(); after provisioning and doing your tasks, for example:

blynkprovisiong.run();

If ( all good && read the sensor) esp_deep_sleep_start();

And you will always get this message because when ESP32 is in deep sleep the WiFi will be off.

I’m not sure but a workaround would be to change your heartbeat = sleep time

1 Like

Sorry for the delay. Idb, you’re right, I was not very clear ; ) The problem was that I was trying to use use BlynkProvisioning.run() and esp_deep_sleep_start() inside the same loop. I solved the problem by using a BlynkProvisioning.run() inside the loop, as I should, and setting up a timer outside the loop to call a function in which I call esp_deep_sleep_start(), it worked. Thanks for taking the time to read my question. Cheers,

1 Like

Hello can you share the code?