NTP Server mit Linux

Aus Port23Wiki
Wechseln zu: Navigation, Suche

Aufbau eines NTP Servers mit Linux mit DCF und GPS als Zeitquellen

Inhaltsverzeichnis

Linux Version

cat /etc/devuan_version 
daedalus


[    0.000000] Linux version 6.1.0-17-amd64 (debian-kernel@lists.debian.org) (gcc-12 (Debian 12.2.0-14) 12.2.0, GNU ld (GNU Binutils for Debia

n) 2.40) #1 SMP PREEMPT_DYNAMIC Debian 6.1.69-1 (2023-12-30)

[    0.000000] Command line: BOOT_IMAGE=/boot/vmlinuz-6.1.0-17-amd64 root=UUID=eb0e22d6-bf4c-46bf-b7dd-bc4a0a9ef1fc ro quiet
[    0.000000] BIOS-provided physical RAM map:

[    0.000000] efi: EFI v2.31 by American Megatrends
[    0.000000] efi: ACPI=0xac532000 ACPI 2.0=0xac532000 SMBIOS=0xae1e9a98 MOKvar=0xad793000 
[    0.000000] secureboot: Secure boot disabled
[    0.000000] SMBIOS 2.8 present.
[    0.000000] DMI: FUJITSU FUTRO S920/D3313-A1, BIOS V4.6.5.4 R1.18.0 for D3313-A1x 07/10/2018
[    0.000000] tsc: Fast TSC calibration using PIT
[    0.000000] tsc: Detected 1497.160 MHz processor
[    0.309340] smpboot: CPU0: AMD GX-415GA SOC with Radeon(tm) HD Graphics (family: 0x16, model: 0x0, stepping: 0x1)

DCF-77 Empfänger

[  373.128888] usb 5-1: new full-speed USB device number 5 using ohci-pci
[  373.337304] usb 5-1: New USB device found, idVendor=0403, idProduct=e88a, bcdDevice= 6.00
[  373.337333] usb 5-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[  373.337343] usb 5-1: Product: Expert mouseCLOCK USB II
[  373.337351] usb 5-1: Manufacturer: GUDEADS
[  373.337359] usb 5-1: SerialNumber: XXX
[  373.344527] ftdi_sio 5-1:1.0: FTDI USB Serial Device converter detected
[  373.344720] usb 5-1: Detected FT232R
[  373.351128] usb 5-1: FTDI USB Serial Device converter now attached to ttyUSB0

GPS Empfänger

[  320.052888] usb 5-4: new full-speed USB device number 4 using ohci-pci
[  320.247155] usb 5-4: New USB device found, idVendor=1546, idProduct=01a7, bcdDevice= 1.00
[  320.247183] usb 5-4: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[  320.247194] usb 5-4: Product: u-blox 7 - GPS/GNSS Receiver
[  320.247202] usb 5-4: Manufacturer: u-blox AG - www.u-blox.com
[  320.251377] cdc_acm 5-4:1.0: ttyACM1: USB ACM device

Konfiguration DCF-77 Empfänger

/etc/ntpsec/ntp.conf

server 127.127.8.0 mode 19 # 
server 127.127.8.0-3 mode 19
   Gude Analog- und Digitalsystem GmbH ‘Expert mouseCLOCK USB v2.0’
root@ntpsrv:~# ls -l /dev/refclock-0 
lrwxrwxrwx 1 root root 12 19. Feb 18:57 /dev/refclock-0 -> /dev/ttyUSB0

Konfiguration GPS Empfänger

cat /etc/default/gpsd 
# Start the gpsd daemon automatically at boot time
START_DAEMON="true"

# Devices gpsd should collect to at boot time.
# They need to be read/writeable, either by user gpsd or the group dialout.
DEVICES="/dev/ttyACM1"

# Other options you want to pass to gpsd
GPSD_OPTIONS="-n"

# Automatically hot add/remove USB GPS devices via gpsdctl
USBAUTO="true"
/etc/ntp/ntpsec.conf

# gps SHM from gpsd
server 127.127.28.0 

Doku

Offset für GPS unt DCF-77 noch NICHT eingestellt:

root@ntpsrv:~# ntpq -p
    remote                                   refid      st t when poll reach   delay   offset   jitter
=======================================================================================================
+ntp.netnod.se                           .PPS.            1 u   57   64   37  34.5104  13.1120   1.5906
+any.time.nl                             85.199.214.102   2 u   66   64   76  15.8433  12.8707   1.4686
RAWDCF_MOUSECLOCK(0)                    .DCFa.            0 l    7   64   17   0.0000   8.4088   2.2834
SHM(0)                                  .SHM.             0 l    7   64   77   0.0000 -46.5409   2.0497
Meine Werkzeuge