- Thu Nov 03, 2016 1:16 pm
#57615
Hi,
I build one of these myself with an ESP-01. I'm powering it with 2 AA rechargeable batteries at 2.6V and WiFi is connected in less than a second. From button-press to http-post less than 3 seconds pass, mostly reliable. Sometimes it cannot connect to wifi in less than 5 seconds and is switching itself off.
However, I have some strange behavior in regards to energy consumption. When I connect the power supply the first time and the device has yet not been started via button press, it consumes 1.7 mA. When pressing the button, it consumes approx. 80 mA till it's finish posting. After that it consumes 15 µA--I put it into deep sleep to avoid wasting energy in case the button is still pressed.
First question: Why is the ESP consuming 1.7 mA although EN is not connected and LOW, respectively? As stated before:
After the first button press all is fine, it consumes less than 15 µA.
Second question: If the button is pressed for a long time (say 10 seconds) and, consequently, powering the ESP-01 longer than it needs to do its http-post,
it won't "wake up" by another button press no matter how long I wait. The code looks like that:
Code: Select allpinMode(2,OUTPUT);
digitalWrite(2,HIGH); // keep ESP active
connectWifi();
postHttp();
digitalWrite(2,LOW); // power off ESP
// sleep forever in case external power is still applied and powering the ESP despite PIN 2.
while (true) {ESP.deepSleep(0, WAKE_RF_DEFAULT);} What am I missing here? I thought that as soon as the external power supply is off, and therefor, EN/CH_PD is LOW, the ESP will power off. However it seems to deep sleep forever.
I searched the datasheet and the SDK document but I'm not sure what it means. Figure 3 (page 28) suggests, that EN/CH_PD is only relevant on startup. However,
OFF: CHIP_PD pin is low. The RTC is disabled. All registers are cleared.
is stated on page 27.
I appreciate any help.
Thanks & best.