I am interfacing a Raspberry PI4 with RTC DS1307 IC.
The conditions that I checked are mentioned below:
- First install
i2c-detect
library in Pi4 and check whether my RTC interfaces properly or not with cmd:sudo i2c-detect -y 1
- It shows the address of RTC(68)
- Then I will go to
/etc/modules
and in the last line I addedrtc-ds1307
- After this, I reboot the PI, and then I will check for
sudo i2c-detect -y 1
and the address of RTC will changed from '68' to 'UU' - Then I will check for
sudo timedatectl status
command, and it will shows the following output:Local time: Mon 2022-08-01 13:32:14 IST Universal time: Mon 2022-08-01 08:02:14 UTC RTC time: Mon 2022-08-01 08:02:14 Time zone: Asia/Kolkata (IST, +0530) System clock synchronized: yes NTP service: active RTC in local TZ: no
- Now using
sudo hwclock -w
, I wrote the current timing in RTC and usingsudo hwclock -r
I checked the RTC Time and it shows proper timing. - Also in
/boot/config.txt
, I also addeddtoverlay=i2c-rtc,ds1307
to enable RTC, and in/etc/rc.local
I addedsudo hwclock -s
to enable synchronisation of RTC at booting of RPi.
Now my problem is following
When I shutdown my RPi4, and power off the switch for approximately one day, then after restart the RPi without internet, it will gives the delay of 10 to 12 sec. The RTC was running on 32.768 kHz and its battery source was fine. What is the issue for this delay...???
PRETTY_NAME="Raspbian GNU/Linux 10 (buster)" NAME="Raspbian GNU/Linux" VERSION_ID="10" VERSION="10 (buster)" VERSION_CODENAME=buster ID=raspbian ID_LIKE=debian HOME_URL="http://www.raspbian.org/" SUPPORT_URL="http://www.raspbian.org/RaspbianForums" BUG_REPORT_URL="http://www.raspbian.org/RaspbianBugs"
And this RTC was Works fine on Raspberry Pi 3 with same settings and same OS Version.... But on RPi4 it wasn't