Bingo! Scored it. Captured below is a single transmission using the Adafruit TPL5110 to power up a Wemos D1 Mini ESP8266 from essentially nothing (43na) and then return to essentially nothing (43na) afterward. So, this screenshot captures the entire process for an ESP8266 that's in ESP-NOW mode.
Here is the sketch that I used:
/****************************************************************************************************************************************************
* TITLE: ESP-NOW Getting Started Examples
*
* By Frenoy Osburn
* YouTube Video: https://youtu.be/_cNAsTB5JpM
****************************************************************************************************************************************************/
/********************************************************************************************************************
* Please make sure that you install the board support package for the ESP8266 boards.
* You will need to add the following URL to your Arduino preferences.
* Boards Manager URL: http://arduino.esp8266.com/stable/package_esp8266com_index.json
********************************************************************************************************************/
/********************************************************************************************************************
* Board Settings:
* Board: "WeMos D1 R1 or Mini"
* Upload Speed: "921600"
* CPU Frequency: "80MHz"
* Flash Size: "4MB (FS:@MB OTA:~1019KB)"
* Debug Port: "Disabled"
* Debug Level: "None"
* VTables: "Flash"
* IwIP Variant: "v2 Lower Memory"
* Exception: "Legacy (new can return nullptr)"
* Erase Flash: "Only Sketch"
* SSL Support: "All SSL ciphers (most compatible)"
* COM Port: Depends *On Your System*
*********************************************************************************************************************/
#include<ESP8266WiFi.h>
#include<espnow.h>
#define MY_NAME "CONTROLLER_NODE"
#define MY_ROLE ESP_NOW_ROLE_CONTROLLER // set the role of this device: CONTROLLER, SLAVE, COMBO
#define RECEIVER_ROLE ESP_NOW_ROLE_SLAVE // set the role of the receiver
#define WIFI_CHANNEL 1
uint8_t receiverAddress[] = {0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF}; // please update this with the MAC address of the receiver
struct __attribute__((packed)) dataPacket {
int sensor1;
int sensor2;
float sensor3;
};
void transmissionComplete(uint8_t *receiver_mac, uint8_t transmissionStatus) {
if(transmissionStatus == 0) {
//Serial.println("Data sent successfully");
digitalWrite(14,HIGH);
} else {
//Serial.print("Error code: ");
//Serial.println(transmissionStatus);
}
}
dataPacket packet;
void setup() {
pinMode(14,OUTPUT);
digitalWrite(14,LOW);
//Serial.begin(115200); // initialize serial port
//Serial.println();
//Serial.println();
//Serial.println();
//Serial.print("Initializing...");
//Serial.println(MY_NAME);
//Serial.print("My MAC address is: ");
//Serial.println(WiFi.macAddress());
WiFi.mode(WIFI_STA);
WiFi.disconnect(); // we do not want to connect to a WiFi network
if(esp_now_init() != 0) {
//Serial.println("ESP-NOW initialization failed");
return;
}
esp_now_set_self_role(MY_ROLE);
esp_now_register_send_cb(transmissionComplete); // this function will get called once all data is sent
esp_now_add_peer(receiverAddress, RECEIVER_ROLE, WIFI_CHANNEL, NULL, 0);
packet.sensor1 = 123;
//Serial.println("Initialized.");
}
void loop() {
packet.sensor1++;
packet.sensor2 = 456;
packet.sensor3 = 3.14;
esp_now_send(receiverAddress, (uint8_t *) &packet, sizeof(packet));
delay(1000);
}
It is only slightly modified from the original. Essentially I commented-out all of the code relating to print statements, because that would drag out the time and is superfluous for present purposes, and I set GPIO14 to high as the "DONE" signal after the packet was finished sending and the related callback function was called, which instructed the TPL5110 to cut the power.
So, I finally have the data now to do the necessary battery calculation. Crunching the numbers, assuming a single transmission like this every 5 minutes, the batteries would last almost 19 years. That is just a pure packet transmission with no acknowledgement. Still, it is much better than what I had been expecting based on what others have reported.
It might be that this could be improved upon by removing the ESP8266 from its Wemos D1 Mini PCB, as the PCB contains components which may be soaking up power and simply aren't needed. Also, looking at the current graph, it looks as though maybe it's listening after the main transmission? Maybe someone knowledgeable about ESP-NOW can comment. Lastly, I'm not sure what datarate ESP-NOW defaults to. Maybe it would be possible to have it transmit faster and thereby use less current. So, lots to look into if anyone here has the interest.
Anyhow, I think that this proves the concept. Who knew? All this time the ESP8266 had been type-cast as impossibly power hungry. I guess the main downside is that anything in addition that one might do, such as measuring the battery voltage or doing an TH measurement, as examples, will be done at a fairly high current burnrate. Offsetting that might (?) be the prospect of getting it done sooner.
The real question, though, is whether it makes sense to do a similar measurement on an ESP32, and, if so, which one? Any chance it would be better? Or would it likely be worse?