Black Lives Matter - Action and Equality. ... Adafruit is open and shipping.
0

RTC and Raspberry Pi .. can't set time :(
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

RTC and Raspberry Pi .. can't set time :(

by scrubbl3r on Mon May 18, 2015 10:00 pm

Hi folks,

I just bought a raspberry pi B+ and i'm trying to get my realtime clock working. I'm following this tutorial..
https://learn.adafruit.com/adding-a-real-time-clock-to-raspberry-pi?view=all

I've gotten this to work with my older Pi without a problem, but this time around i can't get the hwclock methods to work :(

The new model B+ required an updated OS (2015-05-05-raspbian-wheezy).. wonder if this has something to do with it?

I've gotten as far as running i2cdetect and seeing the device occupying 0x68. I have rebooted the Pi afterwards.

the output im getting in the terminal window when i try hwclock -r is ..
]hwclock: ioctl(RTC_RD_TIME) to /dev/rtc0 to read the time failed: Invalid argument

thank you!
scrubbl3r
 
Posts: 21
Joined: Sat Jul 13, 2013 6:26 pm

Re: RTC and Raspberry Pi .. can't set time :(

by adafruit_support_rick on Tue May 19, 2015 11:06 am

So you need to follow the instructions for a rev 2 Pi.
What do you get from
echo ds1307 0x68 > /sys/class/i2c-adapter/i2c-1/new_device

adafruit_support_rick
 
Posts: 35095
Joined: Tue Mar 15, 2011 11:42 am
Location: Buffalo, NY

Re: RTC and Raspberry Pi .. can't set time :(

by scrubbl3r on Tue May 19, 2015 5:05 pm

thanks for the reply rick..

so i did this ..

Code: Select all | TOGGLE FULL SIZE
$ sudo -s
# echo ds1307 0x68 > /sys/class/i2c-adapter/i2c-1/new_device


upon entry nothing is returned. so i exit super
Code: Select all | TOGGLE FULL SIZE
# exit

the i try to call the clock
Code: Select all | TOGGLE FULL SIZE
$ sudo hwclock -r

.. and the following is returned
Code: Select all | TOGGLE FULL SIZE
hwclock: ioctl(RTC_RD_TIME) to /dev/rtc0 to read the time failed: Input/output error
scrubbl3r
 
Posts: 21
Joined: Sat Jul 13, 2013 6:26 pm

Re: RTC and Raspberry Pi .. can't set time :(

by adafruit_support_rick on Tue May 19, 2015 5:16 pm

Please post clear, detailed pictures of both sides of the RTC, showing your wiring and soldering.

adafruit_support_rick
 
Posts: 35095
Joined: Tue Mar 15, 2011 11:42 am
Location: Buffalo, NY

Re: RTC and Raspberry Pi .. can't set time :(

by scrubbl3r on Tue May 19, 2015 6:19 pm

The RTC is integrated into a Raspberry Pi Alamode
http://www.makershed.com/products/alamode-for-raspberry-pi

It always worked fine with my other Pi. I'm going to swap the battery for the RTC but i know that it must still be good as its only around 1 year old : /
scrubbl3r
 
Posts: 21
Joined: Sat Jul 13, 2013 6:26 pm

Re: RTC and Raspberry Pi .. can't set time :(

by scrubbl3r on Tue May 19, 2015 6:38 pm

I changed the battery with no luck
scrubbl3r
 
Posts: 21
Joined: Sat Jul 13, 2013 6:26 pm

Re: RTC and Raspberry Pi .. can't set time :(

by scrubbl3r on Tue May 19, 2015 10:28 pm

I figured out the problem. I didn't remove the "#" from the blacklist file.. the following worked

Code: Select all | TOGGLE FULL SIZE
blacklist spi-bcm2708
blacklist i2c-bcm2708


Thanks so much for your help. I really appreciate it.
scrubbl3r
 
Posts: 21
Joined: Sat Jul 13, 2013 6:26 pm

Re: RTC and Raspberry Pi .. can't set time :(

by melrick on Sat Oct 31, 2015 1:37 am

Does it work?

melrick
 
Posts: 1
Joined: Sat Oct 31, 2015 1:37 am

Please be positive and constructive with your questions and comments.