NTP Raspberry pi3+GPSmodule

  FAQ_INDEX, raspberrypi
5153P

Raspberry pi3

raspi3

OS: Raspbian Stretch Lite   https://downloads.raspberrypi.org/raspbian_lite_latest

GPIO:https://www.raspberrypi.org/documentation/usage/gpio/

初期設定 SSH enable, Wifi, Filesystem,VSFTP( Root ログイン書込み許可 最終的にaccess denie)

GPSD: http://www.catb.org/gpsd/

apt-get install gpsd gpsd-clients python-gps

gpsd

DEVICES=”/dev/ttyAMA0 /dev/pps0″

GPSD_OPTIONS=”-F /var/run/gpsd.sock -b -n”

#############################

config.txt
dtoverlay=pps-gpio,gpiopin=18
#############################

apt-get install pps-tools
ppstest /dev/pps0

apt-get install ntp

ntp.conf

# /etc/ntp.conf, configuration for ntpd; see ntp.conf(5) for help

driftfile /var/lib/ntp/ntp.drift
restrict default kod nomodify notrap nopeer noquery
restrict -6 default kod nomodify notrap nopeer noquery
restrict 127.0.0.1 mask 255.255.255.0
restrict 192.168.11.0 mask 255.255.255.0
restrict -6 ::1
server ntp.nict.jp iburst prefer
server 127.127.22.0 minpoll 4 maxpoll 4
fudge 127.127.22.0 flag3 1 refid PPS
EOS

ntpq -p

watch -n 16 ntpq -crv -ccv -pn