On board time management is done using NTP daemon (ntpd).
Time management is done using UTC time. There are other times scales usually used:
In Linux, the reference time is UTC time and that's the time scale used by NTP daemon and by GPS NMEA frames.
File: /etc/ntp.conf
To set system time, NTP daemon can be configured to use multiple sources. It will select the most accurate source.
To select GPS source, this should be written in /etc/ntp.conf
:
server 127.127.20.0 mode 65536 minpoll 4 prefer fudge 127.127.20.0 flag1 1 flag2 0 flag3 1 time1 0.0
If this is configured, NTP daemon will try to:
/dev/gps0
. GPS NMEA frames give UTC time with a second precision./dev/gpspps0
. Pulse Per Second signal is a very precise pulse received at beginning of each second.This can only work on Wirnetâ„¢ gateways with a GPS device.
In this configuration, NTP daemon will try to receive time information from a pool of NTP servers. Information between servers and gateway is exchanged using NTP protocol.
pool pool.ntp.org iburst
Local hardware clock remains the last solution if all other sources are not available. It is usually less precise than network or GPS time.
server 127.127.1.0 fudge 127.127.1.0 stratum 14
NTP daemon can also be configured to set TAI clock offset. To do that, it uses a leap file containing time of insertion of all seconds in UTC time. This file is usually downloaded from Internet (here for example). Leap seconds insertion is announced at least one month in advance so a well maintained system will have this information before insertion really occurs. In NTP daemon configuration, leap file is configured by this line:
leapfile /user/leap-seconds.list
TAI offset is not set directly when NTP daemon starts, it can take time.