Gerardo's Notes

Chrony @ UG

To synchronise the control room and robot computers, install chrony on each computer using:

sudo apt-get install chrony

Afterwards, one needs to edit the configuration file located at "/etc/chrony/chrony.conf" on each computer. An example of each configuration file is shown below:

Control room computer (MASTER)
NOTE 1: Date is set manually and it is not updated using an external server
NOTE 2: At UG, each computer is connected to a different DNS, so it is necessary to specify the XXX.XXX.0.0 subnet

manual on
keyfile /etc/chrony/chrony.keys
commandkey 1
driftfile /var/lib/chrony/chrony.drift
log tracking measurements statistics
logdir /var/log/chrony
maxupdateskew 100.0
dumponexit
dumpdir /var/lib/chrony
local stratum 10
allow +XXX.XXX.XXX.0+ *(<--- Gateaway for both computers)*
allow +XXX.XXX.XXX.XXX+ *(<--- IP address of the slave machine)*
allow +XXX.XXX.XXX.0+ *(<--- Subnet of the slave machine)*
allow +XXX.XXX.0.0+ *(<--- Subnet for both computers)*
logchange 0.5 
rtconutc

Robot computer (SLAVE)

commandkey 1
#manual on
cmdallow 130.209.244.190
pidfile /var/run/chrony-internal.pid
server +XXX.XXX.XXX.XXX+ minpoll 3 maxpoll 15 maxdelay .010 *(<--- IP address of the master computer)*
initstepslew 0 +XXX.XXX.XXX.XXX+ *(<--- IP address of the master computer)*
keyfile /etc/chrony/chrony.keys
commandkey 1
driftfile /var/lib/chrony/chrony.drift
log tracking measurements statistics
logdir /var/log/chrony
maxupdateskew 100.0
dumponexit
dumpdir /var/lib/chrony
local stratum 10
allow +XXX.XXX.XXX.XXX+ *(<--- IP address of the master computer)*
logchange 0.5
rtconutc

In order to synchronise both computers using the above configuration files, one needs to restart the daemon in both computers as follows:

sudo invoke-rc.d chrony restart

To verify that chrony synchronises both computers, type the following

MASTER computer

$ chronyc clients
Hostname          Client  Peer CmdAuth CmdNorm  CmdBad  LstN  LstC
====================================================================
localhost           0      0      2       2        0     43y   0
SLAVE address      150     0      0       0        0     64m   43y

SLAVE computer

$ chronyc tracking
Reference ID     : IP Address (MASTER)
Stratum          : 11
Ref time (UTC)   : **DATE**
System time      : 0.000000096 seconds slow of NTP time
Frequency        : 26.474 ppm fast
Residual freq    : 0.001 ppm
Skew             : 0.019 ppm
Root delay       : 0.000732 seconds
Root dispersion  : 0.000005 seconds

$ chronyc sources
210 Number of sources = 1
MS Name/IP address           Stratum Poll LastRx Last sample
============================================================================
^* MASTER hostname             10    12    160   +35us[ +103us] +/-  368us