Skip to content

How to Make a Script/Task to Set RTC Regularly? #892

Answered by tvoverbeek
AlexLandherr asked this question in Q&A
Discussion options

You must be logged in to vote

I am assuming you set the Linux system time from the GNSS HAT.
Linux internal system time is in UTC.
Just run e.g. a 24h cron job which copies the system time to the RTC: sudo hwclock --systohc
You might have to also use the --rtc option if your GNSS HAT also has a /dev/rtcx
Of course the device driver for the PiJuice RTC has to be loaded.
See man hwclock for more details.
Do not expect microsecond precision from the PiJuice RTC.

Replies: 2 comments 7 replies

Comment options

You must be logged in to vote
7 replies
@tvoverbeek
Comment options

@AlexLandherr
Comment options

@tvoverbeek
Comment options

@AlexLandherr
Comment options

@ArjenR49
Comment options

Answer selected by AlexLandherr
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants