Time and date wrong on RevPi: RTC backup not working?

Topics about the Software of Revolution Pi
raydodo
Posts: 11
Joined: 22 Jan 2019, 16:49

Re: Time and date wrong on RevPi: RTC backup not working?

Post by raydodo »

Hi Simon

Sorry for the long delay - moved on to a different project, but back again now.

As before, running

Code: Select all

sudo timedatectl status
would result in

Code: Select all

 Failed to query server: Invalid argument
. However, I then set the clock to the correct time/date using

Code: Select all

sudo timedatectl -s "2019-12-02 14:34"
and

Code: Select all

sudo hwclock -w
. After doing this

Code: Select all

sudo timedatectl status
returns

Code: Select all

      Local time: Mon 2019-12-02 14:34:45 GMT
  Universal time: Mon 2019-12-02 14:34:45 UTC
        RTC time: Mon 2019-12-02 14:34:46
       Time zone: Etc/Greenwich (GMT, +0000)
 Network time on: yes
NTP synchronized: no
 RTC in local TZ: no

Is this now the correct setting? I will try and test this week.

Thanks
Ray
zhan
Posts: 52
Joined: 16 Apr 2019, 13:31

Re: Time and date wrong on RevPi: RTC backup not working?

Post by zhan »

Hi Raydodo,

It's fine, never mind.
And it's a good news that you get some progress.
I think the setting is always correct depending on your scenario.
In your setting, it is assumed that you are located in GMT, +0000, you want to synchronize the time of your device with NTP server, which may be configured in timesyncd.conf (man timesyncd.conf), but the network connection to that is not available.

In addition, regarding to your case, the following information may be relevant to you.
"Invalid argument" is probably caused by reading the RTC failed, which can be caused by one of two reasons:
1. Something happened with Oscillator in RTC, which you would see a warning log in kern.log as "oscillator stop detected, date/time is not reliable"
2. The time stored in RTC is not a valid time. e.g. earlier than 1970
Currently, I don't know the further reason for these problems, just try to give you some clue, maybe you can find some possibilities regarding your use environment.

Regards,
Simon

raydodo wrote: 02 Dec 2019, 15:42 Hi Simon

Sorry for the long delay - moved on to a different project, but back again now.

As before, running

Code: Select all

sudo timedatectl status
would result in

Code: Select all

 Failed to query server: Invalid argument
. However, I then set the clock to the correct time/date using

Code: Select all

sudo timedatectl -s "2019-12-02 14:34"
and

Code: Select all

sudo hwclock -w
. After doing this

Code: Select all

sudo timedatectl status
returns

Code: Select all

      Local time: Mon 2019-12-02 14:34:45 GMT
  Universal time: Mon 2019-12-02 14:34:45 UTC
        RTC time: Mon 2019-12-02 14:34:46
       Time zone: Etc/Greenwich (GMT, +0000)
 Network time on: yes
NTP synchronized: no
 RTC in local TZ: no

Is this now the correct setting? I will try and test this week.

Thanks
Ray
Simon
raydodo
Posts: 11
Joined: 22 Jan 2019, 16:49

Re: Time and date wrong on RevPi: RTC backup not working?

Post by raydodo »

Thanks Simon.

Here's where I am so far! I have flashed a new Stretch image, factory reset the device and run "apt-get upgrade". I have found that I cannot ping anything from the RevPi, so I think this may be blocked and therefore have not been able to tell if the NTP server is accessible. I have only managed to set the time by disabling NTP now! Below are the commands. I have since set the time zone to Europe/London and reset the time.
RevPI-settime.png
RevPI-settime.png (46.91 KiB) Viewed 11489 times
On your second point, I checked the kern.log and found the error message you mentioned. I deleted the log, rebooted and the message is no longer there. So, I will try this week to see if the RTC maintains the time overnight and see if I can establish a connection with a time server.

Thanks for your help

Ray
zhan
Posts: 52
Joined: 16 Apr 2019, 13:31

Re: Time and date wrong on RevPi: RTC backup not working?

Post by zhan »

you are welcome Ray,

maybe you can also post the kern.log here, then I can check whether other suspicious points are there.

Regards,
Simon
Simon
sofiene
Posts: 23
Joined: 24 Dec 2019, 15:36

Re: Time and date wrong on RevPi: RTC backup not working?

Post by sofiene »

hello
i have the same problem the date is stuck at 12/01/2022 and the time is not right
when i set it manually it goes wrong when i reboot the device

when executing "timedatectl status"
i get a message :

Code: Select all

Failed to query server: Failed to read RTC: Invalid argument
the "timedatectl show-timesync" output :

Code: Select all

FallbackNTPServers=0.debian.pool.ntp.org 1.debian.pool.ntp.org 2.debian.pool.ntp.org 3.debian.pool.ntp.org
ServerName=3.debian.pool.ntp.org
ServerAddress=169.239.132.102
RootDistanceMaxUSec=5s
PollIntervalMinUSec=32s
PollIntervalMaxUSec=34min 8s
PollIntervalUSec=34min 8s
Frequency=0

and the kern file shows the following error

Code: Select all

Jan 12 16:34:24 RevPi59729 kernel: [ 3749.508656] rtc-pcf2127-i2c 1-0051: oscillator stop detected, date/time is not reliable
lastly i tried to use ping command on the ntp servers and the ip addresses shown in the "timedatectl show-timesync" command output but with no use
Post Reply