develop-cr
Posts: 7
Joined: Tue May 22, 2018 2:50 pm

RTC module not working ds1307

Wed Oct 17, 2018 6:31 am

https://learn.adafruit.com/adding-a-rea ... i/overview I did it successfully according to the guide on the line. If I turn it off and open it in 10 minutes, the clock is right. But if it stays closed for more than 10 minutes, it doesn't show the correct time.How do I solve my problem? my operating system, stretch.

gordon77
Posts: 3401
Joined: Sun Aug 05, 2012 3:12 pm

Re: RTC module not working ds1307

Wed Oct 17, 2018 3:12 pm

Here's what I did with my ds1307, l found it on this forum somewhere.

add dtoverlay=i2c-rtc,ds1307 to /boot/config.txt

in /lib/udev/hwclock-set put # in front of these lines
if [-e /run/systemd/system ]; then
exit
fi

and # in front of the 2 lines containing --systz

reboot your pi

set the clock with sudo date -s "16 Oct 2018 17:12:00" using the correct date and time
sudo hwclock -w
sudo hwclock -r

develop-cr
Posts: 7
Joined: Tue May 22, 2018 2:50 pm

Re: RTC module not working ds1307

Thu Oct 18, 2018 12:46 pm

Gordon, thank you for the answer. but my problem is not solved.

User avatar
DougieLawson
Posts: 34097
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website

Re: RTC module not working ds1307

Thu Oct 18, 2018 4:48 pm

Do you get any messages from the kernel?

Code: Select all

[   42.133300] rtc-ds1307 1-0068: registered as rtc0
Microprocessor, Raspberry Pi & Arduino Hacker
Mainframe database troubleshooter
MQTT Evangelist
Twitter: @DougieLawson

2012-18: 1B*5, 2B*2, B+, A+, Z, ZW, 3Bs*3, 3B+

Any DMs sent on Twitter will be answered next month.

develop-cr
Posts: 7
Joined: Tue May 22, 2018 2:50 pm

Re: RTC module not working ds1307

Fri Oct 19, 2018 5:42 am

DougieLawson wrote:
Thu Oct 18, 2018 4:48 pm
Do you get any messages from the kernel?

Code: Select all

[   42.133300] rtc-ds1307 1-0068: registered as rtc0
no, there's no kernel message like that.

User avatar
DougieLawson
Posts: 34097
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website

Re: RTC module not working ds1307

Fri Oct 19, 2018 5:35 pm

Then your hardware is either broken or not connected correctly.
Microprocessor, Raspberry Pi & Arduino Hacker
Mainframe database troubleshooter
MQTT Evangelist
Twitter: @DougieLawson

2012-18: 1B*5, 2B*2, B+, A+, Z, ZW, 3Bs*3, 3B+

Any DMs sent on Twitter will be answered next month.

Return to “Raspbian”