0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

JJY NTPD ST1

Last updated at Posted at 2023-05-15

Arduinoで作ったSEIKOのタイムサーバクローンのJJYSでntpdをST1にしていて設定ファイルはこのようにしてます。

/etc/ntp.conf
tinker panic 0

logconfig =allall

driftfile /var/db/ntp/drift 
 
statistics loopstats peerstats clockstats
statsdir /var/db/ntp/
filegen loopstats  file loopstats  type day enable
filegen peerstats  file peerstats  type day enable
filegen clockstats file clockstats type day enable

server   127.127.40.0   mode 6
fudge    127.127.40.0   time1 0.014

いろいろ試行錯誤して、必要の無い設定もあります。

シリアル信号を受けるために2ポートシリアルにするため、DTSに以下を設定しています。

uartf {
        ralink,group = "uartf";
        ralink,function = "gpio uartf";
};

この設定を試してみた所uartfがcuau0になり、uart(lite)がcuau1になりました。

FON2405_GPIO.png

ログは以下のようになります。

/var/db/clockstat
60079 72886.767 127.127.40.0 === polls=1361 reach=1111111
60079 72887.001 127.127.40.0 <-- <STX>2305162051447<ETX>
60079 72887.014 127.127.40.0 <-- <STX><xE5><ETX>
60079 72887.017 127.127.40.0 === 2023/05/16 05:14:47.000 JST   ( 2023/135 20:14:47.000 UTC )
60079 72887.018 127.127.40.0 --- status 6 [*] Sys.Peer : offset -0.151 mSec. : jitter 2.073 mSec.
60079 72950.767 127.127.40.0 === polls=1362 reach=1111111
60079 72951.003 127.127.40.0 <-- <STX>2305162051551<ETX>
60079 72951.015 127.127.40.0 <-- <STX><xE5><ETX>
60079 72951.018 127.127.40.0 === 2023/05/16 05:15:51.000 JST   ( 2023/135 20:15:51.000 UTC )
60079 72951.019 127.127.40.0 --- status 6 [*] Sys.Peer : offset -1.095 mSec. : jitter 1.691 mSec.

JJYのドライバーは40番でモード6で動かしています。

JJYSは毎分59秒のエッジを基準にして、後はArduinoのTimerで秒を刻んでいます。水晶発信子のAdruinoのTimerはけっこう精度いいです。セラミック発信子だとおちます。

JJYSは毎秒出力してますが、ntpdはだいたい1分おきにシリアル入力を拾って、時間を合わせます。

JJYSがエラーなどで出力を停止していると、ntpdはシリアル入力を30秒くらいは待ちますが、それを越えるとエラーになります。

ntpd -xで起動してますが、安定するまでかなり時間がかかります。

filename(7).png

最近何故かよくwatchdogでリブートしているのですが、リブートしないとこんな感じです。

filename(12).png

filename(11).png

家をあけていたのと、外部からのノイズが少ない季節で、これがおそらくベストです。

filename(16).png

filename(15).png

エアコンなどの季節要因のノイズもあるようです。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?