×

INDI Library v2.0.6 is Released (02 Feb 2024)

Bi-monthly release with minor bug fixes and improvements

RTC still won't work

  • Posts: 11
  • Thank you received: 0
Hi guys, i'm a bit of a beginner when it comes to linux (which is a bit embarrassing as a manager of an Application support team!).

I have just purchased an RTC for my Pi 3b+ so that i'm not messing around with times when i'm out in the field. I have followed all of the instructions i can find but the RTC still won't work :-(

Is there anybody who would be kind enough to help me out with the config please?

The module is I2C RTC DS1307 purchased from GearBest.
The instructions are at wiki.52pi.com/index.php/DS1307_RTC_Modul...erry_Pi_SKU:_EP-0059

Any help you could offer would be greatly appreciated.

Cheers
Bri
5 years 2 months ago #33558

Please Log in or Create an account to join the conversation.

  • Posts: 983
  • Thank you received: 375

Replied by Radek Kaczorek on topic RTC still won't work


Hi Bri, normally you just connect the RTC and add dtoverlay=i2c-rtc,ds3231 to your /boot/config.txt, then set the proper time manually with date -s "[your date and time]" and next "sudo hwclock -w" to write the current system time to RTC. After reboot you should be fine. What is the actual problem with your setup?

PS. what does i2cdetect -y 1 shows on your system? Is the RTC detected at all?
Last edit: 5 years 2 months ago by Radek Kaczorek.
5 years 2 months ago #33574

Please Log in or Create an account to join the conversation.

  • Posts: 11
  • Thank you received: 0

Replied by Brian Holbrook on topic RTC still won't work

Thanks Kaczorek,

I have attached an image of what i see.

Not sure if that means it is recognised?

thanks
Bri
5 years 2 months ago #33585
Attachments:

Please Log in or Create an account to join the conversation.

  • Posts: 983
  • Thank you received: 375

Replied by Radek Kaczorek on topic RTC still won't work

Yes, it is. The hardware clock is connected properly (a device with address 0x68 is connected over I2C, and it's being used by a system module - that's why you see UU). Just play with hwclock command now and you will be fine.
Last edit: 5 years 2 months ago by Radek Kaczorek.
5 years 2 months ago #33598

Please Log in or Create an account to join the conversation.

  • Posts: 11
  • Thank you received: 0

Replied by Brian Holbrook on topic RTC still won't work

Thanks Kaczorek, i'll smash a few buttons until it works ;-)

Bri
5 years 2 months ago #33599

Please Log in or Create an account to join the conversation.

  • Posts: 11
  • Thank you received: 0

Replied by Brian Holbrook on topic RTC still won't work

No, still no joy. :-(
Tried the following:
Set the system clock (via control center as i couldn't work it out at the command line)
date returned the correct time
sudo hwclock -w seemed to work, sudo hwclock returned the correct time.

Switched off and back on and the wrong date/time displayed

sudo hwclock -w --systohc changes the hwclock time but it went back to the wrong date after a restart.

Cannot figure out what i'm doing wrong. Even tested the battery which is giving out a healthy 3v.

Any thoughts?

Thanks
Bri
5 years 2 months ago #33600

Please Log in or Create an account to join the conversation.

  • Posts: 11
  • Thank you received: 0

Replied by Brian Holbrook on topic RTC still won't work

Hi all, still struggling with this RTC.

I have reflashed the SD card just in case and completed the setup. The RTC is being recognised. I let the Pi synch time via the internet and then "sudo hwclock -w" to write the time. "sudo hwclock -r" shows the correct time.

When i restart it still defaults back to Fri Feb 12, 02:28!!!!!

Is there some other clock set or some kind of override in the config that is looking at some kind of pretend hwclock?

After some more searching I have also run:
sudo apt-get -y remove fake-hwclock - this fails as it says fake-hwclock is not installed
sudo update-rc.d -f fake-hwclock remove
sudo systemctl disable fake-hwclock

Any clues? It is starting to drive me wild now :( :( :( :( :( :(

Cheers
Bri
5 years 2 months ago #33682

Please Log in or Create an account to join the conversation.

  • Posts: 983
  • Thank you received: 375

Replied by Radek Kaczorek on topic RTC still won't work


This is really strange. I use RTC and do not do anything more than already said. My RPi gets the time from RTC every time it reboots.
I have just checked and found out that in case of your module you should have dtoverlay=i2c-rtc,ds1307 in /boot/config.txt (NOT what I use: dtoverlay=i2c-rtc,ds3231 because I have different RTC chip connected). Can you double check this?
Also please check if the time is OK after reboot WITHOUT disconnecting power from RPi. If it OK without diconnecting the power but it is not if you disconnect the power, your RTC battery is dead.
5 years 2 months ago #33695

Please Log in or Create an account to join the conversation.

  • Posts: 437
  • Thank you received: 31

Replied by Paul on topic RTC still won't work

Bri,

It may be worthwhile checking if the battery has been installed correctly.

Paul
5 years 2 months ago #33718

Please Log in or Create an account to join the conversation.

  • Posts: 11
  • Thank you received: 0

Replied by Brian Holbrook on topic RTC still won't work

Hi all, me again.

Still struggling with this RTC. It is recognised by the Pi, i have installed a fresh battery, i can write the correct time to it and it displays the correct time. When i reboot it always defaults to the same date - Fri Feb 12, 02:28:16

Tried removing the RTC and then sudo hwclock -r and it is not found so i am definitely accessing the RTC module.

Do you think i have a faulty RTC module???

Any fresh ideas?

Thanks
Bri
5 years 2 months ago #33754

Please Log in or Create an account to join the conversation.

  • Posts: 407
  • Thank you received: 74

Replied by Clive Stachon on topic RTC still won't work

Please dont shout at me but lateral thinking would suggest forget it (RTC) and buy a GPS - it provides the time and are integrated into Ekos/Kstars/Indi. As I say just a suggestion :-)
RPI3 Ubuntu 16.04 / AMD desktop Kstars under Ubuntu 16.04 Mounts :azeq6 ,SWAZGoTo

RPI3 Fedora testing out on AMD desktop Fedpra 28 - running kstars 2.9.4 , Indilib 1.7.4 ?????
The following user(s) said Thank You: Radek Kaczorek
5 years 2 months ago #33768

Please Log in or Create an account to join the conversation.

  • Posts: 298
  • Thank you received: 46

Replied by Markku on topic RTC still won't work

Hi,
I took a look at the webpage about the hwclock and noticed that the webpage was last updated 27 April 2018 and you are using RPi3 B+ and also that the hwclock driver is state "Work In Progress", so maybe I'm wrong but I wonder if the driver is in working order yet ? and did you update the kernel to the latest version ?
/Markku
5 years 2 months ago #33779

Please Log in or Create an account to join the conversation.

Moderators: Radek Kaczorek
Time to create page: 1.183 seconds