Unable to get NTP (systemd-timesyncd) working over WiFi
2
votes
1
answer
274
views
I am running pre-built SD card image for the raspberry pi of nextcloudpi , but I figure I might get better help here.
I noticed that the time and date was not automatically updated so I started debugging.
I noticed that all lines in the file
/etc/systemd/timesyncd.conf
were commented out and the NTP line was empty. There's no additional timesyncd.conf.d
subdirectory.
So I uncommented lines and populated the NTP line. Here's how timesyncd.conf file looks now:
[Time]
NTP=0.europe.pool.ntp.org
FallbackNTP=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
ConnectionRetrySec=30
SaveIntervalSec=60
It seems that the content is parsed successfully because:
pi@nextcloudpi:~$ timedatectl show-timesync --all
LinkNTPServers=
SystemNTPServers=0.europe.pool.ntp.org
RuntimeNTPServers=
FallbackNTPServers=0.debian.pool.ntp.org 1.debian.pool.ntp.org 2.debian.pool.ntp.org 3.debian.pool.ntp.org
ServerName=
ServerAddress=
RootDistanceMaxUSec=5s
PollIntervalMinUSec=32s
PollIntervalMaxUSec=34min 8s
PollIntervalUSec=0
Frequency=0
However:
pi@nextcloudpi:~$ timedatectl
Local time: Sat 2024-12-28 12:05:31 EET
Universal time: Sat 2024-12-28 10:05:31 UTC
RTC time: n/a
Time zone: Europe/Helsinki (EET, +0200)
System clock synchronized: no
NTP service: active
RTC in local TZ: no
pi@nextcloudpi:~$ timedatectl timesync-status
Server: n/a (n/a)
Poll interval: 0 (min: 32s; max 34min 8s)
Packet count: 0
The System clock synchronized always indicates no
and the Server is always n/a
.
I tried
sudo timedatectl set-ntp false
sudo timedatectl set-ntp true
but it didn't change anything.
The systemd-timesyncd service is running:
● systemd-timesyncd.service - Network Time Synchronization
Loaded: loaded (/lib/systemd/system/systemd-timesyncd.service; enabled; preset: enabled)
Drop-In: /etc/systemd/system/systemd-timesyncd.service.d
└─override.conf
Active: active (running) since Fri 2024-12-27 22:38:50 EET; 13h ago
Docs: man:systemd-timesyncd.service(8)
Main PID: 3014 (systemd-timesyn)
Status: "Daemon is running"
Tasks: 1 (limit: 761)
Memory: 576.0K
CPU: 920ms
CGroup: /system.slice/systemd-timesyncd.service
└─3014 /lib/systemd/systemd-timesyncd
I tried enabling debug logging of this service, but nothing useful is printed there. There's never anything like Connecting to time server
. It's not even trying.
I also tried manually updating with ntpdate
sudo ntpdate -vd pool.ntp.org
and that worked fine. So I assume that this rules out possible DNS and other network related issues.
I ran out of ideas. What am I missing here?
Here's the version info:
pi@nextcloudpi:~$ sudo lsb_release -a
No LSB modules are available.
Distributor ID: Debian
Description: Armbian-unofficial 24.8.2 bookworm
Release: 12
Codename: bookworm
pi@nextcloudpi:~$ cat /etc/armbian-release
# PLEASE DO NOT EDIT THIS FILE
BOARD=rpi4b
BOARD_NAME="Raspberry Pi 4"
BOARDFAMILY=bcm2711
BUILD_REPOSITORY_URL=https://github.com/armbian/build
BUILD_REPOSITORY_COMMIT=549f321
LINUXFAMILY=bcm2711
ARCH=arm64
BOOT_SOC=
IMAGE_TYPE=user-built
BOARD_TYPE=conf
INITRD_ARCH=arm64
KERNEL_IMAGE_TYPE=Image
FORCE_BOOTSCRIPT_UPDATE=
FORCE_UBOOT_UPDATE=
VENDOR="Armbian-unofficial"
VENDORDOCS="https://docs.armbian.com/ "
VENDORURL="https://duckduckgo.com/ "
VENDORSUPPORT="https://community.armbian.com/ "
VENDORBUGS="https://armbian.atlassian.net/ "
VERSION=24.8.2
REVISION=24.8.2
Edit:
pi@nextcloudpi:~$ ntpq -np
-bash: ntpq: command not found
pi@nextcloudpi:~$ systemctl status ntp
Unit ntp.service could not be found.
Edit 2:
So it seems to be a network related issue somehow. Until now I have been connected through WiFi only. But immediately when I connected also the Ethernet cable, the System clock synchronized
turned to yes
.
But why is it not working over WiFi?
Here's resolvectl status when connected to WiFi only:
Global
Protocols: +LLMNR +mDNS -DNSOverTLS DNSSEC=no/unsupported
resolv.conf mode: stub
Current DNS Server: 1.0.0.1
DNS Servers 1.0.0.1
Link 2 (enxb827ebf2575c)
Current Scopes: none
Protocols: -DefaultRoute +LLMNR -mDNS -DNSOverTLS DNSSEC=no/unsupported
Link 3 (wlan0)
Current Scopes: DNS LLMNR/IPv4 LLMNR/IPv6
Protocols: +DefaultRoute +LLMNR -mDNS -DNSOverTLS DNSSEC=no/unsupported
Current DNS Server: 192.168.1.1
DNS Servers: 192.168.1.1
When the Ethernet cable is connected, it is otherwise the same, except for the Link 2 part:
Link 2 (enxb827ebf2575c)
Current Scopes: DNS LLMNR/IPv4 LLMNR/IPv6
Protocols: +DefaultRoute +LLMNR -mDNS -DNSOverTLS DNSSEC=no/unsupported
Current DNS Server: 192.168.1.1
DNS Servers: 192.168.1.1
Both WiFi and the Ethernet are the same network.
Asked by user930473
(141 rep)
Dec 28, 2024, 10:33 AM
Last activity: Aug 1, 2025, 09:05 AM
Last activity: Aug 1, 2025, 09:05 AM