Hi,
I have setup an rpi4 with a TV Hat Tuner and everything is working pretty well, apart from a serious wifi connection issue:
every now and then, the rpi disconnects from the wifi and reconnects almost immediately (it's a matter of few seconds) and this doesn't seem to impact anything: I can still watch my content (TV Recordings saved to my NAS) without issues, but two or three times during the day, randomly, the wifi cannot connect for minutes. It happened when I was watching a recorded video: playback stopped and even if I rebooted, I was seeing in the initial screen messages the "waiting for the network to be up". If you have patiente and wait a bit, then the reconnection will re-establish again.
So, typically, quite many times a day I see the below (which is apparently not causing issues):
Jun 25 07:30:58 LibreELEC wpa_supplicant[410]: wlan0: CTRL-EVENT-DISCONNECTED bssid=dc:39:6f:f2:32:9d reason=0 locally_generated=1
Jun 25 07:30:58 LibreELEC wpa_supplicant[410]: wlan0: CTRL-EVENT-REGDOM-CHANGE init=CORE type=WORLD
Jun 25 07:30:58 LibreELEC connmand[381]: wlan0 {RX} 10612414 packets 2215315054 bytes
Jun 25 07:30:58 LibreELEC connmand[381]: wlan0 {TX} 15391266 packets 2750411358 bytes
Jun 25 07:30:58 LibreELEC connmand[381]: wlan0 {update} flags 102403 <UP,LOWER_UP>
Jun 25 07:30:58 LibreELEC connmand[381]: wlan0 {newlink} index 3 address E4:5F:01:23:99:83 mtu 1500
Jun 25 07:30:58 LibreELEC connmand[381]: wlan0 {newlink} index 3 operstate 5 <DORMANT>
Jun 25 07:30:58 LibreELEC connmand[381]: wlan0 {RX} 10612414 packets 2215315054 bytes
Jun 25 07:30:58 LibreELEC connmand[381]: wlan0 {TX} 15391266 packets 2750411358 bytes
Jun 25 07:30:58 LibreELEC connmand[381]: wlan0 {update} flags 36867 <UP>
Jun 25 07:30:58 LibreELEC connman-vpnd[273]: wlan0 {update} flags 102403 <UP,LOWER_UP>
Jun 25 07:30:58 LibreELEC connman-vpnd[273]: wlan0 {newlink} index 3 address E4:5F:01:23:99:83 mtu 1500
Jun 25 07:30:58 LibreELEC connman-vpnd[273]: wlan0 {newlink} index 3 operstate 5 <DORMANT>
Jun 25 07:30:58 LibreELEC connman-vpnd[273]: wlan0 {update} flags 36867 <UP>
Jun 25 07:30:58 LibreELEC connman-vpnd[273]: wlan0 {newlink} index 3 address E4:5F:01:23:99:83 mtu 1500
Jun 25 07:30:58 LibreELEC connman-vpnd[273]: wlan0 {newlink} index 3 operstate 2 <DOWN>
Jun 25 07:30:58 LibreELEC connmand[381]: wlan0 {newlink} index 3 address E4:5F:01:23:99:83 mtu 1500
Jun 25 07:30:58 LibreELEC connmand[381]: wlan0 {newlink} index 3 operstate 2 <DOWN>
Jun 25 07:30:58 LibreELEC avahi-daemon[397]: Withdrawing address record for 192.168.1.143 on wlan0.
Jun 25 07:30:58 LibreELEC avahi-daemon[397]: Leaving mDNS multicast group on interface wlan0.IPv4 with address 192.168.1.143.
Jun 25 07:30:58 LibreELEC avahi-daemon[397]: Interface wlan0.IPv4 no longer relevant for mDNS.
Jun 25 07:30:58 LibreELEC connmand[381]: wlan0 {del} address 192.168.1.143/24 label wlan0
Jun 25 07:30:58 LibreELEC connmand[381]: wlan0 {del} route 192.168.1.0 gw 0.0.0.0 scope 253 <LINK>
Jun 25 07:31:01 LibreELEC wpa_supplicant[410]: wlan0: Trying to associate with SSID 'TISCALI'
Jun 25 07:31:04 LibreELEC connman-vpnd[273]: wlan0 {update} flags 102403 <UP,LOWER_UP>
Jun 25 07:31:04 LibreELEC connman-vpnd[273]: wlan0 {newlink} index 3 address E4:5F:01:23:99:83 mtu 1500
Jun 25 07:31:04 LibreELEC connman-vpnd[273]: wlan0 {newlink} index 3 operstate 5 <DORMANT>
Jun 25 07:31:04 LibreELEC connmand[381]: wlan0 {RX} 10612414 packets 2215315054 bytes
Jun 25 07:31:04 LibreELEC connmand[381]: wlan0 {TX} 15391266 packets 2750411358 bytes
Jun 25 07:31:04 LibreELEC connmand[381]: wlan0 {update} flags 102403 <UP,LOWER_UP>
Jun 25 07:31:04 LibreELEC connmand[381]: wlan0 {newlink} index 3 address E4:5F:01:23:99:83 mtu 1500
Jun 25 07:31:04 LibreELEC connmand[381]: wlan0 {newlink} index 3 operstate 5 <DORMANT>
Jun 25 07:31:04 LibreELEC wpa_supplicant[410]: wlan0: Associated with dc:39:6f:f2:32:9c
Jun 25 07:31:04 LibreELEC wpa_supplicant[410]: wlan0: CTRL-EVENT-CONNECTED - Connection to dc:39:6f:f2:32:9c completed [id=0 id_str=]
Jun 25 07:31:04 LibreELEC wpa_supplicant[410]: wlan0: CTRL-EVENT-SUBNET-STATUS-UPDATE status=0
Jun 25 07:31:04 LibreELEC connman-vpnd[273]: wlan0 {update} flags 102467 <UP,RUNNING,LOWER_UP>
Jun 25 07:31:04 LibreELEC connmand[381]: wlan0 {RX} 10612414 packets 2215315054 bytes
Jun 25 07:31:04 LibreELEC wpa_supplicant[410]: wlan0: CTRL-EVENT-REGDOM-CHANGE init=COUNTRY_IE type=COUNTRY alpha2=IT
Jun 25 07:31:04 LibreELEC connman-vpnd[273]: wlan0 {newlink} index 3 address E4:5F:01:23:99:83 mtu 1500
Jun 25 07:31:04 LibreELEC connmand[381]: wlan0 {TX} 15391266 packets 2750411358 bytes
Jun 25 07:31:04 LibreELEC connman-vpnd[273]: wlan0 {newlink} index 3 operstate 6 <UP>
Jun 25 07:31:04 LibreELEC connmand[381]: wlan0 {update} flags 102467 <UP,RUNNING,LOWER_UP>
Jun 25 07:31:04 LibreELEC connmand[381]: wlan0 {newlink} index 3 address E4:5F:01:23:99:83 mtu 1500
Jun 25 07:31:04 LibreELEC connmand[381]: wlan0 {newlink} index 3 operstate 6 <UP>
Jun 25 07:31:04 LibreELEC avahi-daemon[397]: Joining mDNS multicast group on interface wlan0.IPv4 with address 192.168.1.143.
Jun 25 07:31:04 LibreELEC avahi-daemon[397]: New relevant interface wlan0.IPv4 for mDNS.
Jun 25 07:31:04 LibreELEC avahi-daemon[397]: Registering new address record for 192.168.1.143 on wlan0.IPv4.
Jun 25 07:31:04 LibreELEC connmand[381]: wlan0 {add} address 192.168.1.143/24 label wlan0 family 2
Jun 25 07:31:04 LibreELEC connmand[381]: wlan0 {add} route 192.168.1.0 gw 0.0.0.0 scope 253 <LINK>
Jun 25 07:31:04 LibreELEC connmand[381]: wlan0 {add} route 192.168.1.1 gw 0.0.0.0 scope 253 <LINK>
Jun 25 07:31:04 LibreELEC connmand[381]: wlan0 {add} route 8.8.8.8 gw 192.168.1.1 scope 0 <UNIVERSE>
Jun 25 07:31:04 LibreELEC connmand[381]: wlan0 {add} route 0.0.0.0 gw 192.168.1.1 scope 0 <UNIVERSE>
Jun 25 07:31:04 LibreELEC connmand[381]: wlan0 {add} route 82.165.8.211 gw 192.168.1.1 scope 0 <UNIVERSE>
Jun 25 07:31:04 LibreELEC connmand[381]: wlan0 {del} route 82.165.8.211 gw 192.168.1.1 scope 0 <UNIVERSE>
Display More
By the way, I see in the logs of my FritzBox router that the device is deregistering itself and re-registering, sometimes with a 5Ghz band steering to 2,5Ghz despite the rpi is in the same room where the router is (at a distance of about 5 meters). Another things that I have noticed is that the maximum speed it gets at 5Ghz is 140Mbps, while other 5Ghz connected device get 866Mbps speed (my FireTV, for instance)
Anyway, it's still good. Sometimes, though, the reconnection fails, like in the example below:
Jun 25 07:31:15 LibreELEC wpa_supplicant[410]: wlan0: CTRL-EVENT-DISCONNECTED bssid=dc:39:6f:f2:32:9c reason=0 locally_generated=1
Jun 25 07:31:15 LibreELEC wpa_supplicant[410]: wlan0: CTRL-EVENT-REGDOM-CHANGE init=CORE type=WORLD
Jun 25 07:31:15 LibreELEC connmand[381]: wlan0 {RX} 10612510 packets 2215340797 bytes
Jun 25 07:31:15 LibreELEC connmand[381]: wlan0 {TX} 15391318 packets 2750436246 bytes
Jun 25 07:31:15 LibreELEC connmand[381]: wlan0 {update} flags 102403 <UP,LOWER_UP>
Jun 25 07:31:15 LibreELEC connmand[381]: wlan0 {newlink} index 3 address E4:5F:01:23:99:83 mtu 1500
Jun 25 07:31:15 LibreELEC connmand[381]: wlan0 {newlink} index 3 operstate 5 <DORMANT>
Jun 25 07:31:15 LibreELEC connman-vpnd[273]: wlan0 {update} flags 102403 <UP,LOWER_UP>
Jun 25 07:31:15 LibreELEC connman-vpnd[273]: wlan0 {newlink} index 3 address E4:5F:01:23:99:83 mtu 1500
Jun 25 07:31:15 LibreELEC connman-vpnd[273]: wlan0 {newlink} index 3 operstate 5 <DORMANT>
Jun 25 07:31:15 LibreELEC connman-vpnd[273]: wlan0 {update} flags 36867 <UP>
Jun 25 07:31:15 LibreELEC connman-vpnd[273]: wlan0 {newlink} index 3 address E4:5F:01:23:99:83 mtu 1500
Jun 25 07:31:15 LibreELEC connman-vpnd[273]: wlan0 {newlink} index 3 operstate 2 <DOWN>
Jun 25 07:31:15 LibreELEC connmand[381]: wlan0 {RX} 10612510 packets 2215340797 bytes
Jun 25 07:31:15 LibreELEC connmand[381]: wlan0 {TX} 15391318 packets 2750436246 bytes
Jun 25 07:31:15 LibreELEC connmand[381]: wlan0 {update} flags 36867 <UP>
Jun 25 07:31:15 LibreELEC connmand[381]: wlan0 {newlink} index 3 address E4:5F:01:23:99:83 mtu 1500
Jun 25 07:31:15 LibreELEC connmand[381]: wlan0 {newlink} index 3 operstate 2 <DOWN>
Jun 25 07:31:15 LibreELEC avahi-daemon[397]: Withdrawing address record for 192.168.1.143 on wlan0.
Jun 25 07:31:15 LibreELEC avahi-daemon[397]: Leaving mDNS multicast group on interface wlan0.IPv4 with address 192.168.1.143.
Jun 25 07:31:15 LibreELEC avahi-daemon[397]: Interface wlan0.IPv4 no longer relevant for mDNS.
Jun 25 07:31:15 LibreELEC connmand[381]: wlan0 {del} address 192.168.1.143/24 label wlan0
Jun 25 07:31:15 LibreELEC connmand[381]: wlan0 {del} route 192.168.1.0 gw 0.0.0.0 scope 253 <LINK>
Jun 25 07:31:15 LibreELEC wpa_supplicant[410]: wlan0: Trying to associate with SSID 'TISCALI'
Jun 25 07:31:18 LibreELEC wpa_supplicant[410]: wlan0: CTRL-EVENT-ASSOC-REJECT bssid=00:00:00:00:00:00 status_code=16
Jun 25 07:32:00 LibreELEC wpa_supplicant[410]: wlan0: Failed to initiate sched scan
Jun 25 07:33:21 LibreELEC wpa_supplicant[410]: wlan0: Failed to initiate sched scan
Jun 25 07:37:24 LibreELEC wpa_supplicant[410]: wlan0: Failed to initiate sched scan
Jun 25 07:37:24 LibreELEC wpa_supplicant[410]: wlan0: Trying to associate with SSID 'TISCALI'
Jun 25 07:37:26 LibreELEC wpa_supplicant[410]: wlan0: Associated with dc:39:6f:f2:32:9d
Jun 25 07:37:26 LibreELEC wpa_supplicant[410]: wlan0: CTRL-EVENT-CONNECTED - Connection to dc:39:6f:f2:32:9d completed [id=0 id_str=]
Jun 25 07:37:26 LibreELEC wpa_supplicant[410]: wlan0: CTRL-EVENT-SUBNET-STATUS-UPDATE status=0
Jun 25 07:37:26 LibreELEC connmand[381]: wlan0 {RX} 10612510 packets 2215340797 bytes
Jun 25 07:37:26 LibreELEC connmand[381]: wlan0 {TX} 15391318 packets 2750436246 bytes
Jun 25 07:37:26 LibreELEC connmand[381]: wlan0 {update} flags 102403 <UP,LOWER_UP>
Jun 25 07:37:26 LibreELEC connmand[381]: wlan0 {newlink} index 3 address E4:5F:01:23:99:83 mtu 1500
Jun 25 07:37:26 LibreELEC connmand[381]: wlan0 {newlink} index 3 operstate 5 <DORMANT>
Jun 25 07:37:26 LibreELEC connmand[381]: wlan0 {RX} 10612510 packets 2215340797 bytes
Jun 25 07:37:26 LibreELEC connman-vpnd[273]: wlan0 {update} flags 102403 <UP,LOWER_UP>
Jun 25 07:37:26 LibreELEC connmand[381]: wlan0 {TX} 15391318 packets 2750436246 bytes
Jun 25 07:37:26 LibreELEC connmand[381]: wlan0 {update} flags 102467 <UP,RUNNING,LOWER_UP>
Jun 25 07:37:26 LibreELEC connmand[381]: wlan0 {newlink} index 3 address E4:5F:01:23:99:83 mtu 1500
Jun 25 07:37:26 LibreELEC connmand[381]: wlan0 {newlink} index 3 operstate 6 <UP>
Jun 25 07:37:26 LibreELEC connman-vpnd[273]: wlan0 {newlink} index 3 address E4:5F:01:23:99:83 mtu 1500
Jun 25 07:37:26 LibreELEC connman-vpnd[273]: wlan0 {newlink} index 3 operstate 5 <DORMANT>
Jun 25 07:37:26 LibreELEC connman-vpnd[273]: wlan0 {update} flags 102467 <UP,RUNNING,LOWER_UP>
Jun 25 07:37:26 LibreELEC connman-vpnd[273]: wlan0 {newlink} index 3 address E4:5F:01:23:99:83 mtu 1500
Jun 25 07:37:26 LibreELEC connman-vpnd[273]: wlan0 {newlink} index 3 operstate 6 <UP>
Jun 25 07:37:26 LibreELEC wpa_supplicant[410]: wlan0: CTRL-EVENT-REGDOM-CHANGE init=COUNTRY_IE type=COUNTRY alpha2=IT
Jun 25 07:37:26 LibreELEC avahi-daemon[397]: Joining mDNS multicast group on interface wlan0.IPv4 with address 192.168.1.143.
Jun 25 07:37:26 LibreELEC avahi-daemon[397]: New relevant interface wlan0.IPv4 for mDNS.
Jun 25 07:37:26 LibreELEC avahi-daemon[397]: Registering new address record for 192.168.1.143 on wlan0.IPv4.
Jun 25 07:37:26 LibreELEC connmand[381]: wlan0 {add} address 192.168.1.143/24 label wlan0 family 2
Jun 25 07:37:26 LibreELEC connmand[381]: wlan0 {add} route 192.168.1.0 gw 0.0.0.0 scope 253 <LINK>
Jun 25 07:37:26 LibreELEC connmand[381]: wlan0 {add} route 192.168.1.1 gw 0.0.0.0 scope 253 <LINK>
Jun 25 07:37:26 LibreELEC connmand[381]: wlan0 {add} route 8.8.8.8 gw 192.168.1.1 scope 0 <UNIVERSE>
Jun 25 07:37:26 LibreELEC connmand[381]: wlan0 {add} route 0.0.0.0 gw 192.168.1.1 scope 0 <UNIVERSE>
Jun 25 07:37:26 LibreELEC connmand[381]: wlan0 {add} route 82.165.8.211 gw 192.168.1.1 scope 0 <UNIVERSE>
Jun 25 07:37:26 LibreELEC connmand[381]: wlan0 {del} route 82.165.8.211 gw 192.168.1.1 scope 0 <UNIVERSE>
Display More
As you see, at 07:31:18 I get a rejected connection, and then the wpa_supplicant scheduled scan doesn't work until 07:37 (6 minutes without wifi access)
Jun 25 07:31:15 LibreELEC wpa_supplicant[410]: wlan0: Trying to associate with SSID 'TISCALI'
Jun 25 07:31:18 LibreELEC wpa_supplicant[410]: wlan0: CTRL-EVENT-ASSOC-REJECT bssid=00:00:00:00:00:00 status_code=16
Jun 25 07:32:00 LibreELEC wpa_supplicant[410]: wlan0: Failed to initiate sched scan
Jun 25 07:33:21 LibreELEC wpa_supplicant[410]: wlan0: Failed to initiate sched scan
Jun 25 07:37:24 LibreELEC wpa_supplicant[410]: wlan0: Failed to initiate sched scan
Jun 25 07:37:24 LibreELEC wpa_supplicant[410]: wlan0: Trying to associate with SSID 'TISCALI'
Jun 25 07:37:26 LibreELEC wpa_supplicant[410]: wlan0: Associated with dc:39:6f:f2:32:9d
Then, everything comes back to normal again.
WiFi is working fine in my house, and I have a FireTV stick connected to my TV, on the shelf below my rpi, and I have never had issues to connect to my NAS over WiFi
I followed some hints about the regdomain which I set to IT (in Kodi), but this didn't do the trick. I also used the iw command to set it, but maybe the regdomain doesn't have any role.
I don't exactly know how to troubleshoot it also because I am not familiar with LibreELEC, I used this OS because I thought I shouldn't have had to play with various configurations, but I have no problems with linux (I have two more rpi), so if you can give me some hints on where I should start things, that would be great.
5 or 6 minutes of pause is a bit annoying, especially while watching TV, and I believe the same issue could happen while I am recording a TV program, which would be a disaster.
Laying an ethernet cable across the room requires some effort and time, so I would definitely like to avoid it, unless strictly necessary.
Thanks for your help!