Bi-monthly release with minor bug fixes and improvements
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
DEVICES="/dev/ttyS0 /dev/pps0"
GPSD_SOCKET="/var/run/gpsd.sock"
# Other options you want to pass to gpsd
GPSD_OPTIONS="-D 5 -n"
# Kernel-mode PPS ref-clock for the precise seconds
server 127.127.22.0 minpoll 4 maxpoll 4
fudge 127.127.22.0 refid PPS stratum 0
# Server from shared memory provided by gpsd
server 127.127.28.0 minpoll 4 maxpoll 4 prefer
fudge 127.127.28.0 refid NMEA stratum 3 time 1 0.000
[Time]
NTP=127.127.28.0
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
import os
import sys
import time
from gps import *
print 'Attempting to access GPS time...'
try:
gpsd = gps(mode=WATCH_ENABLE)
except:
print 'No GPS connection present. TIME NOT SET.'
sys.exit()
while True:
gpsd.next()
if gpsd.utc != None and gpsd.utc != '':
gpstime = gpsd.utc[0:4] + gpsd.utc[5:7] + gpsd.utc[8:10] + ' ' + gpsd.utc[11:19]
print 'Setting system time to GPS time...'
os.system('sudo date -u --set="%s"' % gpstime)
print 'System time set.'
sys.exit()
time.sleep(1)
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.