Page 1 of 1

Raspberry Pi computers have no internal clock. Keep time correct by using a rtc-ds3231 module

Posted: Tue Mar 15, 2022 6:54 pm
by FeodorF

Forum member @Grey posted about the use of a rtc-ds3231.
viewtopic.php?p=27337#p27337
https://www.banggood.com/High-Precision ... mds=search
I ordered two of them for 10€ plus postage.

The 'How-To' list is very short using EasyOS for the Raspberry pi.
Add this to the raspberry pi config.txt file:

# Adds support for a number of i2c real time clock devices
dtoverlay=i2c-rtc,ds3231

Use the console to read the rtc hardware time:
/sbin/hwclock -r

Use the console to make the rtc time your system time:
/sbin/hwclock -s --localtime (This is help full while running on 'Daylight Saving Time'/DST)

This small executable script at /root/Startup named piRTC will copy the rtc time to your system.

#!/bin/sh
/sbin/hwclock -s
--localtime

/sbin/hwclock --help (This will show you a list of all available tools.)

I'm using this rtc while my pi is off line.

Have Fun!

pi4-rtc-2.jpg
pi4-rtc-2.jpg (110.98 KiB) Viewed 585 times

Rem: I have added '--localtime' as well as /sbin for it's location.


Re: Raspberry Pi computers have no internal clock. Keep time correct by using a rtc-ds3231 module

Posted: Wed Mar 16, 2022 3:24 pm
by Misaligned

Thanks for posting this.


Re: Raspberry Pi computers have no internal clock. Keep time correct by using a rtc-ds3231 module

Posted: Mon Apr 18, 2022 9:12 pm
by FeodorF

I have ordered one more RTC-ds3231 module to add it onto my Raspberry Pi 400.
I'll report back on that as soon as it arrives.