PROJET AUTOBLOG


shaarli-Links

Site original : shaarli-Links

⇐ retour index

How to Add a GPS Time Source to ntpd

samedi 22 février 2020 à 23:19
Pour avoir un raspberry hors ligne à l'heure :
sudo apt install gpsd gpsd-clients ntp
sudo sed -i 's|DEVICES=""|DEVICES="/dev/gps0"|' /etc/default/gpsd
sudo sed -i 's|GPSD_OPTIONS=""|GPSD_OPTIONS="-n"|' /etc/default/gpsd
sudo systemctl restart gpsd

# contrôle du GPS :
cgps -s

# NTP
echo "
# GPS Serial data reference
server 127.127.28.0 minpoll 4 maxpoll 4
fudge 127.127.28.0 time1 0.0 refid GPS

# GPS PPS reference
server 127.127.28.1 minpoll 4 maxpoll 4 prefer
fudge 127.127.28.1 refid PPS
" | sudo tee -a /etc/ntp.conf
sudo systemctl restart ntp
Permalink