• Skip to main content
  • Skip to primary sidebar

RNTLab.com

The Ultimate Shortcut to Learn Electronics and Programming with Open Source Hardware and Software

  • Courses
  • Forum
    • Forum
    • Ask Question
  • Shop
  • Account
  • Blog
  • Login

RTC on ESP32

Q&A Forum › Category: ESP32 › RTC on ESP32
0 Vote Up Vote Down
Rashmi Mahadevaiah asked 5 years ago

Does ESP32 development board have inbuilt RTC ? If yes, are there any tutorials which teach how to use it?

5 Answers
0 Vote Up Vote Down
Sara Santos Staff answered 5 years ago

Hi.
Yes, the ESP32 has buitl-in RTC.
However, we don’t have any project about that particular subject.
Regards,
Sara

2 Vote Up Vote Down
Jean Pierre Daviau answered 5 years ago

It seems RTC_DATA_ATTR uint8_t newLinesCnt = 0;      newLinesCnt  value will survive through out light_sleep but not deep sleep.
I did it.
For text it is a bit more complex.  See the docs.

1 Vote Up Vote Down
Ron Brinkman answered 5 years ago

In the project https://randomnerdtutorials.com/esp32-date-time-ntp-client-server-arduino/ A Lee states, and Sara seems to agree, that a time update is gotten from the NTP server only once to set the internal RTC, then the RTC takes over and satisfies future time requests.  I’m not convinced that is the case.  Despite WiFi being turned off, access to the NTP server seems to continue to be available.  If I omit the call to getLocalTime(&timeinfo) after the first pass, the

Serial.println(&timeinfo, "%A, %B %d %Y %H:%M:%S");

result doesn't change each time it is invoked.

 
 

1 Vote Up Vote Down
Steve Mercer answered 5 years ago

I not sure what you are trying to say here. getLocalTime uses mills() which does not use WiFi at all. You can see it in the ESP32 core file esp32-hal-time.c.
 
time.h is a standard C time library. The ESP32 SDK makes it work with the built in RTC.
 
Note that the ESP32 RTC is not very accurate (Can gain/lose minutes per day). For more accuracy use an external RTC with its own crystal.

0 Vote Up Vote Down
Sara Santos Staff answered 5 years ago

Hi Ron, take a look at Steve’s answer.
Regards,
Sara
Thanks for answering, Steve.
 

Primary Sidebar

Login to Ask or Answer Questions

This Forum is private and it’s only available for members enrolled in our Courses.

Login »

Latest Course Updates

  • [eBook Updated] Learn Raspberry Pi Pico/Pico W with MicroPython eBook – Version 1.2 May 26, 2025
  • [New Edition] Build ESP32-CAM Projects eBook – 2nd Edition April 16, 2025

You must be logged in to view this content.

Contact Support - Refunds - Privacy - Terms - MakerAdvisor.com - Member Login

Copyright © 2013-2025 · RandomNerdTutorials.com · All Rights Reserved

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.