Raspberry Pi > Raspberry Pi

Adding a DS3231 Real Time Clock to the Pi

(1/1)

norman:
The Pi does not have a RTC as standard but they cost less than 5 pounds. Fitting and setup is easy but it would have been even easier if it came with instructions!

Add the i2c interface in RASPI-CONFIG

Add the following line in /boot/config.txt using Nano -

dtoverlay=i2c-rtc,ds3231

So sudo nano /boot/config.txt

CTRL O then CTRL X to finish.

Then -

sudo nano /lib/udev/hwclock-set

Alter -

if [-e /run/systemd/system];
then
exit 0
fi

to

#if [-e /run/systemd/system];
#then
#exit 0
#fi

Power down. Fit the RTC. A diagram of where to fit it would have been nice. https://www.zipzap.co.uk/images/rtc.jpg

Restart.

Test with -

sudo hwclock -r

Norman
;)
PS Another one to remind me!

Navigation

[0] Message Index

Go to full version