Moderator: igrr
AcmeUK wrote:It means that those of us that are developing battery powered sensors can put the esp8266 into minimal power mode between measurement & reporting cycles. For example I only want to check soil moisture levels once per hour.
Hi AcmeUK,
I would love to see an example if you get time of a sketch using the A>D to sample water moisture, upload data periodically and alert if level falls bellow specific level. Using deep sleep mode and MQTT. Have some nice house plants that would benefit from this.
Keep up the super work.
Dans
tavalin wrote:I'm aware of low power modes and battery sensors, I'm currently using an Arduino Pro Mini with an RFM69 in a sensor. My question is specifically that when using deep sleep on my ESP-01, on wake up it seems to reset the sketch rather than resume where it went to sleep. I wanted to know if this is expected behaviour or not.
You're right, it does indeed reset every time it wakes up.
I inserted a counter, and it gets reset every time at wake.
When you set the baud rate to 74880, you can read the startup message.
When it wakes up from deep sleep, the message says: 'rst cause:2, boot mode:(3,7)'
A normal power on reset yields: 'rst cause:1, boot mode:(3,0) '
I guess that this behavior is wanted. It seems that the software has to save it's state to the rtc RAM, then go into deep sleep. At startup, it has to check the reset cause (I guess that's stored anywhere) and react accordingly.
Meaning, not doing a full setup, but initialize only what's necessary , and restore it's state from the rtc RAM.
That's not really that useful, If you need really low power, you're maybe better off using an external rtc with wake function, and power off the ESP completely during sleep.