×

INDI Library v1.8.0 is Released (27 Jul 2019)

INDI Library v1.8.0 is mostly a maintenance release to fix a few bugs in several drivers.

More RTC madness!!!!

  • Posts: 11
  • Thank you received: 0

More RTC madness!!!! was created by BrianH

Hi All,

thought i was going crazy so bought another RTC (got a ds3231) this time. Followed the instructions and hey presto!!! Still not working :-(

I flashed another SD card with Raspian and the RTC works perfectly there. So i know the hardware is fine.

There seems to be something somewhere that is forcing the date and time back to Fri Feb 12, 02:28:16 (year 2006). I have looked and looked but cannot find anything anywhere.

Going to GPS isn't an option as it won't give me anything other than a further power drain when i'm out in the field and i'll still have to set my mount manually initially anyway.

Help me Obi Wan you're my only help..........

Cheers
Bri
6 months 3 weeks ago #34117

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

  • Posts: 632
  • Karma: 6
  • Thank you received: 244

Replied by Kaczorek on topic More RTC madness!!!!

Please share:


  • - your /boot/config.txt
  • - output of i2cdetect -y 1 with and without RTC connected
  • - output of lsmod|grep rtc
  • --
    Radek Kaczorek
    Astroberry Server | NEQ6 | Atik 460EX | Atik EFW2 | ASI 120MM
    The following user(s) said Thank You: BrianH
    Last edit: 6 months 3 weeks ago by Kaczorek.
    6 months 3 weeks ago #34154

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

    • Posts: 11
    • Thank you received: 0

    Replied by BrianH on topic More RTC madness!!!!

    Thanks again Radek,

    I noticed that when i ran lsmod|grep rtc it brought up details for the ds1307 (i have a ds3231)? I amended the config.txt to show a ds1307 but this still did not work.

    I have attached the details

    File Attachment:

    File Name: config.txt
    File Size:36 KB


    Hope this helps?
    Thanks
    Brian
    6 months 3 weeks ago #34157
    Attachments:

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

    • Posts: 16
    • Thank you received: 3

    Replied by G_Gagnon on topic More RTC madness!!!!

    I could also make use of the information on making the RTC set the system clock as I am in a similar situation. Stellarmate raspi with a DS1307 RTC which, from what I understand is a "less precise" DS3231.

    I have the same dtoverlay line in my /boot/config file; the RTC driver is loaded, from the i2cdetect command; haven't checked the output of lsmod | grep rtc. I know the RTC is accessible and works as I can issue hwclock -w and hwclock -r command to set and read the RTC but the RTC date and time won't be used at boot time to set system date and time. I can always set the system clock manually after boot but I would prefer the system to set it up automatically, especially in a headless configuration.

    Any help will be appreciated. Thanks in advance.
    6 months 3 weeks ago #34168

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

    • Posts: 632
    • Karma: 6
    • Thank you received: 244

    Replied by Kaczorek on topic More RTC madness!!!!

    Have you tried these manuals?
    cdn-learn.adafruit.com/downloads/pdf/add...-to-raspberry-pi.pdf
    www.raspberrypi-spy.co.uk/2015/05/adding...to-the-raspberry-pi/

    The latter does not use dtoverlay, but instead assumes manual configuration of the rtc kernel module.
    --
    Radek Kaczorek
    Astroberry Server | NEQ6 | Atik 460EX | Atik EFW2 | ASI 120MM
    6 months 3 weeks ago #34170

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

    • Posts: 16
    • Thank you received: 3

    Replied by G_Gagnon on topic More RTC madness!!!!

    Thanks for the info Radek.

    I'll add "hwclock -s" to rc.local and see if it fixes it when I get back home. Hope its "as simple as that", and that the solution can work for Brian and others.

    Gilles
    6 months 3 weeks ago #34171

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

    • Posts: 16
    • Thank you received: 3

    Replied by G_Gagnon on topic More RTC madness!!!!

    Just as a follow-up, adding hwclock -s to /etc/rc.local worked! The system clock is now set correctly when the system boots.

    Thanks again.

    Gilles
    6 months 2 weeks ago #34229

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

    • Posts: 11
    • Thank you received: 0

    Replied by BrianH on topic More RTC madness!!!!

    Still no joy for me

    If i type date; sudo hwclock -r i get both times simulaneoulsy but in different formats??

    Fri Feb 12 02:30:01 AEST 2016
    Fri 12 Feb 2016 02:30:02 AEST .125778 seconds

    Do you think this could be the issue somehow? I also cannot find the Internationalisation Options in raspi-config???

    Cheers
    Bri
    6 months 2 weeks ago #34233

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

    • Posts: 16
    • Thank you received: 3

    Replied by G_Gagnon on topic More RTC madness!!!!

    Hello Brian,

    When I issue "date; sudo hwclock -r" I get an output similar to yours. I don't have any Internationalisation Options in raspi-config either.

    Have you tried adding "hwclock -s" in /etc/rc.local, before the "exit 0" line? It solved the problem for me.

    Good luck.

    Gilles
    6 months 2 weeks ago #34237

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

    • Posts: 10
    • Thank you received: 1

    Replied by yoandresmza on topic More RTC madness!!!!

    681/5000
    I'm having problems with my RTC too. I bought a ds3231 and I can not do system synchronization with RTC.
    I tried everything, every tutorial you share on these topics and nothing.

    Now my RTC keeps the time correctly, but I can not synchronize with the system, even if I use hwclock -s in the rc.local file. In fact, I think that by adding the two lines to the rc.local file, this cause stops working rc.local or something like that since the VAP stopped working after that (there is a line of code to activate the VAP in rc. local).

    The only way to synchronize RTC with the system time is by typing sudo hwclock -s in the terminal: /

    Any suggestions?
    Thank you
    6 months 6 days ago #34880

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

    • Posts: 16
    • Thank you received: 3

    Replied by G_Gagnon on topic More RTC madness!!!!

    Thanks for reviving this thread. You made me realize that my suggestion (in #34237) of putting "hwclock -s" in rc.local was not quite correct; sorry for that.

    In my case, what worked was to put "/sbin/hwclock --hctosys" in rc.local (before the "exit 0"), not "hwclock -s" as mentionned in my previous post. "--hctosys" will set the system time and date with the time/date from the hardware clock.

    Sorry for the confusion, must have been my winter cold :-/ !
    6 months 6 days ago #34881

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

    • Posts: 550
    • Karma: 1
    • Thank you received: 99

    Replied by Ihoujin on topic More RTC madness!!!!

    You may need to put '&' at the end of the command in RC.local for it to continue properly.
    hwclock -s &
    INDI/KStars on Raspberry Pi 3B+
    Lubuntu 16.04
    Skywatcher HEQ5 Pro Mount
    Canon 600D Camera
    Orion SSAG @280mm Guide Scope
    PHD2
    Adafruit Motor Hat shield
    Adafruit GPS Module
    Generic Bluetooth Joystick.
    Startech 7 port powered USB Hub.
    The following user(s) said Thank You: yoandresmza
    6 months 6 days ago #34884

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

    Moderators: Kaczorek
    Time to create page: 0.961 seconds