Chat here about code rewrites, mods, etc... with respect to the github project https://github.com/esp8266/Arduino

Moderator: igrr

User avatar
By Niesma
#70610 Hello to the community, I am trying to improve the accuracy of the system deep sleep function. The problem that the esp8266 wakes up prematurely.
Could someone explain to me how this function works internally and the registers that it uses?
Thanks.
User avatar
By andre_teprom
#70641
Niesma wrote:The problem that the esp8266 wakes up prematurely


As said above, some discrepancy is expected at all, since account is performed by an internal timer, but how much it happens ? What is the interval you have defined ? Unless you give more details, this question as posed is somewhat open ended.
User avatar
By Niesma
#70655
andre_teprom wrote:
Niesma wrote:The problem that the esp8266 wakes up prematurely


As said above, some discrepancy is expected at all, since account is performed by an internal timer, but how much it happens ? What is the interval you have defined ? Unless you give more details, this question as posed is somewhat open ended.

The sleep interval will be variable, the possible range will be from 1 minute to 60minute.
I think that: when the esp8266 is in deep sleep mode, the internal time is managed by a counter. The idea would be to compare the incremental value of the counter with an incremental real-time value before sleeping the esp8266. With these values, the counter and the real, would get a factor that would allow me to correct the time.