Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
tools:time [2022/08/22 13:17]
darron [Resources]
tools:time [2024/05/06 15:50] (current)
darron [NTP]
Line 151: Line 151:
 </code> </code>
    
 +NB ntpq and ntptime are part of [[tools:time#ntp|ntp]].
 +
 +
 ===PPS=== ===PPS===
  
Line 227: Line 230:
 __systemd__ __systemd__
  
-systemd hijacks the GPSD socket so you will need to try a few things+systemd hijacks the GPSD socket (like inetd) so you will need to try a few things
 to resolve this. to resolve this.
  
Line 448: Line 451:
 <code> <code>
 apt install ntp ntpdate apt install ntp ntpdate
 +</code>
 +
 +<code>
 /etc/init.d/ntp stop /etc/init.d/ntp stop
 update-rc.d ntp disable update-rc.d ntp disable
 </code> </code>
  
-==Config==+__Bookworm__ 
 + 
 +<code> 
 +/etc/init.d/ntpsec stop 
 +update-rc.d ntpsec disable 
 +</code> 
 + 
 +<code> 
 +systemctl stop ntpd 
 +systemctl disable ntpd 
 +systemctl mask ntpd 
 +</code> 
 + 
 +==Master config==
  
 <code> <code>
Line 478: Line 497:
 #restrict 192.168.0.0 mask 255.255.255.0 notrust #restrict 192.168.0.0 mask 255.255.255.0 notrust
  
-#broadcast 192.168.0.255 +broadcast 192.168.0.255 
-#disable auth +disable auth
-#broadcastclient+
  
 # https://doc.ntp.org/documentation/4.2.8-series/clockopt/ # https://doc.ntp.org/documentation/4.2.8-series/clockopt/
Line 506: Line 524:
 server 127.127.28.2 server 127.127.28.2
 fudge 127.127.28.2 flag1 1 refid PTP fudge 127.127.28.2 flag1 1 refid PTP
 +</code>
 +
 +==Slave config==
 +
 +<code>
 +leapfile /usr/share/zoneinfo/leap-seconds.list
 +
 +statsdir /var/log/ntpstats/
 +statistics loopstats peerstats clockstats rawstats
 +filegen loopstats  file loopstats  type day enable
 +filegen peerstats  file peerstats  type day enable
 +filegen clockstats file clockstats type day enable
 +filegen rawstats   file rawstats   type day enable
 +
 +#server ntp.example.com
 +broadcastclient
 +disable auth
 </code> </code>
  
Line 550: Line 585:
 option is to find other sample devices to test and prefer. option is to find other sample devices to test and prefer.
  
 +The first character of each peer line above is called the ntp tally code.
 +<code>
 +Code  Message               Description
 +0     sel_reject              discarded as not valid (TEST10-TEST13)
 +1     sel_falsetick         discarded by intersection algorithm
 +2     sel_excess      .       discarded by table overflow (not used)
 +3     sel_outlier           discarded by the cluster algorithm
 +4     sel_candidate         included by the combine algorithm
 +5     sel_backup      #       backup (more than tos maxclock sources)
 +6     sel_sys.peer    *       system peer
 +7     sel_pps.peer    o       PPS peer (when the prefer peer is valid)
 +</code>
 +
 +==Debug==
 +
 +<code>
 +apt install tcpdump && rehash
 +tcpdump -ni wlan0 port 123 and udp
 +</code>
 ===PTP=== ===PTP===
  
Line 576: Line 630:
  
 <code> <code>
-ptpd -C -s -i wlan0+ptpd -C -s -i eth0
 </code> </code>
  
Line 590: Line 644:
  
 <code> <code>
-ptpengine:interface=wlan0+ptpengine:interface=eth0
 ptpengine:ip_mode=multicast ptpengine:ip_mode=multicast
 ptpengine:use_libpcap=n ptpengine:use_libpcap=n
Line 636: Line 690:
 ptpd2 version 2.3.1 ptpd2 version 2.3.1
 </code> </code>
- 
  
 ==Linux PTP== ==Linux PTP==
 +
 +This service requires driver support of transmit and receive
 +of timestamps. Not all drivers support this.
 +
 +Check with ethtool -T
  
 __Install__ __Install__
Line 644: Line 702:
 <code> <code>
 apt install linuxptp apt install linuxptp
 +systemctl stop timemaster
 +systemctl disable timemaster
 +systemctl mask timemaster
 </code> </code>
  
 +More later...
 ===Resources=== ===Resources===
  
Line 655: Line 717:
  
 [[https://sourceforge.net/projects/ptpd/|PTPD version 2 on SourceForge]] [[https://sourceforge.net/projects/ptpd/|PTPD version 2 on SourceForge]]
 +
 +[[http://linuxptp.sourceforge.net/|Linux PTP]]