Author Topic: Adding a DS3231 Real Time Clock to the Pi  (Read 5 times)

norman

  • Administrator
  • Full Member
  • *****
  • Posts: 148
    • View Profile
Adding a DS3231 Real Time Clock to the Pi
« on: September 11, 2017, 09:18:19 am »
The Pi does not have a RTC as standard but they cost less than 5. 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.

Restart.

Test with -

sudo hwclock -r

Norman
;)
PS Another one to remind me!
« Last Edit: September 11, 2017, 11:08:12 am by norman »