Skip to content
View in the app

A better way to browse. Learn more.

Armbian Community Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Where is the current clock being stored on a RTC-less system

Featured Replies

Hi all, everytime I turn on my Nano Pi it will sync the clock using NTP. When network is not enabled it will rewind the time to something that I still can't comprehend. I found lots of topics about people talking about how to add a RTC to the system, but none talking about the current RTC that is recognized by the kernel. Currently when the system is powered off and on (10 seconds distance) without network the time will rewind between 5 and 15 minutes. I understand that this happens because there is no RTC to write the current clock and battery to keep it. But there is obviously a RTC somewhere because removing power from the device and putting it back will keep a wrong but close time. I didn't leave it a long time off to check what happens yet.

 

[ 4.381725] sun6i-rtc 1f00000.rtc: registered as rtc0

[ 4.381738] sun6i-rtc 1f00000.rtc: RTC enabled

 

My question is: is it possible to sync the time more often so in a restart scenario the clock is "less wrong" ?

  • Author

Thanks for the reply. The device is installed in an place where there are power outages that affect also the network infrastructure, it can take several minutes before it goes back online. I will check if forcing ntp before a reboot makes the clock come back with the same date from the NTP.

A bit of HW details. H3 and most of AW SoCs for that matter have RTC integrated in which can be clocked from internal or external clock. Internal clock is sadly inaccurate, so it's borderline useable for keeping time, but some boards, like NanoPi NEO still omit external clock (price consideration, I guess). So, main issue about RTC to keep time is if it has separate power supply which is still enabled when main power supply is disconnected. On schematic, this is VCC_RTC. As you can see on NanoPi NEO schematic, RTC and main power supply are connected together, so RTC will lost power and with that time every time main power supply is disconnected.

On 6/16/2020 at 2:01 AM, Anderson Lima said:
Armbianmonitor:

Hi all, everytime I turn on my Nano Pi it will sync the clock using NTP. When network is not enabled it will rewind the time to something that I still can't comprehend. I found lots of topics about people talking about how to add a RTC to the system, but none talking about the current RTC that is recognized by the kernel. Currently when the system is powered off and on (10 seconds distance) without network the time will rewind between 5 and 15 minutes. I understand that this happens because there is no RTC to write the current clock and battery to keep it. But there is obviously a RTC somewhere because removing power from the device and putting it back will keep a wrong but close time. I didn't leave it a long time off to check what happens yet.

 

[ 4.381725] sun6i-rtc 1f00000.rtc: registered as rtc0

[ 4.381738] sun6i-rtc 1f00000.rtc: RTC enabled

 

My question is: is it possible to sync the time more often so in a restart scenario the clock is "less wrong" ?

Do a fake-hwclock save as /etc/cron.daily/fake-hwclock at your requested interval. Chrony enables kernel mode (11 minute sync) by default (rtcsync). In a proper restart scenario fake-hwclock should handle stuff properly. (see /etc/fake-hwclock.data)

Edited by xwiggen

  • Author
22 hours ago, jernej said:

A bit of HW details. H3 and most of AW SoCs for that matter have RTC integrated in which can be clocked from internal or external clock. Internal clock is sadly inaccurate, so it's borderline useable for keeping time, but some boards, like NanoPi NEO still omit external clock (price consideration, I guess). So, main issue about RTC to keep time is if it has separate power supply which is still enabled when main power supply is disconnected. On schematic, this is VCC_RTC. As you can see on NanoPi NEO schematic, RTC and main power supply are connected together, so RTC will lost power and with that time every time main power supply is disconnected.

 

Thanks a lot, this was really useful.

 

3 hours ago, xwiggen said:

Do a fake-hwclock save as /etc/cron.daily/fake-hwclock at your requested interval. Chrony enables kernel mode (11 minute sync) by default (rtcsync). In a proper restart scenario fake-hwclock should handle stuff properly. (see /etc/fake-hwclock.data)

Thanks too, I'm trying that.

Guest
This topic is now closed to further replies.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.