[RPi3B+] WiFi Delayed Connection on LE 12.0.2

  • First post here, hope someone can help.

    I've been running V10 on a Rapberry Pi model 3 B+ for a while, and just moved to V12.0.2 via a fresh install on a new microSD card. I connected to my WiFi via the setup wizard on the 1st start, then configured everything as I like it. When V12 starts up, on the main Kodi screen the date/time is wrong, and doesn't get updated to the correct date/time for over 20 seconds. During this time I can't stream anything. If I open Settings > LibreELEC > Connections immediately after startup, there's no IP address on my WiFi entry until after 20 seconds. After the 20 seconds I can stream stuff, and so far I've not had any problems streaming, so it looks like it's just that initial connection that's a problem.

    The V10 install works perfectly. as soon as the Kodi main screen appears it's showing the correct date/time, and I can stream immediately.

    I switched V12 from using dhcp to using a manual IP4 address, and I have the same problem, although the correct date/time does appear a little quicker, just under 20 seconds.

    Has anyone else experienced this, or can anyone point me in the right direction on how to diagnose it.

    Thanks.

  • Increase the "wait for network" timeout in LE settings to 30-seconds; it will exit the wait loop earlier if the connection is found/active earlier. Then the network is always up before Kodi starts and time (via NTP) will always be correct. There's no way to make drivers load and probe hardware faster.

    NB: If you need a static address it usually easier to leave devices on DHCP but add a static reservation against the interface MAC in the router so it's always dynamically assigned the same address.

  • Thanks for the reply, but that made the startup time even slower.

    If I time it from the moment the LibreELEC logo appears, it takes ~43 seconds for the correct date/time to show.

    When I turn "wait for network" on, and set it to 30 seconds, it spends a lot longer on the LibreELEC logo, and then when the Kodi main screen appears it's showing the correct date/time, but it took ~46 seconds to get to that point.

    I don't understand why it takes so long compared to running LibreELEC V10 on the same Pi.

    BTW, I do use a static reservation, I just switched the Pi to a manual IP4 address when I was investigating this problem.

  • The only major technical difference in wifi connections between LE12 images and LE11 and earlier is the change from wpa_supplicant to iwd. The change has generated a few minor issues but those are largely resolved, and importantly, none have been related to speed of network association. If you wanted to self-build an image with wpa_supplicant to see if that's the problem difference, this is not that hard (a one-line change in distro build options).

    NB: I would expect LE12 to boot slower than LE10 as image sizes have increased and load times got slower with time. I wouldn't expect it to be an overly significant difference though; from my own experience with other RPi boards (albeit much faster ones).

    There is an obvious long delay as the network comes up, but that's expected given what you've reported. I don't see anything wrong in the log though. You can run systemd-analyse blame but it'll probably look like https://paste.libreelec.tv/decent-ray.log and again, there's nothing unexpected with network start being one of the longest/slowest elements in boot.

    For kicks you can disable BT in config.txt by adding dtoverlay=disable-bt and perhaps unplug the USB Gigabit Ethernet adapter that's connected. That's shaving CPU cycles from boot but unlikely to have any major influence.

  • Unfortunately, self-building an image is way beyond my knowledge/skills.

    I tried systemd-analyse blame, here are the first few lines...

    41.351s wait-time-sync.service
    30.036s kodi-waitonnetwork.service
    3.602s dev-mmcblk0p2.device
    3.557s dev-mmcblk0p1.device
    3.491s dev-loop0.device
    2.916s pulseaudio.service
    2.612s systemd-hwdb-update.service
    2.000s connman-vpn.service
    1.927s iwd.service
    1.926s dbus.service
    1.397s samba-config.service
    1.061s systemd-logind.service

    Similar to the one you linked to, except the much slower times.

    I tried disabling BT, it made no measurable difference.

    You said "unplug the USB Gigabit Ethernet adapter", but there's isn't a USB adapter plugged in. The only USB thing plugged in at the moment is a keyboard.