一,简述gps ntpserver搭建过程
1,安装ntp服务,
2,ntp.conf
server 127.127.20.0 prefer
fudge 127.127.20.0 stratum 0
3,创建gps0设备连接,ln -s /dev/ttyS0 /dev/gps0
3,debug模式启动服务,ntpd -d
4,ntpstat 查看时间是否认证成功
ntp启动后需要一段时期认证时钟,ntpstat 查看是否synchronised。如果是本地时钟认证需要大约5分钟
5,查看gps0信号接收状态,debug模式下会显示nmea:数据格式,gpsread --- timecode ---
进入ntpq模式 输入cv 查看数据是否接受正常(baddata项目是否数值在增长)。
如果baddata增长极有可能是gps时钟与本地时间间隔大于4小时 造成不能认证(源码中有说明cloctime.c)。
相关源代码:refclock_nmea.c, refclock_local.c ,ntp_refclock.c ,cloctime.c,
相关maillist:http://lists.ntp.isc.org/pipermail/questions/2009-January/021089.html
关于系统时间被更新的频率:http://www.eecis.udel.edu/~ntp/ntpfaq/NTP-s-algo.htm#Q-ALGO-CLK-UPD
未完 待继续整理
浙公网安备 33010602011771号