Radarcape:Radarcape Major 2 NTPD Installation: Difference between revisions

From Beast Wiki
Jump to navigation Jump to search
imported>Dl4mea
imported>Nunojpg
 
(4 intermediate revisions by one other user not shown)
Line 1: Line 1:
=Major 2 Related Pages=
#REDIRECT [[Radarcape:NTP#NTP_stratum_1_server]]
 
[[Radarcape:Software_Features_Major2|Radarcape Major 2 Features]]
 
[[Radarcape:Radarcape_Major_2_Feeder_Installation|Radarcape Major 2 Feeder Installation]]
 
[[Radarcape:Radarcape_Major_2_NTPD_Installation|Radarcape Major 2 NTP Installation]]
 
=Radarcape Major 2 NTPD Installation=
 
This information was provided by a user, I will beautify it a little but need to redo it on a Radarcape for that.
 
==Setup for Chrony==
 
Activate Chrony socket under Radarcape configuration menu:
Radarcape Settings -> General -> NTP Reference Clock Data
Publish time to socket for Chrony: Enabled (Socket: /var/run/chrony.radarcape.sock)
Publish time to shared memory for NTPD or Chrony: Enabled (SHM segment: 0)
 
$ sudo apt-get update
$ sudo apt-get install build-essential texinfo pps-tools
$ wget https://download.tuxfamily.org/chrony/chrony-3.1.tar.gz
$ tar xfz chrony-3.1.tar.gz
$ cd chrony-3.1
$ ./configure
$ make
$ sudo make install
$ sudo bash -c "sudo cat >> /etc/chrony.conf <<- EOF
minsamples 10
log tracking measurements statistics
logdir /var/log/chrony
driftfile /var/lib/chrony/chrony.drift
maxupdateskew 100.0
dumponexit
dumpdir /var/lib/chrony
 
pool pool.ntp.org iburst
refclock PPS /dev/pps0 lock RCD prefer
refclock SOCK /var/run/chrony.radarcape.sock offset 0.0 delay 0.0 refid RCD noselect
EOF"
$ sudo /usr/local/sbin/chronyd -f /etc/chrony.conf -s
 
# chronyc sources
210 Number of sources = 6
MS Name/IP address        Stratum Poll Reach LastRx Last sample             
===============================================================================
#* PPS0                          0  4  377    22  +501ns[ +765ns] +/-  694ns
#? RCD                          0  4  377    21    +20ms[  +20ms] +/-  27us
^- goblin.yuhu.biz              3  6  377    19  -1272us[-1272us] +/-  107ms
^- 212.70.148.20                2  6  377    20  -534us[ -534us] +/-  33ms
^- 212.70.148.13                2  6  377    20    +86us[  +86us] +/-  48ms
^- 89.190.220.94                3  6  377    18  -668us[ -668us] +/-  73ms
------------------------------
 
 
==Setup for NTPD==
 
# sudo apt-get install build-essential texinfo pps-tools cpufrequtils libcap-dev
# systemctl disable ondemand
# echo 'GOVERNOR="performance"' > /etc/default/cpufrequtils
# systemctl restart cpufrequtils
# cat /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor
performance
# ppstest /dev/pps0 # Use Ctrl+C to stop;
trying PPS source "/dev/pps0"
found PPS source "/dev/pps0"
ok, found 1 source(s), now start fetching data...
source 0 - assert 1495808693.999994810, sequence: 119877 - clear  0.000000000, sequence: 0
source 0 - assert 1495808694.999994736, sequence: 119878 - clear  0.000000000, sequence: 0
source 0 - assert 1495808696.000003486, sequence: 119879 - clear  0.000000000, sequence: 0
source 0 - assert 1495808697.000012458, sequence: 119880 - clear  0.000000000, sequence: 0
source 0 - assert 1495808697.999984217, sequence: 119881 - clear  0.000000000, sequence: 0
^C
 
# wget http://www.eecis.udel.edu/~ntp/ntp_spool/ntp4/ntp-4.2/ntp-4.2.8p7.tar.gz
# tar zxvf ntp-4.2.8p7.tar.gz
# cd ntp-4.2.8p7
# ./configure --enable-linuxcaps --enable-SHM --with-NMEA --with-ATOM
# make -j4
# sudo make install
# mkdir /var/lib/ntp/
# touch /var/lib/ntp/ntp.drift
# sudo bash -c "sudo cat >> /etc/ntp.conf <<- EOF
driftfile /var/lib/ntp/ntp.drift
leapfile /etc/ntp/leap-seconds.list
#statsdir /var/log/ntpstats/
statistics loopstats peerstats clockstats
filegen loopstats file loopstats type day enable
filegen peerstats file peerstats type day enable
filegen clockstats file clockstats type day enable
 
pool bg.pool.ntp.org iburst
server 192.168.10.9  minpoll 5 maxpoll 5 iburst prefer
 
# SHM reference
server 127.127.28.0 minpoll 4 maxpoll 4 prefer
fudge 127.127.28.0 time1 0.0 refid GPS stratum 15
 
# PPS reference
# flag3 - kernel PPS discipline: 0 for disable (default), 1 for enable
server 127.127.22.0 minpoll 4 maxpoll 4 prefer
fudge 127.127.22.0 flag3 1 refid PPS
EOF"
 
Start the NTPD daemon using:
# /usr/local/sbin/ntpd -c /etc/ntp.conf
 
Verify that it is running:
# ntpq -4nc peers
    remote          refid      st t when poll reach  delay  offset  jitter
==============================================================================
bg.pool.ntp.org .POOL.          16 p    -  64    0    0.000    0.000  0.004
*192.168.10.9    212.70.148.17    3 u    3  32  377    0.226    0.680  0.057
127.127.28.0    .GPS.          15 l    8  16  377    0.000  -19.901  0.037
o127.127.22.0    .PPS.            0 l    7  16  377    0.000    0.001  0.004
+212.70.148.19  80.96.120.252    2 u  66  64  377    2.028    0.041  0.326
+212.70.148.16  80.96.120.252    2 u  52  64  377  10.207  -1.061  0.292
+212.70.148.11  95.87.227.232    3 u  55  64  377    1.812  -1.852  0.582
-212.70.148.17  138.96.64.10    2 u  54  64  377    2.252  -2.698  0.470
+212.70.148.20  80.96.120.252    2 u  52  64  377    2.497  -0.073  0.233
+92.247.168.103  93.123.92.131    2 u  59  64  377    9.263    0.543  0.369
+85.11.191.119  87.120.164.97    2 u  60  64  377    2.503  -0.382  0.378
+93.123.92.131  .GPS.            1 u  49  64  377    2.438    0.156  0.483
 
You should see the lines ".GPS." and ".PPS." in the output of "ntpq -4nc peers", and the word "kern" should be present in the output of an ntpq -c rv command:
# ntpq -c rv 127.0.0.1
associd=0 status=011d leap_none, sync_pps, 1 event, kern,
version="ntpd [email protected] Fri May 26 13:47:39 UTC 2017 (2)",
processor="armv7l", system="Linux/4.1.18-ti-r57", leap=00, stratum=1,
precision=-18, rootdelay=0.000, rootdisp=1.015, refid=PPS,
reftime=dcd2b9bf.b5857be0  Fri, May 26 2017 14:27:11.709,
clock=dcd2b9c1.10280e44  Fri, May 26 2017 14:27:13.063, peer=40682, tc=4,
mintc=3, offset=-0.000793, frequency=-45.646, sys_jitter=0.003815,
clk_jitter=0.002, clk_wander=0.100

Latest revision as of 13:28, 5 August 2017