domschl / RaspberryNtpServer

Stratum-1 time server with Raspberry Pi and GPS
MIT License
86 stars 5 forks source link

How to (remotely) tell whether the PPS source is reliable? #14

Open ZogKarndon opened 6 months ago

ZogKarndon commented 6 months ago

I've gotten everything working with Chrony, etc.

My question is - how can I be notified when something goes wrong? I.e., the PPS source is unreliable, GPS lock has been lost, etc.

I'm using Home Assistant and Uptime Kuma to track the availability of my (too many) servers, if that's helpful.

domschl commented 6 months ago

The software for the display also uses journald messages that inform about changes in stratum-level. In principle, if you have something that can work with journald logs, you should be good. Messages are something like:

Apr 13 13:15:37 chronotron python[891]: INFO:Chronotron:Chrony stratum level changed to 5
Apr 13 13:03:47 chronotron python[891]: INFO:Chronotron:Chrony lost PPS signal
Apr 13 13:03:47 chronotron python[891]: INFO:Chronotron:Chrony stratum level changed to 3
Apr 13 13:03:47 chronotron python[891]: INFO:Chronotron:Chrony receiving time source from fritz.box
Apr 12 23:13:05 chronotron python[891]: INFO:Chronotron:Chrony locked to high precision GPS PPS signal
Apr 12 23:13:05 chronotron python[891]: INFO:Chronotron:Chrony stratum level changed to 1
Apr 12 23:13:05 chronotron python[891]: INFO:Chronotron:Chrony receiving time source from PPS
Apr 12 19:40:50 chronotron python[891]: INFO:Chronotron:Chrony receiving time source from server2.as2.ch
Apr 12 19:40:50 chronotron python[891]: INFO:Chronotron:Chrony aquired lock to time source
Apr 12 19:31:26 chronotron python[891]: INFO:Chronotron:Chrony receiving time source from None
Apr 12 19:01:16 chronotron python[891]: INFO:Chronotron:Chrony lost PPS signal
Apr 12 19:01:16 chronotron python[891]: INFO:Chronotron:Chrony stratum level changed to 3
Apr 12 19:01:16 chronotron python[891]: INFO:Chronotron:Chrony receiving time source from fritz.box
Apr 08 15:31:56 chronotron python[891]: INFO:Chronotron:Chrony locked to high precision GPS PPS signal
Apr 08 15:31:56 chronotron python[891]: INFO:Chronotron:Chrony stratum level changed to 1
Apr 08 15:31:56 chronotron python[891]: INFO:Chronotron:Chrony receiving time source from PPS
Apr 08 15:27:21 chronotron python[891]: INFO:Chronotron:Chrony stratum level changed to 3
Apr 08 15:27:21 chronotron python[891]: INFO:Chronotron:Chrony receiving time source from fritz.box
Apr 08 15:27:21 chronotron python[891]: INFO:Chronotron:Chrony aquired lock to time source

You could adapt the software to work even without display.

I had thought about a Home-Assistant connection (via MQTT) at some point, but haven't found the time yet to do that.