The real-time clock (RTC) is a hardware clock in the RevPi that stores the date and time independently of the operating system. It serves as time base at system start and as backup when no network connection is available.
When the RevPi boots, it uses the time stored in the RTC as the initial value for the system time. If NTP synchronization is enabled, this time is then corrected automatically.
During operation:
-
NTP time has priority.
-
The RTC serves as a fallback.
Configuring the System Time #
Using the command-line tool timedatectl, you can query and change system time, RTC, and time zone.
▷ Log in to the RevPi via a terminal.
▷ Check the current settings:
timedatectl status
▷ Set the RTC to UTC (recommended):
timedatectl set-local-rtc 0
▷ Set the RTC to local time (not recommended):
timedatectl set-local-rtc 1
▷ Set the system time:
timedatectl set-time "YYYY-MM-DD HH:MM:SS"
Configuring the RTC without NTP Synchronization #
With hwclock, the RTC can be set directly.
▷ Log in to the RevPi via a terminal.
▷ Disable NTP synchronization to set the time manually, otherwise it will be overwritten automatically:
timedatectl set-ntp false
Alternatively, NTP synchronization can be disabled via Cockpit.
▷ Check the RTC:
sudo hwclock
▷ Write the system time to the RTC:
sudo hwclock --systohc
▷ Set the system time from the RTC:
sudo hwclock --hctosys
▷ Set the RTC manually:
sudo hwclock --set --date "dd mmm yyyy HH:MM"
Troubleshooting #
| Problem | Cause | Solution |
|---|---|---|
Time is incorrect after reboot. |
RTC discharged (supercapacitor) or device unpowered for a long time. |
Leave the device powered on for several hours and reboot. |
Time is not corrected automatically. |
NTP synchronization disabled or no network connection. |
Enable NTP: |
Time remains permanently incorrect. |
RTC contains an invalid time or NTP is disabled. |
Set the time manually and store it in the RTC: |
RTC not available. |
RTC not detected or initialization failed. |
Check the RTC: |
Error when accessing the RTC. |
RTC not charged or hardware issue. |
Check system messages: |
Time jumps back to an old date (e.g. 2016). |
Typical behavior when the RTC is discharged. |
Leave the device powered on for several hours. |
RTC reports empty battery (only RevPi Connect 5) or low voltage. |
Battery empty or RTC backup voltage too low. |
You can check via the RTC flags |