Here are some of my experiments and measurements on running micropython on ESP32* devices, including:
- Optimising Micropython Boot Time: Optimising the time to boot Micropython from deepsleep mode and returning to deepsleep.
- ESP32 Wake Stubs: Measuring power consumption and time to boot using the ESP32 Wake Stubs.
- ESPNow vs Wifi Energy Consumption: Measuring the energy consumed to boot Micropython from deepsleep and send a status message to a peer via ESPNow and Wifi.
- ESPNow Power Management Tests: Tests and measurements of the new ESPNOW power management features available in ESP IDF v5.0.2.
Comments, suggestions, criticisms and requests are welcome via the Issues or Discussions tabs above.
NOTE: I was a bit time constrained during these initial measurements, so they are not as systematic, consistent or clearly presented as I would prefer, but there are still some useful conclusions to be drawn, so I thought I'd share this early work.
One big caveat is that most of these initial measurements are made by monitoring the power consumption on the USB power line which will over-estimate power consumed when the devices are powered by battery.
Measuring time to wake ESP32-S3 and ESP32 devices from deepsleep, boot micropython and return to deepsleep:
Wake from deepsleep, boot and return to deepsleep | Time (ms) | Charge (mC) | Energy (microWh) |
---|---|---|---|
Unoptimised (boot to main.py) | 635.1 | 41.9 | 58.3 |
Optimised (boot to frozen _boot.py) | 48.8 | 1.8 | 2.5 |
Optimised boot and send ESPNow Mesage | 119.0 | 7.7 | 10.7 |
Optmised boot and send MQTT message (static IP) | 774.3 | 108.6 | 150.9 |
Optmised boot and send MQTT message (DHCP) | 1626.0 | 204.3 | 283.8 |
ESP32 Wake Stub | 2.8 | 0.044 | 0.06 |