Radarcape:Radarcape Major 2 NTPD Installation: Difference between revisions

From Beast Wiki
Jump to navigation Jump to search
imported>Dl4mea
imported>Dl4mea
Line 18: Line 18:
Publish time to shared memory for NTPD or Chrony: Enabled (SHM segment: 0)
Publish time to shared memory for NTPD or Chrony: Enabled (SHM segment: 0)


<source lang="bash">
$ sudo apt-get update
$ sudo apt-get update
$ sudo apt-get install build-essential texinfo pps-tools
$ sudo apt-get install build-essential texinfo pps-tools
Line 52: Line 53:
^- 89.190.220.94                3  6  377    18  -668us[ -668us] +/-  73ms
^- 89.190.220.94                3  6  377    18  -668us[ -668us] +/-  73ms
------------------------------
------------------------------
</source>


==Setup for NTPD==
==Setup for NTPD==

Revision as of 10:17, 27 May 2017

Major 2 Related Pages

Radarcape Major 2 Features

Radarcape Major 2 Feeder 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

  1. sudo apt-get install build-essential texinfo pps-tools cpufrequtils libcap-dev
  2. systemctl disable ondemand
  3. echo 'GOVERNOR="performance"' > /etc/default/cpufrequtils
  4. systemctl restart cpufrequtils
  5. cat /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor

performance

  1. 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

  1. wget http://www.eecis.udel.edu/~ntp/ntp_spool/ntp4/ntp-4.2/ntp-4.2.8p7.tar.gz
  2. tar zxvf ntp-4.2.8p7.tar.gz
  3. cd ntp-4.2.8p7
  4. ./configure --enable-linuxcaps --enable-SHM --with-NMEA --with-ATOM
  5. make -j4
  6. sudo make install
  7. mkdir /var/lib/ntp/
  8. touch /var/lib/ntp/ntp.drift
  9. sudo bash -c "sudo cat >> /etc/ntp.conf <<- EOF

driftfile /var/lib/ntp/ntp.drift leapfile /etc/ntp/leap-seconds.list

  1. 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

  1. SHM reference

server 127.127.28.0 minpoll 4 maxpoll 4 prefer fudge 127.127.28.0 time1 0.0 refid GPS stratum 15

  1. PPS reference
  2. 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:

  1. /usr/local/sbin/ntpd -c /etc/ntp.conf

Verify that it is running:

  1. 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:

  1. 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