ESP32 BLE power consumption

I was quickly able to get an ESP32 connected to a simple app using the code below, which is great.

However, power consumption is sky high (ESP module gets warm to the touch) making it functionally useless for my application. Are there any tricks to bring power consumption down to a reasonable level for battery operation? If not now, might this be implemented at some point in the future?

Thanks.


#define BLYNK_PRINT Serial

#define BLYNK_USE_DIRECT_CONNECT

#include <BlynkSimpleEsp32_BLE.h>
#include <BLEDevice.h>
#include <BLEServer.h>

// You should get Auth Token in the Blynk App.
// Go to the Project Settings (nut icon).
char auth[] = "xxxxx";

void setup()
{
  // Debug console
  Serial.begin(9600);

  Serial.println("Waiting for connections...");

  Blynk.setDeviceName("Blynk");

  Blynk.begin(auth);
}

byte n;

BLYNK_WRITE_DEFAULT()
{
  int pin = request.pin;      // Which pin is handled?
  int value = param.asInt();
  
  switch (pin)
  {
    case 1:
      n++;
      Blynk.virtualWrite(2, n);
  }
}
void loop()
{
  Blynk.run();
}

This is NOT a Blynk related issue, rather it is the normal operating mode for a high powered, BLE/WiFi enabled and constantly communicating MCU.

Google (and search here) for ESP32 sleep mode options… No, sleep is not ideal for use with Blynk’s BLE option, but it either runs hot and draws current as normal, or sleeps and briefly wakes intermittently as needed (Usualy with WiFi, but probably possible with BLE??.. As said, Google for more info on this)

Ok thanks for the tips. From further research it seems low power and Bluetooth aren’t possible at the same time because the WDT oscillator that runs in sleep mode isn’t accurate enough to maintain the Bluetooth connection. One solution seems to be possible with an external 32kHz crystal, but I think I’ll investigate using an nRF52x device before I consider this.