クローニーを起動した後、参照時計を読むのに数分かかります。

クローニーを起動した後、参照時計を読むのに数分かかります。

/dev/serial0NMEAステートメントとPPS(Pulse Per Second)信号を送信するUBLOX GNSSモジュールを使用して、インターネットなしでRaspberry Pi 4に正確な時間を提供したいと思います/dev/pps0

これらすべての情報はリリース直後に届き、配信gpsmon -nおよび検証されますsudo ppscheck /dev/pps0。しかし、chrony情報を取得するには数分かかります。

コンテンツ生成を使用してchronyこれを設定しました。/etc/chrony/conf.d/gps.conf

refclock SHM 0 refid NMEA offset 0.1 precision 0.2 poll 0
refclock PPS /dev/pps0 refid PPS lock NMEA poll 0 trust prefer
log refclocks

私は設定ファイルのオプション(遅延、オフセット、精度、信頼、選択しない、デフォルト設定、ロック)を使用して多くの実験をしましたが、役に立ちませんでした。

私は/etc/chrony/chrony.conf元の姿を残しました。

# Welcome to the chrony configuration file. See chrony.conf(5) for more
# information about usable directives.

# Include configuration files found in /etc/chrony/conf.d.
confdir /etc/chrony/conf.d

# Use Debian vendor zone.
pool 2.debian.pool.ntp.org iburst

# Use time sources from DHCP.
sourcedir /run/chrony-dhcp

# Use NTP sources found in /etc/chrony/sources.d.
sourcedir /etc/chrony/sources.d

# This directive specify the location of the file containing ID/key pairs for
# NTP authentication.
keyfile /etc/chrony/chrony.keys

# This directive specify the file into which chronyd will store the rate
# information.
driftfile /var/lib/chrony/chrony.drift

# Save NTS keys and cookies.
ntsdumpdir /var/lib/chrony

# Uncomment the following line to turn logging on.
#log tracking measurements statistics

# Log files location.
logdir /var/log/chrony

# Stop bad estimates upsetting machine clock.
maxupdateskew 100.0

# This directive enables kernel synchronisation (every 11 minutes) of the
# real-time clock. Note that it can’t be used along with the 'rtcfile' directive.
rtcsync

# Step the system clock instead of slewing it if the adjustment is larger than
# one second, but only in the first three clock updates.
makestep 1 3

# Get TAI-UTC offset and leap seconds from the system tz database.
# This directive must be commented out when using time sources serving
# leap-smeared time.
leapsectz right/UTC

問題は、再起動後にPPSからデータをchrony受信できないことです。 (列にハイフンが表示されます。)と(更新なし)を実行してgpsdこれを確認しました。chronyc sourcesLastRxsudo tail -f /var/log/chrony/refclocks.log

数分後(5〜20分)、chronyはgpsdPPSから時間を取得し始め、数秒後にシステム時間を更新します(前の段落で説明したのと同じ方法で識別されます)。時には状況によって異なり、chrony時間を確保した後にPPSを読むのに数分かかりますgpsd。何度も再起動しようとしましたが、結果は常に同じです。 GNSSモジュールのデータはすぐに入力され、起動時gpsmon -nにすぐにアクセスできますppscheckそれでは、chronyなぜ同じ情報を得るのに5分以上かかりますか?

しかし、システム時間をリセットした後はsudo date +%T -s "12:00:00"問題sudo systemctl reastart chronyありません。chronyシステム時間は数秒以内に更新されます。

私が問題を解決しようとしたことの1つはrunningでしたsudo ntpshmmon。起動時にNTP2およびNTP3サンプルが表示されましたが、NTP0サンプルはchronyが参照クロックに接続し始めたときにのみ表示されました。これは原因を絞り込むのに役立ちますが、そこからデバッグを続行する方法がわかりません。

この質問は以下で修正されました。Raspberry Piスタック交換に関する質問

ベストアンサー1

おすすめ記事