I'm working on a project where an RTC (DS3231) is needed since the RPi will not have continuous access to the internet. I've been able to set the clock on time and keep it but I've observed that a delay in time appears when I reboot the system. Around 1 second each 5 reboots.
I've tried to set the clock both with the rc.local method and the overlays method (I'm running Jessie), and none of them solve this delay on reboot issue.
Any idea about why this could happen? It is not a problem with my clock as I've checked two differents DS-3231.
EDIT. What I've tried until now:
- First Method
-Including rtc-ds1307
in /etc/modules (It doesn't with "rtc-ds3231", so I use ds1307 driver instead)
-Including in /etc/rc.local:
echo ds1307 0x68 > /sys/class/i2c-adapter/i2c-1/new_device
hwclock -s
- Second Method (recommended for Jessie)
-Including dtoverlay=i2c-rtc,ds3231
at the end of /boot/config.txt
-Commenting out the following lines in /lib/udev/hwclock-set:
#if [ -e /run/systemd/system ] ; then
# exit 0
#fi
How I set up and read time
sudo date -s "01 AUG 2017 1:00:00"
sudo hwclock -w
sudo hwclock -r; sudo date