StdTimeSynch

73 views
Skip to first unread message

Meteo Oberwallis

unread,
Sep 20, 2021, 9:49:50 AM9/20/21
to weewx-user

Hello, everyone. I have a question about time synchronization in Weewx. I use a Raspberry and the sync integration with my Vantage also works well. There's just one problem. If the Raspberry reaches an incorrect or no NTP, it also incorrectly adjusts the Vantage console, which then leads to a loss of data in the data logger. Couldn't a kind of back door be installed in the weewx.conf in the [StdTimeSynch] section? So that's how I make it up:

[StdTimeSynch]

    # How often to check the weather station clock for drift (in seconds)
    clock_check = 14400

    # How much it can drift before we will correct it (in seconds)
    max_drift = 5
   
    # Controll Date is Upper than
     date_controll > 2020

By default, the date is set to 01.01.1970 if the Raspi does not reach the NTP. But if weewx now checks whether the date is higher than e.g. 2020, then you could prevent synchronization with the console. The reason for me is as follows. I have a watchdog running on the Raspi, which always checks whether a network connection is available. If this fails for a longer period of time, it restarts the Raspi. If, of course, the internet signal is not available, the Raspi starts with the standard date of 01/01/1970 and then sends this to the Davis console. This means that the recorded data in the data logger can no longer be used. Is this possible?

Thanks
Stefan

Tom Keffer

unread,
Sep 20, 2021, 10:23:55 AM9/20/21
to weewx-user
Right now, weewxd sleeps until the clock time is greater than the timestamp of its Python file. Is this not working for you?

Perhaps a log demonstrating the problem?

--
You received this message because you are subscribed to the Google Groups "weewx-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to weewx-user+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/weewx-user/03fb5587-b7ec-4134-9403-976685dafc70n%40googlegroups.com.

Meteo Oberwallis

unread,
Sep 20, 2021, 11:48:24 AM9/20/21
to weewx-user
Hello Tom
Apparently that doesn't work for me. I did the following test. At 2:30 p.m., the Raspi took the network away and restarted it. It starts up and then sets its time for the Vantage console, which was around 30 minutes before, i.e. 2:00 p.m. This of course also makes the data in the data logger unusable, since when the Raspi has the network and restarts, the console also sets the current time again. Maybe there is a problem with my weewx file because it still sets the time anew, even though it is in the past?

Tom Keffer

unread,
Sep 20, 2021, 12:16:38 PM9/20/21
to weewx-user
We really need to see the log.

Also, see the note about "fake clock" in the Wiki.

Andy

unread,
Sep 21, 2021, 9:14:54 AM9/21/21
to weewx-user

Susan Mackay

unread,
Sep 21, 2021, 10:47:37 PM9/21/21
to weewx-user
Not an answer directly, but I have the same problem with a number of devices on my local network because my internet connection can take hours to re-establish itself after a power failure (but that is another problem!). I have created a small ESP32 device that has a rechargeable battery backup that can last for well over a day that contains my own NTP server. It synchronises wth the global NTP services when the internet is available and keeps time well enough over the period while it is battery powered. (That is to say I've never had any problems - my server may drift by some fractions of a second but that is all I've ever seen.)
All of my local devices use that as the NTP service which gets them started OK, and will correct themselves if necessary when the loc al NTP server can access the internet and itself gets corrected.
Susan

Reply all
Reply to author
Forward
0 new messages