実現したいこと
RasberryPi 4でChornyを使ってNTPサーバーを運用したいが
GPS未受信時に時刻同期が止められない
前提
GPSデータ(USB接続のGPS Unit)をLAN内で共有したいのですが、
もしGPSの受信が出来ない場合は、時刻データの同期を停止したいです。
RTCを持ったカメラがLAN内にあり、信頼度が低い時刻データで上書きすることになってしまうため。(RaspberryPiは10日程度、電源を入れないことがあるため)
これがどうやって実現したらいいか、知りたいです
lang
1# Welcome to the chrony configuration file. See chrony.conf(5) for more 2# information about usable directives. 3 4# Include configuration files found in /etc/chrony/conf.d. 5confdir /etc/chrony/conf.d 6 7# Use Debian vendor zone. 8#pool 2.debian.pool.ntp.org iburst 9 10# use the local instance NTP service, if available 11server 127.127.28.2 minpoll 6 maxpoll 10 prefer iburst xleave 12server 127.127.28.0 minpoll 6 maxpoll 10 prefer iburst xleave 13server 127.127.22.0 minpoll 6 maxpoll 10 prefer iburst xleave 14refclock SHM 0 refid GPS poll 3 precision 1e-1 offset 0.9999 delay 0.2 stratum 1 15refclock PPS /dev/pps0 lock NMEA refid PPS trust require stratum 0 16#refclock SOCK /var/run/chrony.ttyAMA0.sock stratum 1 17 18#initstepslew 10 2.debian.pool.ntp.org 127.127.22.0 127.127.28.0 127.127.28.2 19initstepslew 10 127.127.22.0 127.127.28.0 127.127.28.2 20 21# Use time sources from DHCP. 22sourcedir /run/chrony-dhcp 23 24# Use NTP sources found in /etc/chrony/sources.d. 25sourcedir /etc/chrony/sources.d 26 27# Use NTP udp port. 28port 123 29 30# Use NTP cmd udp port. 31cmdport 123 32cmdport 323 33 34# Use NTP acquisiton udp port. 35acquisitionport 123 36acquisitionport 1123 37 38# Uncomment the manual time input 39manual 40 41# This directive specify the location of the file containing ID/key pairs for 42# NTP authentication. 43# THIS SETTING IS LEGACY. Enable by <=2.2. 44keyfile /etc/chrony/chrony.keys 45#commandkey 1 46#generatecommandkey 47 48# This directive specify the file into which chronyd will store the rate 49# information. 50driftfile /var/lib/chrony/chrony.drift 51 52# save data between restarts for fast re-load 53dumponexit 54dumpdir /var/lib/chrony 55 56# Save NTS keys and cookies. 57ntsdumpdir /var/lib/chrony 58 59# Uncomment the following line to turn logging on. 60log tracking measurements statistics rtc refclocks tempcomp 61 62# Log files location. 63logdir /var/log/chrony 64 65# Send a message tp syslog if a clock adjustment is larger than seconds. 66logchange 0.5 67 68# Serve time even if not syncronized to any NTP server. 69local stratum 10 70 71# Stop bad estimates upsetting machine clock. 72#maxdrift 100 73#maxchange 1000 1 2 74maxupdateskew 1000.0 75maxslewrate 83333.333 76 77# Allow high root dispersion (ex. on Windows NTP sources). 78maxdistance 16.0 79 80# This directive tells chrony to regulate the real-time clock and tells it 81# Where to store related data. It may not work on some newer motherboards 82# that use the HPET real-time clock. It requires enhanced real-time 83# support in the kernel. 84#rtcfile /var/lib/chrony/chrony.rtc 85 86# If the last line of this file reads 'rtconutc' chrony will assume that 87# the CMOS clock is on UTC (GMT). If it reads '# rtconutc' or is absent 88# chrony will assume local time. The line (if any) was written by the 89# chrony postinst based on what it found in /etc/default/rcS. You may 90# change it if necessary. 91#rtconutc 92 93# This directive enables kernel synchronisation (every 11 minutes) of the 94# real-time clock. Note that it can’t be used along with the 'rtcfile' directive. 95rtcsync 96 97# Enable hardware timestamping on all interfaces that support it. 98hwtimestamp * 99 100# Step the system clock instead of slewing it if the adjustment is larger than 101# 1 second. 102#makestep 1 3 103makestep 1.0 -1 104 105# Get TAI-UTC offset and leap seconds from the system tz database. 106# This directive must be commented out when using time sources serving 107# leap-smeared time. 108leapsectz right/UTC 109 110# Listen for commands only on localhost. 111bindcmdaddress 127.0.0.1 112bindcmdaddress ::1 113 114# Allow monitoring network group. 115cmdallow 127.0.0.1/32 116cmdallow 192.168.1.0/24 117cmdallow 192.168.2.0/24 118 119# Allow network group. 120allow 127.0.0.1/32 121allow 192.168.1.0/24 122allow 192.168.2.0/24 123allow ::1
試したこと
GPSの断線などを含むトリガーは取れたが、GPSの時刻情報未受信のトリガーが取れなかった
stratum 16を入れてみたが、だめだった
補足情報(FW/ツールのバージョンなど)
RaspberryPi 4B
Rasbian Bullseye
Chorny
RaspberryPiでGPSの時刻情報を使って、定点計測しているカメラの録画時刻の精度を上げています。
カメラとRaspberryPiはEthernet
RaspberryPiとGPS ModuleはUSB
で接続されています