Permanently setting REXYGEN clock
-
I have achieved setting the time easily with DATETIME block by using the block inputs and using the OS clock as output. The problem is this setting doesn't persist over shutting and starting of the device. It goes back to the REXYGEN clock (which is about 4 days late).
I have read the documentation and I tried to sync these two times. Apparently it takes a while but even after further testing with another DATETIME block to sync the REXYGEN clock to the OS clock it doesn't seem to work as intended.
Any suggestions?
-
Hello Ivan,
the root cause of the problem is most probably in incorrect time stored in the RTC chip of your Monarco HAT. Because that's the only place where the system clock can survive a restart.Is your device connected to Internet (can it synchronize time from some NTP server)? What is the output of
sudo timedatectl
Do you perform a safe shutdown or a hard power cycle?
Let me know.
Jaroslav -
@jaroslav_sobota
Hello,The device wont be connected to the internet in its operation and the customer would like to set the time manually.
Here is the output after a fresh restart:
Local time: Sat 2020-03-14 16:26:24 GMT Universal time: Sat 2020-03-14 16:26:24 UTC RTC time: Thu 2020-03-19 10:38:38 Time zone: Europe/London (GMT, +0000) System clock synchronized: no NTP service: active RTC in local TZ: no
Here is the output after I set the time with the Rexygen DATETIME block:
Local time: Thu 2020-03-19 10:30:03 GMT Universal time: Thu 2020-03-19 10:30:03 UTC RTC time: Thu 2020-03-19 10:30:03 Time zone: Europe/London (GMT, +0000) System clock synchronized: no NTP service: active RTC in local TZ: no
It seems that the RTC time is preserved which is neat, its just not offered in the rexygen selection as far as I looked.
-
Hello,
Selecting the
HW clock
seems to fix the problem, I did try this as my first solution because it was obvious to try and get the time from the Real-time circuit, but I could swear it had some issues. Must have been some other mistake I fixed along the way.Anyway, everything works as intended, thanks for the swift support with the command, it proved the time was set correctly just read from the wrong source.