Real Time Clock (RTC)

Other than the fact this function is there, I have not found any documentation on it.
I am planning to use the Debian operating system. Does anything need to be done to get RTC to work?

Is there a name and/or size specification for the suitable mating connector for the Real Time Clock?
What battery voltage and capacity is recommended for this function?
I want to try to find a suitable item locally if I can to save a further freight cost and delay.

When I placed my order I don’t recall seeing a Real Time Clock battery as an optional accessory.
Does your web store sell this item?

Thank you

The RTC of RockPi 4 works under Ubuntu and Debian without problems. However, the backup battery for the RTC is an optional accessory, which can easily be ordered from authorized distributors. The battery and its connector are standardized, I used the RockPi 4 RTC batteries also for my NanoPi M4, because they not only fit, but are also cheap in price.


The time is set automatically during system startup, but it is recommended to use NTP to always have a correct time. With only one computer this does not play a big role yet, but with several computers, which access a common server, all clocks should run synchronously.

https://wiki.debian.org/DateTime

I started my RoickPi earlier without a network cable, so you can see that the time the system reads from the rk808-rtc and the NTP time do not differ much.

linaro@rpi4b:~$ cat ~/RTC_Test.txt
Apr  1 07:29:29 rpi4b systemd-networkd[307]: Enumeration completed
Apr  1 07:29:29 rpi4b systemd-udevd[306]: Process '/bin/mount -t fusectl fusectl /sys/fs/fuse/connections' failed with exit code 32.
Apr  1 07:29:29 rpi4b systemd-udevd[312]: link_config: could not get ethtool features for eth0
Apr  1 07:29:29 rpi4b systemd-udevd[312]: Could not set offload features of eth0: Device or resource busy

...

Apr  1 07:29:29 rpi4b kernel: [    2.147461] rk808-rtc rk808-rtc: rtc core: registered rk808-rtc as rtc0
Apr  1 07:29:29 rpi4b kernel: [    2.148519] rk3x-i2c ff3c0000.i2c: Initialized RK3xxx I2C bus at ffffff8009d8e000

...

Apr  1 07:29:34 rpi4b NetworkManager[512]: <info>  [1554096574.5632] device (wlan0): supplicant interface state: ready -> inactive
Apr  1 07:29:35 rpi4b NetworkManager[512]: <info>  [1554096575.7932] device (eth0): state change: ip-config -> unavailable (reason 'carrier-changed') [70 20 40]
Apr  1 07:29:35 rpi4b NetworkManager[512]: <info>  [1554096575.8111] dhcp4 (eth0): canceled DHCP transaction, DHCP client pid 811
Apr  1 07:29:35 rpi4b NetworkManager[512]: <info>  [1554096575.8113] dhcp4 (eth0): state changed unknown -> done
Apr  1 07:29:35 rpi4b NetworkManager[512]: <info>  [1554096575.8170] manager: NetworkManager state is now DISCONNECTED
Apr  1 07:29:35 rpi4b NetworkManager[512]: <info>  [1554096575.8180] manager: startup complete
Apr  1 07:30:12 rpi4b kernel: [   48.834606] rk_gmac-dwmac fe300000.ethernet eth0: Link is Up - 1Gbps/Full - flow control rx/tx
Apr  1 07:30:12 rpi4b systemd-networkd[307]: eth0: Gained carrier
Apr  1 07:30:12 rpi4b NetworkManager[512]: <info>  [1554096612.5482] device (eth0): link connected
Apr  1 07:30:12 rpi4b NetworkManager[512]: <info>  [1554096612.5504] device (eth0): state change: unavailable -> disconnected (reason 'carrier-changed') [20 30 40]
Apr  1 07:30:12 rpi4b NetworkManager[512]: <info>  [1554096612.5541] policy: auto-activating connection 'Wired connection 1'
Apr  1 07:30:12 rpi4b NetworkManager[512]: <info>  [1554096612.5652] device (eth0): Activation: starting connection 'Wired connection 1' (8df30779-657a-3791-b56d-f95556daec0b)
Apr  1 07:30:12 rpi4b NetworkManager[512]: <info>  [1554096612.5700] device (eth0): state change: disconnected -> prepare (reason 'none') [30 40 0]
Apr  1 07:30:12 rpi4b NetworkManager[512]: <info>  [1554096612.5706] manager: NetworkManager state is now CONNECTING
Apr  1 07:30:12 rpi4b NetworkManager[512]: <info>  [1554096612.5723] device (eth0): state change: prepare -> config (reason 'none') [40 50 0]
Apr  1 07:30:12 rpi4b NetworkManager[512]: <info>  [1554096612.5740] device (eth0): state change: config -> ip-config (reason 'none') [50 70 0]
Apr  1 07:30:12 rpi4b NetworkManager[512]: <info>  [1554096612.5755] dhcp4 (eth0): activation: beginning transaction (timeout in 45 seconds)
Apr  1 07:30:12 rpi4b NetworkManager[512]: <info>  [1554096612.5900] dhcp4 (eth0): dhclient started with pid 996
Apr  1 07:30:12 rpi4b dhclient[996]: DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 4
Apr  1 07:30:12 rpi4b dhclient[996]: DHCPREQUEST of 192.168.178.103 on eth0 to 255.255.255.255 port 67
Apr  1 07:30:12 rpi4b dhclient[996]: DHCPOFFER of 192.168.178.103 from 192.168.178.2
Apr  1 07:30:12 rpi4b dhclient[996]: DHCPACK of 192.168.178.103 from 192.168.178.2
Apr  1 07:30:12 rpi4b NetworkManager[512]: <info>  [1554096612.6838] dhcp4 (eth0):   address 192.168.178.103
Apr  1 07:30:12 rpi4b NetworkManager[512]: <info>  [1554096612.6861] dhcp4 (eth0):   plen 24 (255.255.255.0)
Apr  1 07:30:12 rpi4b NetworkManager[512]: <info>  [1554096612.6863] dhcp4 (eth0):   gateway 192.168.178.1
Apr  1 07:30:12 rpi4b NetworkManager[512]: <info>  [1554096612.6864] dhcp4 (eth0):   server identifier 192.168.178.2
Apr  1 07:30:12 rpi4b NetworkManager[512]: <info>  [1554096612.6902] dhcp4 (eth0):   lease time 3600
Apr  1 07:30:12 rpi4b NetworkManager[512]: <info>  [1554096612.6904] dhcp4 (eth0):   hostname 'rpi4b'
Apr  1 07:30:12 rpi4b NetworkManager[512]: <info>  [1554096612.6905] dhcp4 (eth0):   nameserver '192.168.178.2'
Apr  1 07:30:12 rpi4b NetworkManager[512]: <info>  [1554096612.6905] dhcp4 (eth0):   nameserver '192.168.178.85'
Apr  1 07:30:12 rpi4b NetworkManager[512]: <info>  [1554096612.6906] dhcp4 (eth0):   nameserver '192.168.178.10'
Apr  1 07:30:12 rpi4b NetworkManager[512]: <info>  [1554096612.6906] dhcp4 (eth0):   nameserver '192.168.178.1'
Apr  1 07:30:12 rpi4b dhclient[996]: bound to 192.168.178.103 -- renewal in 1706 seconds.
Apr  1 07:30:12 rpi4b NetworkManager[512]: <info>  [1554096612.6907] dhcp4 (eth0):   domain name 'ln.berliner-schnauze.net'
Apr  1 07:30:12 rpi4b NetworkManager[512]: <info>  [1554096612.6907] dhcp (eth0):   domain search 'ln.berliner-schnauze.net.'
Apr  1 07:30:12 rpi4b NetworkManager[512]: <info>  [1554096612.6908] dhcp4 (eth0):   wins '192.168.178.2'
Apr  1 07:30:12 rpi4b NetworkManager[512]: <info>  [1554096612.6909] dhcp4 (eth0): state changed unknown -> bound
Apr  1 07:30:12 rpi4b NetworkManager[512]: <info>  [1554096612.6964] device (eth0): state change: ip-config -> ip-check (reason 'none') [70 80 0]
Apr  1 07:30:12 rpi4b systemd-timesyncd[389]: Network configuration changed, trying to establish connection.
Apr  1 07:30:12 rpi4b dbus[488]: [system] Activating via systemd: service name='org.freedesktop.nm_dispatcher' unit='dbus-org.freedesktop.nm-dispatcher.service'
Apr  1 07:30:12 rpi4b NetworkManager[512]: <info>  [1554096612.7015] device (eth0): state change: ip-check -> secondaries (reason 'none') [80 90 0]
Apr  1 07:30:12 rpi4b NetworkManager[512]: <info>  [1554096612.7067] device (eth0): state change: secondaries -> activated (reason 'none') [90 100 0]
Apr  1 07:30:12 rpi4b NetworkManager[512]: <info>  [1554096612.7073] manager: NetworkManager state is now CONNECTED_LOCAL
Apr  1 07:30:12 rpi4b NetworkManager[512]: <info>  [1554096612.7122] manager: NetworkManager state is now CONNECTED_GLOBAL
Apr  1 07:30:12 rpi4b NetworkManager[512]: <info>  [1554096612.7127] policy: set 'Wired connection 1' (eth0) as default for IPv4 routing and DNS
Apr  1 07:30:12 rpi4b NetworkManager[512]: <info>  [1554096612.7210] dns-mgr: Writing DNS information to /sbin/resolvconf
Apr  1 07:30:12 rpi4b dbus[488]: [system] Successfully activated service 'org.freedesktop.nm_dispatcher'
Apr  1 07:30:12 rpi4b nm-dispatcher: req:1 'connectivity-change': new request (1 scripts)
Apr  1 07:30:12 rpi4b nm-dispatcher: req:1 'connectivity-change': start running ordered scripts...
Apr  1 07:30:13 rpi4b systemd[760]: Time has been changed
Apr  1 07:30:13 rpi4b systemd[809]: Time has been changed
Apr  1 07:30:13 rpi4b systemd-timesyncd[389]: Synchronized to time server 212.18.3.18:123 (0.debian.pool.ntp.org).
Apr  1 07:30:13 rpi4b NetworkManager[512]: <info>  [1554096613.7125] device (eth0): Activation: successful, device activated.
Apr  1 07:30:13 rpi4b nm-dispatcher: req:2 'up' [eth0]: new request (1 scripts)
Apr  1 07:30:13 rpi4b nm-dispatcher: req:2 'up' [eth0]: start running ordered scripts...
Apr  1 07:30:15 rpi4b systemd-networkd[307]: eth0: Gained IPv6LL
Apr  1 07:30:15 rpi4b NetworkManager[512]: <info>  [1554096615.6738] policy: set 'Wired connection 1' (eth0) as default for IPv6 routing and DNS
Apr  1 07:30:15 rpi4b NetworkManager[512]: <info>  [1554096615.6775] dns-mgr: Writing DNS information to /sbin/resolvconf
Apr  1 07:30:24 rpi4b ntpdate[1054]: adjust time server 85.114.128.137 offset -0.002039 sec
linaro@rpi4b:~$

It’s listed here:

https://shop.allnetchina.cn/collections/rock-pi-4-accessories/products/rtc-battery-for-rock-pi-4

RTC should work out of box. Just plugin the battery.

Thank you for your replies.

Do you know if there is a name/size of the socket and the battery voltage/current capacity so that I could make one in Australia?

Thank you

The connector on board is xh1.25, the battery is CR2032 and voltage is 3V. It’s pretty common and used in laptops such as Ideapad.

Thanks Jack. I will see what I can find.

https://www.ebay.com.au/sch/i.html?_osacat=0&_odkw=RTC+Backup+Battery+xh1.25+CR2032+AUD&_from=R40&_trksid=m570.l1313&_nkw=RTC+Backup+Battery+xh1.25+CR2032+&_sacat=0