Sparks135
Posts: 104
Joined: Tue Feb 28, 2017 7:44 pm

Trying to install real time clock

Fri Mar 24, 2017 11:26 pm

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.

klricks
Posts: 6618
Joined: Sat Jan 12, 2013 3:01 am
Location: Grants Pass, OR, USA
Contact: Website

Re: Trying to install real time clock

Sat Mar 25, 2017 4:15 am

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]
Unless specified otherwise my response is based on the latest and fully updated Raspbian Buster w/ Desktop OS.

Sparks135
Posts: 104
Joined: Tue Feb 28, 2017 7:44 pm

Re: Trying to install real time clock

Sat Mar 25, 2017 12:58 pm

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.

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

Re: Trying to install real time clock

Sat Mar 25, 2017 1:40 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 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

pcmanbob
Posts: 7264
Joined: Fri May 31, 2013 9:28 pm
Location: Mansfield UK

Re: Trying to install real time clock

Sat Mar 25, 2017 1:53 pm

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
Last edited by pcmanbob on Sun Mar 26, 2017 9:05 am, edited 1 time in total.
We want information… information… information........................no information no help
The use of crystal balls & mind reading are not supported

Sparks135
Posts: 104
Joined: Tue Feb 28, 2017 7:44 pm

Re: Trying to install real time clock

Sat Mar 25, 2017 2:02 pm

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.

Sparks135
Posts: 104
Joined: Tue Feb 28, 2017 7:44 pm

Re: Trying to install real time clock

Sat Mar 25, 2017 2:12 pm

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)"

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

Re: Trying to install real time clock

Sat Mar 25, 2017 2:29 pm

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.)
Note: Having anything humorous in your signature is completely banned on this forum. Wear a tin-foil hat and you'll get a ban.

Any DMs sent on Twitter will be answered next month.

This is a doctor free zone.

Sparks135
Posts: 104
Joined: Tue Feb 28, 2017 7:44 pm

Re: Trying to install real time clock

Sat Mar 25, 2017 3:02 pm

Here is what my screen says.
Pretty_Name-Raspbian GNU/Linux 8 Jessie
Version 8

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

Re: Trying to install real time clock

Sat Mar 25, 2017 3:26 pm

That's the latest version as far as I know.

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

Gordon

Sparks135
Posts: 104
Joined: Tue Feb 28, 2017 7:44 pm

Re: Trying to install real time clock

Sat Mar 25, 2017 3:45 pm

OK done, I will see If it works. Thanks.

Sparks135
Posts: 104
Joined: Tue Feb 28, 2017 7:44 pm

Re: Trying to install real time clock

Sat Mar 25, 2017 7:36 pm

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?

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

Re: Trying to install real time clock

Sat Mar 25, 2017 7:38 pm

Have you tested whether the hardware RTC is broken?
Note: Having anything humorous in your signature is completely banned on this forum. Wear a tin-foil hat and you'll get a ban.

Any DMs sent on Twitter will be answered next month.

This is a doctor free zone.

Sparks135
Posts: 104
Joined: Tue Feb 28, 2017 7:44 pm

Re: Trying to install real time clock

Sat Mar 25, 2017 7:40 pm

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.

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

Re: Trying to install real time clock

Sat Mar 25, 2017 7:45 pm

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.
Note: Having anything humorous in your signature is completely banned on this forum. Wear a tin-foil hat and you'll get a ban.

Any DMs sent on Twitter will be answered next month.

This is a doctor free zone.

Sparks135
Posts: 104
Joined: Tue Feb 28, 2017 7:44 pm

Re: Trying to install real time clock

Sat Mar 25, 2017 7:48 pm

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.

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

Re: Trying to install real time clock

Sat Mar 25, 2017 7:56 pm

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.
Note: Having anything humorous in your signature is completely banned on this forum. Wear a tin-foil hat and you'll get a ban.

Any DMs sent on Twitter will be answered next month.

This is a doctor free zone.

Sparks135
Posts: 104
Joined: Tue Feb 28, 2017 7:44 pm

Re: Trying to install real time clock

Sat Mar 25, 2017 8:02 pm

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?

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

Re: Trying to install real time clock

Sat Mar 25, 2017 8:06 pm

Start with a clean install of Raspbian add one line to /boot/config.txt and see what happens.
Note: Having anything humorous in your signature is completely banned on this forum. Wear a tin-foil hat and you'll get a ban.

Any DMs sent on Twitter will be answered next month.

This is a doctor free zone.

Sparks135
Posts: 104
Joined: Tue Feb 28, 2017 7:44 pm

Re: Trying to install real time clock

Sat Mar 25, 2017 8:09 pm

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?

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

Re: Trying to install real time clock

Sat Mar 25, 2017 8:43 pm

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?
Note: Having anything humorous in your signature is completely banned on this forum. Wear a tin-foil hat and you'll get a ban.

Any DMs sent on Twitter will be answered next month.

This is a doctor free zone.

Sparks135
Posts: 104
Joined: Tue Feb 28, 2017 7:44 pm

Re: Trying to install real time clock

Sat Mar 25, 2017 8:49 pm

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?

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

Re: Trying to install real time clock

Sat Mar 25, 2017 8:56 pm

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?
Last edited by gordon77 on Sat Mar 25, 2017 8:59 pm, edited 1 time in total.

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

Re: Trying to install real time clock

Sat Mar 25, 2017 8:59 pm

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.
Note: Having anything humorous in your signature is completely banned on this forum. Wear a tin-foil hat and you'll get a ban.

Any DMs sent on Twitter will be answered next month.

This is a doctor free zone.

Sparks135
Posts: 104
Joined: Tue Feb 28, 2017 7:44 pm

Re: Trying to install real time clock

Sat Mar 25, 2017 9:39 pm

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.

Return to “HATs and other add-ons”