LiFePo4 batteries did not help.
I was tearing my hair out over this and went through a process of elimination, it turned out that the plug-in breadboard I was using to wire power sources, the current monitor, and the ESP32 together was the problem somehow. Added resistance or something, even just on the power rail? I would not have expected it but hey, the breadboard only cost about USD $3. Chalking that up to experience. Connecting directly from power sources to the ESP32 board (and keeping the INA219 in the circuit) works.
Testing on a board with no regulator, and the only components are 10K pullup resistors to the enable and program pins. The power draw at the Python prompt is 100mA, more than I expected. Turning on WiFi with the following code bumps this to 120mA!;
Code: Select all
import network
wlan = network.WLAN(network.STA_IF)
Being connected to a WiFi network doesn't cost any extra power after the negotiation has completed.
Entering into deep sleep with the following code showed a draw of 1-1.5mA. Is this typical? I was expecting some micro-amps, are we not going into the deep deep sleep?
Code: Select all
import machine
machine.deepsleep(20000)