Slow boot due to DHCP

Hello,
I’m running CoreELEC 20.2 on an Odroid C4, and I noticed that the boot process is very slow because I enabled the option to start Kodi only after networking is ready, and it takes 3-4 minutes until Kodi is usable.
I disabled the boot logo so I can see systemd’s progress, and I am monitoring the logs on the DHCP server to see what is going on.
All the services start very quickly, yet the DHCP server only receives the request after almost 2 minutes. And it responds immediately, yet, it takes 2 more minutes for Kodi to start.

Any ideas?

Works here fine with every device. Maybe something in your network?

I am using dhcp on all devices as well, and have no slowdowns due to the assignment process.
I would say check network conditions.

dmesg | paste
ifconfig | paste

ssh enter the above command, put the link up, it is estimated that the device network card problem, it is recommended to enter the Android system to see whether the ip obtained is normal.

dmesg output
ifconfig output

I don’t have any Android image.
I repeated this test on different devices (using the same microSD card), and always get the same result.
I don’t see any other network issues, I have computers and phones that boot fast, all using DHCP.
And on these devices that boot slowly, I always play videos via NFS from the server, no issues at all.

After adding -d to connmand, I see this:
journalctl -t connmand |paste

I noticed a few seconds of delay every time it tries to resolve 0.pool.ntp.org, 1.pool.ntp.org, 2.pool.ntp.org and 3.pool.ntp.org.

I also see a long delay between these lines:

Sep 30 23:15:35 htpc connmand[3457]: ../src/service.c:service_append_added_foreach() new /net/connman/service/ethernet_001e064ab41a_cable
Sep 30 23:16:10 htpc connmand[3457]: ../src/dhcp.c:no_lease_cb() No lease available ipv4ll 0 client (nil)

In the end the interface is configured at 23:17:13, which is 101 seconds after starting.

I overwrote the configuration by copying /etc/connman/main.conf to /storage/.config/connman_main.conf, and commented these settings:

FallbackTimeservers
FallbackNameservers
AllowHostnameUpdates

And set:

UseGatewaysAsTimeservers = true
EnableOnlineCheck = false

This didn’t help as much as I expected. Removing /storage/.cache/connman didn’t help either.

At least I could solve the delay between the networking being configured and the UI of Kodi showing up.
Kodi was running, but trying to open non-existant library databases, such as kodi_music82, kodi_music81, etc, every time adding a 3 second delay.
This is because the server has the DBs for an older version of Kodi.

Anyway, can anyone here test in your devices to compare?
All you have to do is enable connman’s debug option:

mkdir -p /storage/.config/system.d/connman.service.d
echo -e "[Service]\nEnvironment=CONNMAN_DEBUG=-d" > /storage/.config/system.d/connman.service.d/override.conf
reboot
journalctl -t connmand |paste

And of course, later you can disable connman’s debug with:

rm /storage/.config/system.d/connman.service.d/override.conf

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.