VEHPI-12: Set time from GPS



Issue Information

Issue Type: New Feature
 
Priority: Major
Status: Closed

Reported By:
Ben Tasker
Assigned To:
Ben Tasker
Project: VehManPi (VEHPI)
Resolution: Done (2013-12-27 01:36:38)
Target version: 1.0,
Components: GPS , Core Classes ,

Created: 2013-12-12 19:24:23
Time Spent Working


Description
As the Pi doesn't have an onboard clock, need a reliable method of ensuring that the system time is correct.

Whilst the Wifi connectivity could be used to establish a connection to a NTP server, the availability of a connection can't be guaranteed.

Given that the GPS unit knows the exact time, need to implement something that takes this timestamp and adjusts the system time as needed.

Will obviously need a config variable to define how regularly this check runs


Toggle State Changes

Activity


Required configuration has been set in /etc/ntp.conf, however ntpq -p shows the reach as 0 so it's obviously failing to connect for some reason.
btasker changed status from 'Open' to 'In Progress'
Have managed to get to the bottom of why the GPS' time was unreachable for NTP.

GPSD writes the NMEA time into a Shared Memory segment (SHM) owned by root. Unfortunately someone (at some point) decided that it'd be wise to run NTP as user ntp rather than as root. As a result, NTP can't actually access the SHM and so can't retrieve the current date. The change, helpfully, was buried in NTPs init script so may well need reverting again if NTP is ever updated

Will still need to adjust the offset, but the system should now get a accurate time/date pretty shortly after boot, even when no connectivity is present.
btasker changed status from 'In Progress' to 'Resolved'
btasker added 'Done' to resolution
btasker changed status from 'Resolved' to 'Closed'