NTP Server mit OpenBSD
Robin (Diskussion | Beiträge) (→Konfiguration OpenNTP) |
Robin (Diskussion | Beiträge) (→OpenBSD Radio-Clocks) |
||
(9 dazwischenliegende Versionen von einem Benutzer werden nicht angezeigt) | |||
Zeile 2: | Zeile 2: | ||
= NTP Server mit OpenBSD = |
= NTP Server mit OpenBSD = |
||
− | Aufbau eines NTP Servers mit GPS und DCF-77 als Zeitquellen |
+ | '''Aufbau eines NTP Servers mit GPS und DCF-77 als Zeitquellen''' |
Warum OpenBSD? <br /> |
Warum OpenBSD? <br /> |
||
Zeile 46: | Zeile 46: | ||
= Installation OpenBSD = |
= Installation OpenBSD = |
||
− | Als Hardware kommt ein Futro S900 im UEFI Modus zum Einsatz: |
+ | Als Hardware kommt ein Futro S920 im UEFI Modus zum Einsatz: |
OpenBSD 7.4 (GENERIC.MP) #1397: Tue Oct 10 09:02:37 MDT 2023 |
OpenBSD 7.4 (GENERIC.MP) #1397: Tue Oct 10 09:02:37 MDT 2023 |
||
Zeile 54: | Zeile 54: | ||
random: good seed from bootblocks |
random: good seed from bootblocks |
||
mpath0 at root |
mpath0 at root |
||
− | scsibus0 at mpath0: 256 targetsefibootmgr --create \ |
+ | scsibus0 at mpath0: 256 targets |
− | --disk /dev/sda \ |
||
− | --part 1 \ |
||
− | --label 'OpenBSD' \ |
||
− | --loader '\EFI\OPENBSD\BOOTX64.EFI' |
||
mainbus0 at root |
mainbus0 at root |
||
bios0 at mainbus0: SMBIOS rev. 2.8 @ 0xad900018 (55 entries) |
bios0 at mainbus0: SMBIOS rev. 2.8 @ 0xad900018 (55 entries) |
||
Zeile 166: | Zeile 166: | ||
hw.sensors.nmea0.indicator0=On (Signal), OK |
hw.sensors.nmea0.indicator0=On (Signal), OK |
||
hw.sensors.nmea0.timedelta0=0.032213 secs (GPS autonomous), OK, Sun Feb 11 13:42:19.032 |
hw.sensors.nmea0.timedelta0=0.032213 secs (GPS autonomous), OK, Sun Feb 11 13:42:19.032 |
||
− | hw.sensors.nmea0.angle0=48.3665 degrees (Latitude), OK |
+ | hw.sensors.nmea0.angle0=xx.3665 degrees (Latitude), OK |
− | hw.sensors.nmea0.angle1=10.8413 degrees (Longitude), OK |
+ | hw.sensors.nmea0.angle1=yy.8413 degrees (Longitude), OK |
hw.sensors.nmea0.distance0=502.100 m (Altitude), OK |
hw.sensors.nmea0.distance0=502.100 m (Altitude), OK |
||
hw.sensors.nmea0.velocity0=0.138 m/s (Ground speed), OK |
hw.sensors.nmea0.velocity0=0.138 m/s (Ground speed), OK |
||
Zeile 189: | Zeile 189: | ||
wichtig ist die Zeile "sensor *" |
wichtig ist die Zeile "sensor *" |
||
− | Der Offset muss für Sensoren noch eingestellt und die anderen NTP-Server deaktiviert werden: |
+ | Der Offset muss für die Sensoren noch eingestellt und die anderen NTP-Server deaktiviert werden: |
# ntpctl -s all |
# ntpctl -s all |
||
Zeile 215: | Zeile 215: | ||
* http://ftplist1.openbsd.org/papers/radio-clocks-asiabsdcon07.pdf |
* http://ftplist1.openbsd.org/papers/radio-clocks-asiabsdcon07.pdf |
||
* https://www.uoga.net/posts/stratum_1_ntp_server_on_openbsd/ |
* https://www.uoga.net/posts/stratum_1_ntp_server_on_openbsd/ |
||
+ | |||
+ | == Unterstütze DCF-77 Empfänger == |
||
+ | |||
+ | * https://man.openbsd.org/udcf |
||
+ | * https://man.openbsd.org/mbg |
||
+ | * https://man.openbsd.org/umbg |
||
= DCF-77 Empfänger = |
= DCF-77 Empfänger = |
||
+ | |||
+ | Einige DCF-77 Empfänger, Preise unbekannt. |
||
+ | |||
+ | * https://www.neol.com/de/produkte/neoclock/neoclock-twin-dcf/ |
||
+ | * https://www.nis-time.de/de/dcf-filterantenne-fuer-aussenbereich-2024.html |
||
+ | * https://www.atomic-clock.galleon.eu.com/pc-atomic-clock.html |
||
+ | * https://www.hkw-elektronik.de/produkte/empfangstechnik-am/pc-funkuhren/ |
||
+ | * https://www.meinberg.de/german/products/usb-dcf77-uhr.htm |
||
+ | |||
+ | = NTPD Treiber = |
||
+ | |||
+ | * https://ntp.org/documentation/drivers/ |
||
+ | * https://www.ntp.org/documentation/drivers/driver8/ # Für DCF-77 |
||
+ | * https://www.ntp.org/documentation/drivers/driver44/ # Für Neoclock |
||
+ | |||
+ | Unter FreeBSD 13.2-RELEASE-p2 tritt folgender Fehler beim Lesen des DCF-77 Signals auf: |
||
+ | |||
+ | PARSE receiver #0: parse_start: parse_setfmt() FAILED. |
||
+ | |||
+ | Siehe auch: |
||
+ | |||
+ | * https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=202362 |
||
+ | |||
+ | = NTP Infos = |
||
+ | |||
+ | * https://www.openbsd.org/openntpd/ |
||
+ | * https://www.ntpsec.org/ |
||
+ | * https://www.ntp.org/ |
||
+ | * https://chrony-project.org/ |
Aktuelle Version vom 19. Februar 2024, 19:44 Uhr
Inhaltsverzeichnis |
[Bearbeiten] NTP Server mit OpenBSD
Aufbau eines NTP Servers mit GPS und DCF-77 als Zeitquellen
Warum OpenBSD?
Ich habe z. Z. (Anfang 2024) keine preisgünstigen DCF-77 Empfänger für den PC (mit RS-232 oder USB-Schnittstelle) gefunden.
Ich habe eine gebrauchten "Gude ADS Expert mouseClock USB rev 1.10" Empfänger erworben. Für diesen Empfänger hat OpenBSD einen Treiber.
Der Linux Treiber für den "Gude ADS Expert mouseClock USB rev 1.10" gibt es im Quelltext für den Linux Kernel 2.6.x. Dieser lässt sich nicht ohne größere Anpassungen an einen aktuellen Kernel (6.6.x) compilieren.
Siehe z. B.: https://forum.ubuntuusers.de/topic/gude-dcf77-funkuhr-usb-version-1-unter-precise/
Der "Gude ADS Expert mouseClock USB rev 1.10" Empfänger verfügt über einen Cologne (https://colognechip.com/) USB-Seriell Chip.
- https://github.com/openbsd/src/blob/634073900323bdd83ca3b5eb0732098812c0aa24/sys/dev/usb/udcf.c#L302
Der Treiber für OpenBSD lautet:
[Bearbeiten] Eigenbau DCF-77 Empfänger
Ich habe versucht mit diesem DCF-77 Modul einen Empfänger für den PC (an RS-232 Schnittstelle) zu bauen:
https://de.elv.com/dcf-empfangsmodul-dcf-2-091610
Leider werden keine gültigen Daten empfangen mit dem NTPD unter Linux:
2024-02-10T18:32:59.809013+01:00 ntp-srv ntpd[8972]: ERR: parse: convert_rawdcf: parity check FAILED for "###############RADMLS1248124P124812P1248121241248112481248P" 2024-02-10T18:33:59.819556+01:00 ntp-srv ntpd[8972]: ERR: parse: convert_rawdcf: parity check FAILED for "###############RADMLS1248124P124812P1248121241248112481248P" 2024-02-10T18:35:59.816957+01:00 ntp-srv ntpd[8972]: ERR: parse: convert_rawdcf: INCOMPLETE DATA - time code only has 56 bits
Mit der Schnittstelle eines Rasperry Pi funktioniert es.
- https://blog.debuglevel.de/raspberry-pi-und-dcf77-empfaenger-von-conrad/
- https://weberblog.net/ntp-server-via-dcf77-on-a-raspberry-pi/
- https://do5fdr.darc.de/dcf77.html (Über Seriell-USB Wandler am PC)
Möglicherweise ist eine weitere Beschaltung nötig:
[Bearbeiten] Installation OpenBSD
Als Hardware kommt ein Futro S920 im UEFI Modus zum Einsatz:
OpenBSD 7.4 (GENERIC.MP) #1397: Tue Oct 10 09:02:37 MDT 2023 deraadt@amd64.openbsd.org:/usr/src/sys/arch/amd64/compile/GENERIC.MP real mem = 3931086848 (3748MB) avail mem = 3792220160 (3616MB) random: good seed from bootblocks mpath0 at root scsibus0 at mpath0: 256 targets mainbus0 at root bios0 at mainbus0: SMBIOS rev. 2.8 @ 0xad900018 (55 entries) bios0: vendor FUJITSU // American Megatrends Inc. version "V4.6.5.4 R1.18.0 for D3313-A1x" date 07/10/2018 bios0: FUJITSU FUTRO S920 efi0 at bios0: UEFI 2.3.1 efi0: American Megatrends rev 0x4028e acpi0 at bios0: ACPI 5.0 acpi0: sleep states S0 S3 S4 S5 acpi0: tables DSDT FACP APIC FPDT MCFG HPET VFCT SSDT SSDT CRAT SSDT SSDT SSDT SSDT acpi0: wakeup devices LAN1(S4) LAN2(S4) SBAZ(S4) OHC1(S4) EHC1(S4) OHC2(S4) EHC2(S4) OHC3(S4) EHC3(S4) XHC0(S4) GFX_(S3) acpitimer0 at acpi0: 3579545 Hz, 32 bits acpimadt0 at acpi0 addr 0xfee00000: PC-AT compat cpu0 at mainbus0: apid 0 (boot processor) cpu0: AMD GX-415GA SOC with Radeon(tm) HD Graphics, 1497.25 MHz, 16-00-01, patch 07000110 cpu0: FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,MMX,FXSR,SSE,SSE2,HTT,SSE3,PCLMUL,MWAIT,SSSE3,CX16,SSE4.1,SSE4.2,MOVBE,POPCNT,AES,XSAVE,AVX,F16C,NXE,MMXX,FFXSR,PAGE1GB,RDTSCP,LONG,LAHF,CMPLEG,SVM,EAPICSP,AMCR8,ABM,SSE4A,MASSE,3DNOWP,OSVW,IBS,S KINIT,TOPEXT,DBKP,PCTRL3,HWPSTATE,ITSC,BMI1,IBPB,XSAVEOPT cpu0: 32KB 64b/line 8-way D-cache, 32KB 64b/line 2-way I-cache, 2MB 64b/line 16-way L2 cache cpu0: smt 0, core 0, package 0 mtrr: Pentium Pro MTRR support, 8 var ranges, 88 fixed ranges cpu0: apic clock running at 99MHz cpu0: mwait min=64, max=64, IBE cpu1 at mainbus0: apid 1 (application processor) cpu1: AMD GX-415GA SOC with Radeon(tm) HD Graphics, 1497.29 MHz, 16-00-01, patch 07000110 cpu1: FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,MMX,FXSR,SSE,SSE2,HTT,SSE3,PCLMUL,MWAIT,SSSE3,CX16,SSE4.1,SSE4.2,MOVBE,POPCNT,AES,XSAVE,AVX,F16C,NXE,MMXX,FFXSR,PAGE1GB,RDTSCP,LONG,LAHF,CMPLEG,SVM,EAPICSP,AMCR8,ABM,SSE4A,MASSE,3DNOWP,OSVW,IBS,SKINIT,TOPEXT,DBKP,PCTRL3,HWPSTATE,ITSC,BMI1,IBPB,XSAVEOPT cpu1: 32KB 64b/line 8-way D-cache, 32KB 64b/line 2-way I-cache, 2MB 64b/line 16-way L2 cache cpu1: smt 0, core 1, package 0 cpu2 at mainbus0: apid 2 (application processor) cpu2: AMD GX-415GA SOC with Radeon(tm) HD Graphics, 1497.40 MHz, 16-00-01, patch 07000110 cpu2: FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,MMX,FXSR,SSE,SSE2,HTT,SSE3,PCLMUL,MWAIT,SSSE3,CX16,SSE4.1,SSE4.2,MOVBE,POPCNT,AES,XSAVE,AVX,F16C,NXE,MMXX,FFXSR,PAGE1GB,RDTSCP,LONG,LAHF,CMPLEG,SVM,EAPICSP,AMCR8,ABM,SSE4A,MASSE,3DNOWP,OSVW,IBS,SKINIT,TOPEXT,DBKP,PCTRL3,HWPSTATE,ITSC,BMI1,IBPB,XSAVEOPT cpu2: 32KB 64b/line 8-way D-cache, 32KB 64b/line 2-way I-cache, 2MB 64b/line 16-way L2 cache cpu2: smt 0, core 2, package 0 cpu3 at mainbus0: apid 3 (application processor) cpu3: AMD GX-415GA SOC with Radeon(tm) HD Graphics, 1497.48 MHz, 16-00-01, patch 07000110 cpu3: FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,MMX,FXSR,SSE,SSE2,HTT,SSE3,PCLMUL,MWAIT,SSSE3,CX16,SSE4.1,SSE4.2,MOVBE,POPCNT,AES,XSAVE,AVX,F16C,NXE,MMXX,FFXSR,PAGE1GB,RDTSCP,LONG,LAHF,CMPLEG,SVM,EAPICSP,AMCR8,ABM,SSE4A,MASSE,3DNOWP,OSVW,IBS,SKINIT,TOPEXT,DBKP,PCTRL3,HWPSTATE,ITSC,BMI1,IBPB,XSAVEOPT cpu3: 32KB 64b/line 8-way D-cache, 32KB 64b/line 2-way I-cache, 2MB 64b/line 16-way L2 cache cpu3: smt 0, core 3, package 0 ioapic0 at mainbus0: apid 5 pa 0xfec00000, version 21, 24 pins ioapic1 at mainbus0: apid 6 pa 0xfec01000, version 21, 32 pins acpimcfg0 at acpi0 acpimcfg0: addr 0xe0000000, bus 0-255 acpihpet0 at acpi0: 14318180 Hz
OpenBSD 7.4 ließ sich fehlerfrei installieren, die UEFI Firmware fand aber das installierte Betriebssystem nicht.
Ein Veruch OpenBSD im BIOS-Modus (mit CSM-Modul) zu installieren ergab folgenden Fehler.
failed to install bootblocks
Versuch:
installboot -v sd0 /usr/mdec/biosboot: no such file or directory
Eine suche im Netz ergab, das OpenBSD keinen Boot-Eintrag in der UEFI Firmware macht. Das ist für mich nicht ganz nachvollziehbar, weil OpenBSD das einzig installierte Betriebssystem ist.
- https://ackstorm.de/posts/uefi-openbsd-fedora-dual-boot.html
- https://lowendunix.com/openbsd-multibooting-gpt/
Nach der Installation von OpenBSD im UEFI-Modus habe ich ein Linux Live-Image gebootet und den Boot Eintrag vorgenommen:
efibootmgr --create --label "OpenBSD" --loader "\efi\boot\bootx64.efi"
Bzw.:
efibootmgr --create \ --disk /dev/sda \ --part 1 \ --label 'OpenBSD' \ --loader '\EFI\OPENBSD\BOOTX64.EFI'
Die UEFI Partition und den Bootloader hatte OpenBSD erstellt bzw. kopiert.
Anschließend startet OpenBSD einwandfrei.
[Bearbeiten] Konfiguration DCF-77 Empfänger
Der "Gude ADS Expert mouseClock USB rev 1.10" Empfänger wird unter OpenBSD erkannt:
udcf0 at uhub3 port 1 configuration 1 interface 0 "Gude ADS Expert mouseClock USB" rev 1.10/1.00 addr 2
Der Status kann folgendermaßen abgefragt werden:
# sysctl hw.sensors.udcf0 hw.sensors.udcf0.timedelta0=-0.005913 secs (DCF77), OK, Sun Feb 11 13:34:59.994
[Bearbeiten] Konfiguration GPS Empfänger
Anleitung dazu:
Die GPS Maus wird erkannt:
umodem0 at uhub3 port 3 configuration 1 interface 0 "u-blox AG - www.u-blox.com u-blox 7 - GPS/GNSS Receiver" rev 1.10/1.00 addr 3 umodem0: data interface 1, has CM over data, has no break umodem0: status change notification available ucom0 at umodem0: usb3.0.00003.1
Anpassen der Datei /etc/ttys
cuaU0 "/sbin/ldattach nmea" unknown on softcar
Dann Einlesen der Datei /etc/ttys anstoßen mit:
kill -s HUP 1
Dann sind die Werte über das Sensorframework verfügbar:
# sysctl hw.sensors.nmea0 hw.sensors.nmea0.indicator0=On (Signal), OK hw.sensors.nmea0.timedelta0=0.032213 secs (GPS autonomous), OK, Sun Feb 11 13:42:19.032 hw.sensors.nmea0.angle0=xx.3665 degrees (Latitude), OK hw.sensors.nmea0.angle1=yy.8413 degrees (Longitude), OK hw.sensors.nmea0.distance0=502.100 m (Altitude), OK hw.sensors.nmea0.velocity0=0.138 m/s (Ground speed), OK
[Bearbeiten] Konfiguration OpenNTP
Konfiguration des
cat /etc/ntpd.conf # $OpenBSD: ntpd.conf,v 1.16 2019/11/06 19:04:12 deraadt Exp $ # # See ntpd.conf(5) and /etc/examples/ntpd.conf # servers pool.ntp.org # server time.cloudflare.com # # sensor *
wichtig ist die Zeile "sensor *"
Der Offset muss für die Sensoren noch eingestellt und die anderen NTP-Server deaktiviert werden:
# ntpctl -s all 3/3 peers valid, 2/2 sensors valid, constraint offset -1s, clock synced, stratum 3 peer wt tl st next poll offset delay jitter 194.58.200.20 ntp.netnod.se 1 10 1 220s 283s 23.377ms 44.125ms 4.836ms 194.0.5.123 any.time.nl * 1 10 2 90s 270s 19.690ms 16.949ms 0.606ms 141.84.9.197 ntp3.lrz.de 1 10 1 103s 274s 13.895ms 41.654ms 1.145ms sensor wt gd st next poll offset correction udcf0 1 1 0 9s 15s -3.620ms 0.000ms nmea0 1 1 0 9s 15s -29.806ms 0.000ms
[Bearbeiten] OpenBSD Radio-Clocks
- https://www.openbsd.org/papers/eurobsdcon07/mbalmer-radio_clocks.pdf
- http://ftplist1.openbsd.org/papers/radio-clocks-asiabsdcon07.pdf
- https://www.uoga.net/posts/stratum_1_ntp_server_on_openbsd/
[Bearbeiten] Unterstütze DCF-77 Empfänger
[Bearbeiten] DCF-77 Empfänger
Einige DCF-77 Empfänger, Preise unbekannt.
- https://www.neol.com/de/produkte/neoclock/neoclock-twin-dcf/
- https://www.nis-time.de/de/dcf-filterantenne-fuer-aussenbereich-2024.html
- https://www.atomic-clock.galleon.eu.com/pc-atomic-clock.html
- https://www.hkw-elektronik.de/produkte/empfangstechnik-am/pc-funkuhren/
- https://www.meinberg.de/german/products/usb-dcf77-uhr.htm
[Bearbeiten] NTPD Treiber
- https://ntp.org/documentation/drivers/
- https://www.ntp.org/documentation/drivers/driver8/ # Für DCF-77
- https://www.ntp.org/documentation/drivers/driver44/ # Für Neoclock
Unter FreeBSD 13.2-RELEASE-p2 tritt folgender Fehler beim Lesen des DCF-77 Signals auf:
PARSE receiver #0: parse_start: parse_setfmt() FAILED.
Siehe auch: