WROOM32 Board RTC drifting

meneldor
Posts: 75
Joined: Mon Dec 25, 2017 7:28 am

WROOM32 Board RTC drifting

Postby meneldor » Thu Mar 08, 2018 6:03 pm

Hi guys,

I have this board https://www.banggood.com/ESP32-Developm ... 09512.html which wakes up every 2 minutes and goes to deep sleep again. Im syncing the time daily using the sntp example but the time is drifting 1 minute every day. Im trying to minimize the network activity to save battery power so dont want to sync it too often. Is there any rtc calibration which im missing in the docs or the only solution is to sync it 2-3 times a day?

meneldor
Posts: 75
Joined: Mon Dec 25, 2017 7:28 am

Re: WROOM32 Board RTC drifting

Postby meneldor » Fri Mar 09, 2018 6:39 am

I forgot to mention that my CPU is downed to 80MHz but im not sure if this affects the RTC.

User avatar
luisonoff
Posts: 40
Joined: Fri Feb 09, 2018 12:20 pm

Re: WROOM32 Board RTC drifting

Postby luisonoff » Fri Mar 09, 2018 7:59 am

I faced same problem some time ago.
This time drift is due to the bad precisión of the internal RTC clock, which is derived from the main clock I believe.
I think you have two options here:
1. Use an external RTC crystal connected to ESP32 at the corresponding pins and configure ESP32 to use this RTC clock
2. Try to calibrate the drift you are seeing, but this has to be done for each unit and at different temperatures... then you should use an external temperature sensor (or also try to calibrate the internal temperature sensor). By calibration I mean: you measure time drift during 24h at X temperature avg, then at the end of the day you always add/remove that time drift from your ESP32 time.

meneldor
Posts: 75
Joined: Mon Dec 25, 2017 7:28 am

Re: WROOM32 Board RTC drifting

Postby meneldor » Fri Mar 09, 2018 8:15 am

Thanks, luisonoff

Point 1) will be hard to implement i think because there is not free space on the board. I will probably try to calibrate it or just sync the time every hour.

Kazuya91
Posts: 27
Joined: Wed Aug 23, 2017 11:33 am

Re: WROOM32 Board RTC drifting

Postby Kazuya91 » Sun Mar 11, 2018 10:29 pm

Damn, i am currently using the Wemos Lolin32 (not the lite version)for a project where it just wakes up once a day. It also has a WROOM32. Is ist also affected by this drift? Can you tell me if you mean +1 minute or -1minute ?

meneldor
Posts: 75
Joined: Mon Dec 25, 2017 7:28 am

Re: WROOM32 Board RTC drifting

Postby meneldor » Mon Mar 12, 2018 5:36 am

Almost +1 minute but i didn't calculate the seconds. This might be just my chip. Now im syncing it hourly and works fine.

Kazuya91
Posts: 27
Joined: Wed Aug 23, 2017 11:33 am

Re: WROOM32 Board RTC drifting

Postby Kazuya91 » Fri Apr 20, 2018 4:37 pm

meneldor wrote:Almost +1 minute but i didn't calculate the seconds. This might be just my chip. Now im syncing it hourly and works fine.
Can you tell me how to activate RTC? I used "make menuconfig" and activated the RTC in the settings. Now I have the message: "still waiting for 32k oscillator to start up"

I have a Wemos Lolin32 which also has a WROOM32. I let him sleep exactly 86400 seconds via esp_deep_sleep_start. 86400 seconds are 24 hours. My ESP was waking up 15 minutes too early. What am I doing wrong?
Last edited by Kazuya91 on Fri Apr 20, 2018 4:44 pm, edited 1 time in total.

User avatar
loboris
Posts: 514
Joined: Wed Dec 21, 2016 7:40 pm

Re: WROOM32 Board RTC drifting

Postby loboris » Fri Apr 20, 2018 4:42 pm

Kazuya91 wrote:Can you tell me how to activate RTC? I used "make menuconfig" and activated the RTC in the settings. Now I have the message: "still waiting for 32k oscillator to start up"
If your board does not have 32.768 crystal, 32 kHz oscilator cannot operate, no use of enabling it in menuconfig.

Kazuya91
Posts: 27
Joined: Wed Aug 23, 2017 11:33 am

Re: WROOM32 Board RTC drifting

Postby Kazuya91 » Fri Apr 20, 2018 4:45 pm

loboris wrote:
Kazuya91 wrote:Can you tell me how to activate RTC? I used "make menuconfig" and activated the RTC in the settings. Now I have the message: "still waiting for 32k oscillator to start up"
If your board does not have 32.768 crystal, 32 kHz oscilator cannot operate, no use of enabling it in menuconfig.
My board is a WEMOS Lolin32. Does it have a 32khz oscilator?

User avatar
loboris
Posts: 514
Joined: Wed Dec 21, 2016 7:40 pm

Re: WROOM32 Board RTC drifting

Postby loboris » Fri Apr 20, 2018 5:00 pm

Kazuya91 wrote:My board is a WEMOS Lolin32. Does it have a 32khz oscilator?
No. Schematics

Who is online

Users browsing this forum: Bing [Bot] and 72 guests