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

For RTC breakouts, etc., use the Other Products from Adafruit forum

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
scrubbl3r
 
Posts: 21
Joined: Sat Jul 13, 2013 6:26 pm

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

Post by scrubbl3r »

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-rea ... i?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!

User avatar
adafruit_support_rick
 
Posts: 35092
Joined: Tue Mar 15, 2011 11:42 am

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

Post by adafruit_support_rick »

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

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

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

Post by scrubbl3r »

thanks for the reply rick..

so i did this ..

Code: Select all

$ 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

# exit
the i try to call the clock

Code: Select all

$ sudo hwclock -r
.. and the following is returned

Code: Select all

hwclock: ioctl(RTC_RD_TIME) to /dev/rtc0 to read the time failed: Input/output error

User avatar
adafruit_support_rick
 
Posts: 35092
Joined: Tue Mar 15, 2011 11:42 am

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

Post by adafruit_support_rick »

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

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

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

Post by scrubbl3r »

The RTC is integrated into a Raspberry Pi Alamode
http://www.makershed.com/products/alamo ... spberry-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 :(

Post by scrubbl3r »

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 :(

Post by scrubbl3r »

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

Code: Select all

blacklist spi-bcm2708
blacklist i2c-bcm2708
Thanks so much for your help. I really appreciate it.

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

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

Post by melrick »

Does it work?

Locked
Please be positive and constructive with your questions and comments.

Return to “Clock Kits (discontinued)”