Automatic update - NTP

The gateway will automatically update it's time through the Network Time Protocol (NTP).

NTP pool

By default, NTP synchronized with the NTP Pool. The most adequate server of the worldwide pool will be chosen to synchronize the time. You need access to the Internet to use the NTP pool.

Custom NTP server

You can configure the NTP client to contact a custom NTP server available in your network. This will be necessary if the gateway is not connected to the Internet.

The gateway will automatically use NTP servers given by the DHCP server (option 42). 


You can configure the server address in the /etc/chrony.conf file:

sudo nano /etc/chrony.conf
BASH
# Use public NTP servers from the pool.ntp.org project.
# Please consider joining the pool project if possible by running your own
# server(s).
# If you are a vendor distributing a product using chrony, you *MUST*
# read and comply with http://www.pool.ntp.org/vendors.html
pool 0.openembedded.pool.ntp.org iburst

# Use a local timeserver in preference to the pool, if it's reachable.
#server 192.168.22.22 iburst minpoll 2 prefer

# Sync to pulse-per-second from an onboard GPS.
#refclock PPS /dev/pps0 poll 0 prefer
# You'll want to enable CONFIG_PPS and CONFIG_PPS_CLIENT_GPIO in your kernel,
# and an entry something like this in your device tree:
# pps {
# compatible = "pps-gpio";
# gpios = <&ps7_gpio_0 56 0>;
# };

# In first three updates step the system clock instead of slew
# if the adjustment is larger than 1 second.
makestep 1.0 3
Uncomment the line and set the correct IP. Then restart the NTP client Chrony.
sudo rc-service chronyd restart
BASH
chronyd | * Stopping chronyd ... [ ok ]
chronyd | * Starting chronyd ... [ ok ]

Getting the server from the DHCP server

If your DHCP server defines the NTP servers (option 42), those servers will be automatically assigned to NTP for time synchronization.

Manual setting

You should not configure the date and time yourself, but rather configure the timezone and/or the NTP client who will update the time automatically. The gateway time will drift and you will lose precision if it's not synchronized!

You can set the date and time with the date program:

date -s "19 APR 2019 11:14:00"
BASH

You can find details about the date program and the syntax of the date/time string on the date man page.