Here is a sketch that shows three phases, each 500 ms.
(1) normal power (2) light sleep (3) deep sleep, with the SX1262 running a ReceiveDutyCycle operation during phase 2 and 3. The attached PNGs show current usage recorded by a Nordic PPK II, supplying 4.20V to the battery input of the V3. The second PNG zooms in during light sleep. You can see the baseline current draw is about 5mA, not <1uA.
/*
Power usage monitoring 8/17/2022
*/
#define LED 35
#define TXD 43
#define PHASE_SECS 0.5
#include <RadioLib.h>
SX1262 radio = new Module(8,14,12,13); // for Heltec Wireless Stick Lite V3
void errOut(int code) {
pinMode(LED, OUTPUT);
while (1) {
for (int i = 0; i < code; ++i) {
digitalWrite(LED, HIGH);
delay(250);
digitalWrite(LED, LOW);
delay(250); }
delay(2000); } }
void setup() {
if (radio.begin(923.3f,500.0f,9u,8u,0x12u,17l,32u,1.8f,false) != RADIOLIB_ERR_NONE) errOut(1) ;
}
void loop() {
delay(1000L * PHASE_SECS); // normal-mode execution
pinMode(TXD, OUTPUT);
digitalWrite(TXD, LOW); // set TXD low before turning off other stuff; this actually saves power!
if (radio.startReceiveDutyCycleAuto(0,8) != RADIOLIB_ERR_NONE) errOut(2);
// We want RTC peripherals to stay on
//if (ESP_OK!=esp_sleep_pd_config(ESP_PD_DOMAIN_RTC_PERIPH, ESP_PD_OPTION_ON)) errOut(1);
// try turning them off...........
//if (ESP_OK != esp_sleep_pd_config(ESP_PD_DOMAIN_RTC_PERIPH, ESP_PD_OPTION_OFF)) errOut(2);
//if (ESP_OK != esp_sleep_enable_ext0_wakeup((gpio_num_t)14, HIGH)) errOut(3); // wake on LORA RX
if (esp_sleep_pd_config(ESP_PD_DOMAIN_RTC_PERIPH, ESP_PD_OPTION_OFF) != ESP_OK) errOut(3);
if (esp_sleep_pd_config(ESP_PD_DOMAIN_XTAL, ESP_PD_OPTION_OFF) != ESP_OK) errOut(4);
if (esp_sleep_pd_config(ESP_PD_DOMAIN_CPU, ESP_PD_OPTION_OFF) != ESP_OK) errOut(5);
if (esp_sleep_pd_config(ESP_PD_DOMAIN_RTC8M, ESP_PD_OPTION_OFF) != ESP_OK) errOut(6);
if (esp_sleep_pd_config(ESP_PD_DOMAIN_VDDSDIO, ESP_PD_OPTION_OFF) != ESP_OK) errOut(7);
esp_sleep_enable_timer_wakeup(1000L * 1000L * PHASE_SECS); // value in microsec
esp_light_sleep_start();
// returns to here
if (radio.startReceiveDutyCycleAuto(0,8) != RADIOLIB_ERR_NONE) errOut(2);
esp_sleep_enable_timer_wakeup(1000L * 1000L * PHASE_SECS); // value in microsec
esp_deep_sleep_start();
}