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
Just wondered if this is unique to the Adafruit GPS Module or would work with a USB GPS dongle? When my USB GPS has worked I have normally set up /etc/default/gpsd with DEVICES="/dev/ttyACM0"
Ihoujin wrote: Yes you can. I have my Pi setup to correctly set the system time from GPS. It is a little bit of work to set up. You need GPSD and NTP. The tricky part is configuring GPSD to use the signal time when is greater than 1000 seconds off of the system time.
Install GPSD and NTP and optionally some additional tools.
*Disclaimer, it has been some time since I last set this up and I may miss something below.
hy wrote: The easiest, but of course least elegant answer, though is that you can set the time manually (each time you boot).
I have no RTC nor GPS, but rarely use it in the field. When I do, I look at my phone, and then type something like the following
sudo date -s "10 feb 2012 8:57pm"
I believe that's right, but unfortunately I can't test right now.
Google search seems to confirm, e.g.
I have just made a new installation from the AstroPi3 script on Raspbian (newly updated to 3.2). This does not behave like the older version I have used for some months which did update the system time as well as the KStars time and geographic position from the USB GPS.
KillRoyCool wrote: When I launch KStars, my usb GPS is taken into account and changes the date and time but just for KStars. THE Raspberry is still the old date.
Avocette wrote: Just wondered if this is unique to the Adafruit GPS Module or would work with a USB GPS dongle? When my USB GPS has worked I have normally set up /etc/default/gpsd with DEVICES="/dev/ttyACM0"
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)