Configure NTP Client

I try to configure my device (raspberry Pi4/openhabian image 1.6.2) so that it gets the system time from my local fritz box.
In /etc/systemd/timesyncd.conf changing the line to

[Time]
NTP=fritz.box
#FallbackNTP=0.debian.pool.ntp.org 1.debian.pool.ntp.org 2.debian.pool.ntp.org 3.debian.pool.ntp.org

does not work. For any reason the device still gets the time from the fallback servers. Are there any overlay files or other config files I can check?

1 Like

the only thing i did different: because i use three fritz-boxes i inserted the ip-address instead of “fritz.box”. for me it seems to work, at least the time always is correct.

I did the same…
Could you please double check if it REALLY gets the time from your fritz.box with this command:

timedatectl show-timesync --all

and see what the value of ServerName is?

aah, thanks, this command i did not know, now i can confirm that it is working for me:

LinkNTPServers=
SystemNTPServers=xx.xx.xx.xx
FallbackNTPServers=0.debian.pool.ntp.org 1.debian.pool.ntp.org 2.debian.pool.ntp.org 3.debian.pool.ntp.org
ServerName=xx.xx.xx.xx
ServerAddress=xx.xx.xx.xx
RootDistanceMaxUSec=5s
PollIntervalMinUSec=32s
PollIntervalMaxUSec=34min 8s
PollIntervalUSec=4min 16s
NTPMessage={ Leap=0, Version=4, Mode=4, Stratum=3, Precision=-20, RootDelay=13.336ms, RootDispersion=16.937ms, Reference=C8DA29B, OriginateTimestamp=Sat 2021-01-09 13:55:34 CET, ReceiveTimestamp=Sat 2021-01-09 13:55:34 CET, TransmitTimestamp=Sat 2021-01-09 13:55:34 CET, DestinationTimestamp=Sat 2021-01-09 13:55:34 CET, Ignored=yes PacketCount=4, Jitter=949us }
Frequency=-485717

(pls excuse commenting out, xx.xx.xx.xx is the ip address of my fritzbox)

1 Like

thanks. Interesting to see…
are you still on OH2/openhabian 1.6.0?

for me it is now only working because I additionally set fritzbox as FallbackServer. OS refuses to accept primary NTP server.

SystemNTPServer is still empty:

LinkNTPServers=
SystemNTPServers=
FallbackNTPServers=192.168.178.1 fritz.box
ServerName=192.168.178.1
ServerAddress=192.168.178.1
RootDistanceMaxUSec=5s
PollIntervalMinUSec=32s
PollIntervalMaxUSec=34min 8s
PollIntervalUSec=2min 8s
1 Like

this is openhabian 1.6.2 with oh3.0.0 that i just fresh installed on a pi zero - for testing before i switch my running openhabian 2.5.5

i did not touch the fallback, only set the ip in the NTP-line

1.6.2 or 1.6.2b
I have so many problems with 1.6.2…

sorry don´t know the command to view version :see_no_evil:

i installed oh3 two weeks ago but have very big performance problems even only 1 binding is installed. works after new start slow but works for some hours and then always becomes slower until i do a reboot.

i suppose (and hope) it could be because the pi zero is too small - so i ordered a pi4-4gb but still did not receive it. i hope then things will become (much) better :slight_smile:

PI Zero should be fine.
My Pi4 is running at 0.1% CPU load
7 Bindings, 40 Things, 200items

oh oh, sounds like i spent money for nothing.

Hello, thank you for your article. I also wanted to set up my FritzBox as an NTP server for OpenHabian. Originally I had the problem that my systemd-timesyncd.service crashed all the time because of an invalid number of starts and stops. “service start-limit-hit”.
I solved this problem in /etc/systemd system.conf by setting the parameter “DefaultStartLimitBurst=10” from 5 to 10 (please delete the hash in front of it, otherwise comment it out). And that then worked.

In the second step, I thought about how I could put the NTP query on my FritzBox.
So I configured /etc/systemd timesycnd.conf as follows.

[Time]
#NTP=
FallbackNTP=fritz.box 0.debian.pool.ntp.org 1.debian.pool.ntp.org 2.debian.pool.ntp.org 3.debian.pool.ntp.org
#RootDistanceMaxSec=5
#PollIntervalMinSec=32
#PollIntervalMaxSec=2048

Important:
It did not work for me if I entered NTP server in the parameter “NTP=fritz.box”.
I do not know why!

Another small tip on how to test NTP server with on-board tools
Open Windows PowerShell and then:
w32tm /stripchart /computer:fritz.box

This helped me a lot, because I didn’t know if the FritzBox NTP server works at all.

Here are the version data of Openhabian and system logs: