How to know if I got "naturaly" off deep sleep
Posted: Wed Oct 07, 2015 8:12 am
Hi,
In the init functions, I want to know if the ESP has waken up naturaly after its deep sleep mode, or it has been triggered by user in the middle of the "night".
Maybe one path would be to follow the timestamp given by tmr.now() : if the new value is around the expected dsleep length, I would be in normal mode ; if the difference is less than that, then I would be in the user triggered case.
BUT, the simetamp is a int31 in uS, so it is looping every 30', then I cannot use that timer for my reset frequency witch is arount few hours.
In the init functions, I want to know if the ESP has waken up naturaly after its deep sleep mode, or it has been triggered by user in the middle of the "night".
Maybe one path would be to follow the timestamp given by tmr.now() : if the new value is around the expected dsleep length, I would be in normal mode ; if the difference is less than that, then I would be in the user triggered case.
BUT, the simetamp is a int31 in uS, so it is looping every 30', then I cannot use that timer for my reset frequency witch is arount few hours.