ESP-12 RTC Accuracy

All ESP8266 boards running MicroPython.
Official boards are the Adafruit Huzzah and Feather boards.
Target audience: MicroPython users with an ESP8266 board.
Post Reply
User avatar
devnull
Posts: 142
Joined: Sat Jan 07, 2017 1:52 am
Location: Singapore / Cornwall
Contact:

ESP-12 RTC Accuracy

Post by devnull » Mon Mar 13, 2017 11:42 pm

I am using the in-built RTC on the 8266 to deepsleep for an hour, but it seems to be highly inaccurate, although it's repeatability seems to be OK.

Code: Select all

    secs = 3600
    rtc = mc.RTC()
    rtc.irq(trigger=rtc.ALARM0, wake=mc.DEEPSLEEP)
    rtc.alarm(rtc.ALARM0, (secs*1000))
In sleeping for 1 hour, it wakes up on average 108 seconds early, this seems to be a huge error and of course in 1 day this would be roughly 43 minutes a day assuming that the error is cumulative.

Can the clock be so inaccurate ??

Other than adding a multiplication factor into the sleep time code, is there away to calibrate / adjust the rtc ?

filipmar.mf
Posts: 3
Joined: Thu Jul 28, 2016 3:21 pm

Re: ESP-12 RTC Accuracy

Post by filipmar.mf » Tue Mar 14, 2017 8:54 am

I have the same observation. My "hour" has 57.5 min with amazing second precise repeatabilty with small minute variation time to time. Very strange behavior :?

User avatar
pythoncoder
Posts: 1962
Joined: Fri Jul 18, 2014 8:01 am

Re: ESP-12 RTC Accuracy

Post by pythoncoder » Tue Mar 14, 2017 10:27 am

Peter Hinch

User avatar
devnull
Posts: 142
Joined: Sat Jan 07, 2017 1:52 am
Location: Singapore / Cornwall
Contact:

Re: ESP-12 RTC Accuracy

Post by devnull » Tue Mar 14, 2017 1:56 pm

Peter - thanks, but after reading through that it appears that the issue was fixed ??

https://github.com/micropython/micropython/pull/2726

User avatar
pythoncoder
Posts: 1962
Joined: Fri Jul 18, 2014 8:01 am

Re: ESP-12 RTC Accuracy

Post by pythoncoder » Wed Mar 15, 2017 9:10 am

You haven't followed the chain to its end ;) See https://github.com/micropython/micropython/pull/2728. It has not yet been reviewed and accepted.
Peter Hinch

User avatar
devnull
Posts: 142
Joined: Sat Jan 07, 2017 1:52 am
Location: Singapore / Cornwall
Contact:

Re: ESP-12 RTC Accuracy

Post by devnull » Fri Mar 17, 2017 12:16 pm

Does not look like this is going to happen, 2728 has been closed / terminated, what a shame.

:(

User avatar
pythoncoder
Posts: 1962
Joined: Fri Jul 18, 2014 8:01 am

Re: ESP-12 RTC Accuracy

Post by pythoncoder » Fri Mar 17, 2017 3:55 pm

You can always fetch the PR and build it yourself. But it would be good to see it reviewed and merged.
Peter Hinch

Post Reply