Does ESP32 development board have inbuilt RTC ? If yes, are there any tutorials which teach how to use it?
Yes, the ESP32 has buitl-in RTC.
However, we don’t have any project about that particular subject.
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.
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.
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.