RTC real time clock for the Pi

Moderators: adafruit_support_bill, adafruit

Forum rules
Talk about Adafruit Raspberry Pi® accessories! Please do not ask for Linux support, this is for Adafruit products only! For Raspberry Pi help please visit: http://www.raspberrypi.org/phpBB3/
Locked
pennypacker
 
Posts: 4
Joined: Sat Oct 06, 2012 4:15 am

RTC real time clock for the Pi

Post by pennypacker »

I am trying to install the RTC module for the raspberry pi.

I think I have followed the instruction from adafruit correctly. I left off both resistors. Then, I hooked it up according to the pinout instructions and when I first booted, I was able to get the 68 in the little table by running i2cdetect to show that the system was recognizing it. However, by the time I went through the rest of the instructions, it was already not working, the system said something about not being able to access the hardware clock. so I ran i2cdetect again and it was not showing up. I tried rebooting, and saw it there again for a moment, then ran it again and it was gone. I have unhooked and rehooked everything into the gpio pins of the rapi with no luck. Now I can't get i2cdetect to recognize it at all. I am using the 5v pin on the rpi as I think the instructions say to do that (they are a little fuzzy in some places).

Any ideas? Has anyone had any trouble with these failing?

User avatar
mrzhi
 
Posts: 4
Joined: Wed Sep 05, 2012 2:24 pm

Re: RTC real time clock for the Pi

Post by mrzhi »

I used the adafruit breakout for DS1307 with great success on my Pi. I also have the GPIO breakout board for the Pi as well, so that made it a lot more clear when connecting the pins. Honestly, if I had to guess, I would say that you need to check to see if the module is still loaded on your PI and check the physical connections again, or even post a picture of your setup for some extra clarity into your problem.

pennypacker
 
Posts: 4
Joined: Sat Oct 06, 2012 4:15 am

Re: RTC real time clock for the Pi

Post by pennypacker »

What do you mean "check to see if the module is still loaded"?

I will try to post some pics tomorrow of my setup. I have checked and rechecked and I am pretty sure it is setup correctly. Especially since I am getting the 68 showing in the table off and on now. It will show for a bit, then after a few seconds I will run the i2cdetect again and it will be gone.

pennypacker
 
Posts: 4
Joined: Sat Oct 06, 2012 4:15 am

Re: RTC real time clock for the Pi

Post by pennypacker »

After much trial and error, I finally discovered that my rtc was defective. I now have another and installation was a breeze. I have gone through the instructions provided on adafruit to install the real time clock on the raspberry pi. I can successfully push the time to the rtc from the system time using sudo hwclock -w I can also read the time off the rtc with sudo hwclock -r However, the last thing I am having difficulty with is getting the raspberry to automatically sync to the rtc on bootup. It continues to use the fake hwclock and seemingly ignores the rtc. I have tried lots of things included a rather complex set of instructions on a forum post at raspberrypi.org. None seem to work. After making changes, I have started from a fresh install each time to avoid confusion. This time, I have followed the tutorial exactly. I tried as is, and I also tried modifying it a bit and putting rtc-ds1307 rather than rtc-1307 into the modules file.

Has anyone here had success setting up the rtc from adafruit using the tutorial on the site? I am using the occidentalis 0.2 image. any more help would be much appreciated.

pennypacker
 
Posts: 4
Joined: Sat Oct 06, 2012 4:15 am

Re: RTC real time clock for the Pi

Post by pennypacker »

SOLUTION!

After a month of on and off trying to get the rtc to work on the ra pi with occidentalis 0.2, I ended up following the instructions listed in the tutorial by adafruit and then adding "sudo hwclock -s" in the rc.local file right after the "echo ds1307..." statement. This seems to work fine. I'm sure there may be some issues if some programs load before that, but this is a good enough solution for me. Perhaps some more expert linuxers could elaborate on whether this is an ok solution or not... but all I know is that my ra pi is syncing time to the real time clock on boot.

User avatar
ekimrolyat
 
Posts: 2
Joined: Fri Aug 28, 2015 8:53 pm

Re: RTC real time clock for the Pi

Post by ekimrolyat »

Re: anybody had success using the rtc 1307 tutorial? NO, no success. Have followed all the directions carefully and repeatedly and still hwclock will not find the 1307. i2cdetect finds the clock at 86 like it's supposed to. In addition, I have gone all over the Internet, tried dozens of different approaches, without success. Updated my distro (took almost 2 hours!). Updated raspi-config. Commented out the lines in blacklist.conf. Etc, lots of etc. Still no working realtime clock. At my wit's end. Ready to throw it away. Do I really need to buy another one to find out if this one is defective?

User avatar
ekimrolyat
 
Posts: 2
Joined: Fri Aug 28, 2015 8:53 pm

Re: RTC real time clock for the Pi

Post by ekimrolyat »

Pennypacker, how did you find out your rtc was defective?
Thanks,
ekimrolyat

User avatar
bluefire
 
Posts: 2
Joined: Sun Sep 13, 2015 5:08 pm

Re: RTC real time clock for the Pi

Post by bluefire »

Hi, I hope this is the right place to post this.

I have bought a touchscreen the PiTFT for the Raspberry Pi, but after installing it onto my Pi B+, I don't have any 5V and SPI pins left for my Real time clock module that I would also like to install onto the same pi.

I just wanted to ask if it's possible to install the PiTFT and Real-time clock module onto the same Pi? Has anyone tried?

User avatar
michaelmeissner
 
Posts: 1821
Joined: Wed Aug 29, 2012 12:40 am

Re: RTC real time clock for the Pi

Post by michaelmeissner »

Bluefire: Depending on the PiTFT you have, your PiTFT may have a secondary row of pins that you can plug in devices like the RTC. My original model 2.8" PiTFT has such a row, and I've plugged both the Chronodot and an RTC I got elsewhere into the appropriate pins.

The PiTFT does use all of the SPI pins, but most RTC's use i2c instead of SPI. You can have multiple devices on the same i2c bus, as long as each device has a different address.

Locked
Forum rules
Talk about Adafruit Raspberry Pi® accessories! Please do not ask for Linux support, this is for Adafruit products only! For Raspberry Pi help please visit: http://www.raspberrypi.org/phpBB3/

Return to “Adafruit Raspberry Pi® accessories”