I would be very happy to use the WiFi connection to sync the RTC once per hour just before I care about checking the time (to record when a 101 year old clock in a bell tower strikes). I prefer not to use a hardware solution, because even though it's accurate, I would still need to travel and re-set that. I used the cloud editor to create a Thing, assign an Arduino UNO R4 WiFi, then installed the "RTC for reneas_uno" library. Since the RTC is set well enough when the board resets / powers up, it seems to me everything I need to re-sync the RTC is already onboard (without hardware or NTP libraries). But how do I call the functions to retrieve the time and sync the RTC in the main loop? I can't figure it out or find examples!
Just like everything else:
Hi, it's maybe best to go to Examples & use the RTC-NTP sketch (RTC_NTPSync.ino). After spending a couple of days trying to get the correct time stamp in alarm Emails from a Uno R4, I at last found this, & it works!
My project starts up via a time switch (15 minutes each day), so I don't need a back-up 3V battery for the RTC.
(I didn't read the full R4 spec until yesterday. "Oh, so it has an RTC? Cool!" RTFM!).
The other difficuly was creating the 16-character app password for connecting to Gmail SMTP.
Now to put all these bits together in the same package!
Good luck with your project.
aren't the 32khz crystals in clocks pretty accurate. NTP is used to synchorinize clocks but not necessary to maintain their resolution.
so wouldn't an RTC be sufficient for your measurements?
The internal RTC on the UNO R4 / UNO R4 WiFi does not have a 32KHz crystal, it uses an internal oscillator, and it known to be quite inaccurate.
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.