Page 1 of 2

Trying to install real time clock

Posted: Fri Mar 24, 2017 11:26 pm
by Sparks135
I am following these directions, but the second command after config loads there isn't this:

sudo raspi-config

Select "Advanced Options" and then "I2C - Enable/Disable automatic loading". A prompt will appear asking Would you like the ARM I2C interface to be enabled?, select Yes, exit the utility and reboot your Raspberry Pi.

The enable?Disable automatic loading isn't in the menu.

Here is the board I am trying to install. http://www.nationelectronics.com/raspbe ... 28208.html

I am stuck.

Re: Trying to install real time clock

Posted: Sat Mar 25, 2017 4:15 am
by klricks
The instructions you are using are old.
raspi-config has changed and the settings are now in the menu [5 Interfacing Options]
You can also find the same settings in the GUI config tool in [menu] --> [Preferences]

Re: Trying to install real time clock

Posted: Sat Mar 25, 2017 12:58 pm
by Sparks135
I am new to this, please give me more info about this. I get into the config file using sudo raspi-config but my 5 is enable camera. I don't see interface options.

Re: Trying to install real time clock

Posted: Sat Mar 25, 2017 1:40 pm
by gordon77
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 the 2 lines containing --systz

reboot your pi

set the clock with sudo date -s "25 Mar 2017 09:12:00"
using the correct date and time
sudo hwclock -w
sudo hwclock -r

Re: Trying to install real time clock

Posted: Sat Mar 25, 2017 1:53 pm
by pcmanbob
Sparks135 wrote:I am new to this, please give me more info about this. I get into the config file using sudo raspi-config but my 5 is enable camera. I don't see interface options.
Hi.
you must be using an old image of raspbian , I had to go back to wheezy to find raspi-config with those options.
but anyway here is were you will find it
select advanced options
Image
select I2c
Image
select yes
Image
select ok
Image
select yes
Image
select yes
Image
and your done.

hope it helps

Re: Trying to install real time clock

Posted: Sat Mar 25, 2017 2:02 pm
by Sparks135
I opened the file hwclock-set and modified what didn't have the # sign. but it would not let me save it. How do I save it? Can it be opened from terminal, if s please give me the sudo command. thanks.

Re: Trying to install real time clock

Posted: Sat Mar 25, 2017 2:12 pm
by Sparks135
OK opened it, but found the two lines that were missing the # signs in fron of syz. Saved it but here is why I think my board is bad. on line 68 it should say 68 but it says UU. That is in the test by typing" sudo i2cdetect -y 1 (if using v2 Raspberry Pi)"

Re: Trying to install real time clock

Posted: Sat Mar 25, 2017 2:29 pm
by DougieLawson
What version of Raspbian are you running? Get that with a cat /etc/os-release command.
Does your raspi-config have option "8 Update" (or somewhere on the advanced menu)? If it does, run that.

If you're running Wheezy, then the time to upgrade is now! (Well it was actually more than a year ago.)

Re: Trying to install real time clock

Posted: Sat Mar 25, 2017 3:02 pm
by Sparks135
Here is what my screen says.
Pretty_Name-Raspbian GNU/Linux 8 Jessie
Version 8

Re: Trying to install real time clock

Posted: Sat Mar 25, 2017 3:26 pm
by gordon77
That's the latest version as far as I know.

I just did the mods I showed before, no enabling i2c etc.

Gordon

Re: Trying to install real time clock

Posted: Sat Mar 25, 2017 3:45 pm
by Sparks135
OK done, I will see If it works. Thanks.

Re: Trying to install real time clock

Posted: Sat Mar 25, 2017 7:36 pm
by Sparks135
gordon77 wrote:That's the latest version as far as I know.

I just did the mods I showed before, no enabling i2c etc.

Gordon
My clock still won't update, I redid every setting again and all correct. Any ideas?

Re: Trying to install real time clock

Posted: Sat Mar 25, 2017 7:38 pm
by DougieLawson
Have you tested whether the hardware RTC is broken?

Re: Trying to install real time clock

Posted: Sat Mar 25, 2017 7:40 pm
by Sparks135
DougieLawson wrote:Have you tested whether the hardware RTC is broken?
I Did the test in the instructions if that is what you are referring to. on the chart at 68 it says UU.

Re: Trying to install real time clock

Posted: Sat Mar 25, 2017 7:45 pm
by DougieLawson
Grab a fresh SDCard, a copy of Etcher and a copy of Raspbian 2017-03-02.

Start with a clean install and see if you can get it working on that. It should just need a single line added to /boot/config.txt to define the device tree overlay for your RTC.

Re: Trying to install real time clock

Posted: Sat Mar 25, 2017 7:48 pm
by Sparks135
DougieLawson wrote:Grab a fresh SDCard, a copy of Etcher and a copy of Raspbian 2017-03-02.

Start with a clean install and see if you can get it working on that. It should just need a single line added to /boot/config.txt to define the device tree overlay for your RTC.

OK I think the board is DOA at I did the sudo hwclock -w and it returned this "Can't acess the hardware clock via any known method.

Re: Trying to install real time clock

Posted: Sat Mar 25, 2017 7:56 pm
by DougieLawson
Sparks135 wrote:
DougieLawson wrote:Grab a fresh SDCard, a copy of Etcher and a copy of Raspbian 2017-03-02.

Start with a clean install and see if you can get it working on that. It should just need a single line added to /boot/config.txt to define the device tree overlay for your RTC.

OK I think the board is DOA at I did the sudo hwclock -w and it returned this "Can't acess the hardware clock via any known method.
That's a function of the driver not being loaded correctly (/dev/rtc & /dev/rtc0 don't exist), it doesn't, necessarily, mean a toasted board.

Re: Trying to install real time clock

Posted: Sat Mar 25, 2017 8:02 pm
by Sparks135
DougieLawson wrote:
Sparks135 wrote:
DougieLawson wrote:Grab a fresh SDCard, a copy of Etcher and a copy of Raspbian 2017-03-02.

Start with a clean install and see if you can get it working on that. It should just need a single line added to /boot/config.txt to define the device tree overlay for your RTC.

OK I think the board is DOA at I did the sudo hwclock -w and it returned this "Can't acess the hardware clock via any known method.
That's a function of the driver not being loaded correctly (/dev/rtc & /dev/rtc0 don't exist), it doesn't, necessarily, mean a toasted board.
is there a possible fix?

Re: Trying to install real time clock

Posted: Sat Mar 25, 2017 8:06 pm
by DougieLawson
Start with a clean install of Raspbian add one line to /boot/config.txt and see what happens.

Re: Trying to install real time clock

Posted: Sat Mar 25, 2017 8:09 pm
by Sparks135
DougieLawson wrote:Start with a clean install of Raspbian add one line to /boot/config.txt and see what happens.
OK formating now. Don't I have to do all the steps? Install the tools etc?

Re: Trying to install real time clock

Posted: Sat Mar 25, 2017 8:43 pm
by DougieLawson
After the first boot. Do nothing except add

Code: Select all

dtoverlay=i2c-rtc,ds1307
to the bottom of /boot/config.txt to enable your DS1307. As soon as you've done that reboot.

BTW, is that 40pin header soldered to your DS1307 board, does it come as a ready to plug and go board?

Re: Trying to install real time clock

Posted: Sat Mar 25, 2017 8:49 pm
by Sparks135
Sparks135 wrote:
DougieLawson wrote:Start with a clean install of Raspbian add one line to /boot/config.txt and see what happens.
OK formating now. Don't I have to do all the steps? Install the tools etc?
OK reinstalled everything and running update. Now how do I test this?

Re: Trying to install real time clock

Posted: Sat Mar 25, 2017 8:56 pm
by gordon77
If it's telling the correct time now...

Disconnect pi from the ethernet, power down the pi, wait a few minutes, repower the pi...does it say the correct time?

Re: Trying to install real time clock

Posted: Sat Mar 25, 2017 8:59 pm
by DougieLawson
sudo hwclock --systohc
sudo hwclock -r
sudo -c "echo 'Kilroy was ere' > /sys/bus/i2c/devices/1-0068/nvram"
sudo cat /sys/bus/i2c/devices/1-0068/nvram


Then follow the rest of your tutorial from Step 7: onwards before doing Gordon's test.

Re: Trying to install real time clock

Posted: Sat Mar 25, 2017 9:39 pm
by Sparks135
DougieLawson wrote:sudo hwclock --systohc
sudo hwclock -r
sudo -c "echo 'Kilroy was ere' > /sys/bus/i2c/devices/1-0068/nvram"
sudo cat /sys/bus/i2c/devices/1-0068/nvram


Then follow the rest of your tutorial from Step 7: onwards before doing Gordon's test.
Well my wife needed me so I took the Pi with me and ran the install before seeing this post. Well power was off for 1/2 hr and when rebooted clock shows proper time.I changed the %R to %r for 12 hr, I hope that doesn't screw the pooch.