[Solved] timesyncd will not sync with only wlan0 connected

This forum is for discussion about general software issues.

[Solved] timesyncd will not sync with only wlan0 connected

Postby keithspg » Tue Nov 29, 2022 2:04 pm

I noticed this over the weekend, but I do not know when it appeared.

armv7 and aarch64 running on an RPi. If the Pi is booted with only wlan0 connected, it will never sync. If it is booted with eth0 connected, it will sync during boot and when I check, it shows time synced :
System clock synchronized: yes
If I boot it with only wlan0connected, it shows this
$this->bbcode_second_pass_code('', '# timedatectl timesync-status
Server: n/a (n/a)
Poll interval: 0 (min: 32s; max 34min 8s)
Packet count: 0')
no matter how long I wait nor how many times I re-try this command it will not sync and never shows synced.
If I connect the eth0, it grabs an address then:
$this->bbcode_second_pass_code('', '# timedatectl timesync-status
Server: 216.239.35.4 (time2.google.com)
Poll interval: 1min 4s (min: 32s; max 34min 8s)
Leap: normal
Version: 4
Stratum: 1
Reference: GOOG
Precision: 1us (-20)
Root distance: 122us (max: 30s)
Offset: -555us
Delay: 14.168ms
Jitter: 210us
Packet count: 2
Frequency: +0.000ppm')

This is for an image created form the arch arm latest for armv7 and aarch64. I have systemd-networkd and systemd-timesyncd running. I am using connman and iwd to manage my ethernet connections (not netctl nor NetworkManager).
Last edited by keithspg on Wed Nov 30, 2022 5:53 am, edited 1 time in total.
keithspg
 
Posts: 221
Joined: Mon Feb 23, 2015 4:14 pm

Re: timesyncd will not sync with only wlan0 connected

Postby keithspg » Wed Nov 30, 2022 4:24 am

I went home again and dug into this a bit more. I still have no idea what is going on. It is very repeatable. Create a fresh image, install iwd and connman, connect to only a wlan (no cable connectd) and it will not sync.
I have an older image that I have pacman -Syu upgraded and it connects and syncs time. I compared the installed packages and they are the same, best I can tell the older one which is only connected by wlan0:
$this->bbcode_second_pass_code('', '# timedatectl timesync-status
Server: 64.111.99.224 (pool.ntp.org)
Poll interval: 34min 8s (min: 32s; max 34min 8s)
Leap: normal
Version: 4
Stratum: 4
Reference: A29FC801
Precision: 8us (-17)
Root distance: 36.223ms (max: 5s)
Offset: +187us
Delay: 24.772ms
Jitter: 896us
Packet count: 11
Frequency: -0.563ppm
')
the newly created image:
$this->bbcode_second_pass_code('', '# timedatectl timesync-status
Server: n/a (n/a)
Poll interval: 0 (min: 32s; max 34min 8s)
Packet count: 0
')
If I connect an ethernet cable to this new image on the RPi and do nothing but check again:
$this->bbcode_second_pass_code('', '# timedatectl timesync-status
Server: 62.108.36.235 (0.arch.pool.ntp.org)
Poll interval: 1min 4s (min: 32s; max 34min 8s)
Leap: normal
Version: 4
Stratum: 3
Reference: 285FCC42
Precision: 1us (-25)
Root distance: 70.784ms (max: 5s)
Offset: +868us
Delay: 99.459ms
Jitter: 328us
Packet count: 2
Frequency: +0.000ppm
')
and it is synced. If I pull the cable, it will not continue to adjust time. When I run this:
$this->bbcode_second_pass_code('', 'timedatectl timesync-status --monitor')
It appears to only adjust when the ethernet cable is connected. When I pull the cable it stops, when I reconnect the cable, it starts adjusting.
What could be the mechanism which might stop timesyncd from updating when it is only connected via wifi but works fine when conncted via cable?
Only when the ethernet cable is connected. will it continue to adjust. This behavior is not present with the older updated image though it is fully up top date. It is only connected by wifi and updated timesyncd to ensure the clock is synchronized.
It seems there may be some configuration which is not correct/present with a new/freshly created image but works fine on an older image.
keithspg
 
Posts: 221
Joined: Mon Feb 23, 2015 4:14 pm

Re: timesyncd will not sync with only wlan0 connected

Postby keithspg » Wed Nov 30, 2022 5:53 am

I may have found a thread to pull. Connman is not picking up the nameservers when it is connected via wlan0 by iwd.

Dug a bit more and determined that systmd-networkd was running and keeping connman from getting the nameserver from dhcp. I disabled the service and now it syncs time.
keithspg
 
Posts: 221
Joined: Mon Feb 23, 2015 4:14 pm


Return to General

Who is online

Users browsing this forum: No registered users and 1 guest