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();
}