You are not logged in.

#1 2024-09-22 13:02:05

Fnordinger
Member
Registered: 2024-09-22
Posts: 6

[solved] WiFi randomly disconnects

Hi,

I've been using Linux for two years now (Pop!OS so far) and am now trying to get Arch set up on my machine. So far it mostly worked and I could resolve most issues by RTFM, however no matter what I did so far, my WiFi just keeps crashing. According to the logs, the crashes are consistently identical and look like this:

(note the reverse order of the logs)

Sep 22 13:59:37 count0 wpa_supplicant[449]: wlp1s0: Removed BSSID 6c:55:e8:58:d5:78 from ignore list (clear)
Sep 22 13:59:37 count0 wpa_supplicant[449]: wlp1s0: Removed BSSID 6c:55:e8:58:d5:80 from ignore list (clear)
Sep 22 13:59:32 count0 kernel: wlp1s0: Connection to AP 6c:55:e8:58:d5:80 lost
Sep 22 13:59:32 count0 kernel: iwlwifi 0000:01:00.0: Not associated and the time event is over already...
Sep 22 13:59:32 count0 kernel: wlp1s0: authenticated
Sep 22 13:59:32 count0 wpa_supplicant[449]: wlp1s0: Added BSSID 6c:55:e8:58:d5:80 into ignore list, ignoring for 10 seconds
Sep 22 13:59:32 count0 wpa_supplicant[449]: wlp1s0: CTRL-EVENT-DISCONNECTED bssid=6c:55:e8:58:d5:80 reason=2 locally_generated=1
Sep 22 13:59:32 count0 kernel: wlp1s0: send auth to 6c:55:e8:58:d5:80 (try 1/3)
Sep 22 13:59:32 count0 kernel: wlp1s0: authenticate with 6c:55:e8:58:d5:80 (local address=14:ab:c5:9d:a0:c1)
Sep 22 13:59:32 count0 wpa_supplicant[449]: wlp1s0: SME: Trying to authenticate with 6c:55:e8:58:d5:80 (SSID='Vodafone-D574' freq=5540 MHz)
Sep 22 13:59:32 count0 connmand[2996]: wlp1s0 {newlink} index 3 operstate 2 <DOWN>
Sep 22 13:59:32 count0 connmand[2996]: wlp1s0 {newlink} index 3 address 14:AB:C5:9D:A0:C1 mtu 1500
Sep 22 13:59:32 count0 connmand[2996]: wlp1s0 {update} flags 36867 <UP>
Sep 22 13:59:32 count0 connmand[2996]: wlp1s0 {TX} 9575 packets 1674845 bytes
Sep 22 13:59:32 count0 connman-vpnd[440]: wlp1s0 {newlink} index 3 operstate 2 <DOWN>
Sep 22 13:59:32 count0 connman-vpnd[440]: wlp1s0 {newlink} index 3 address 14:AB:C5:9D:A0:C1 mtu 1500
Sep 22 13:59:32 count0 connmand[2996]: wlp1s0 {RX} 25008 packets 24462788 bytes
Sep 22 13:59:32 count0 kernel: wlp1s0: deauthenticating from 6c:55:e8:58:d5:80 by local choice (Reason: 2=PREV_AUTH_NOT_VALID)
Sep 22 13:59:32 count0 connman-vpnd[440]: wlp1s0 {update} flags 36867 <UP>
Sep 22 13:59:31 count0 connmand[2996]: wlp1s0 {del} address 2a02:810d:a63f:d4cc:16ab:c5ff:fe9d:a0c1/64 label (null)
Sep 22 13:59:31 count0 connmand[2996]: wlp1s0 {del} route fe80:: gw :: scope 0 <UNIVERSE>
Sep 22 13:59:31 count0 connmand[2996]: wlp1s0 {del} route 2a02:810d:a63f:d4cc:: gw :: scope 0 <UNIVERSE>
Sep 22 13:59:31 count0 connmand[2996]: wlp1s0 {del} address 2a02:810d:a63f:d4cc:8a69:b8c:5cc9:a910/64 label (null)
Sep 22 13:59:31 count0 connmand[2996]: wlp1s0 {del} route 192.168.0.0 gw 0.0.0.0 scope 253 <LINK>
Sep 22 13:59:31 count0 connmand[2996]: wlp1s0 {del} address 192.168.0.251/24 label wlp1s0
Sep 22 13:59:31 count0 connmand[2996]: wlp1s0 {newlink} index 3 operstate 5 <DORMANT>
Sep 22 13:59:31 count0 connmand[2996]: wlp1s0 {newlink} index 3 address 14:AB:C5:9D:A0:C1 mtu 1500
Sep 22 13:59:31 count0 connmand[2996]: wlp1s0 {update} flags 102403 <UP,LOWER_UP>
Sep 22 13:59:31 count0 connman-vpnd[440]: wlp1s0 {newlink} index 3 operstate 5 <DORMANT>
Sep 22 13:59:31 count0 connmand[2996]: wlp1s0 {TX} 9575 packets 1674845 bytes
Sep 22 13:59:31 count0 connman-vpnd[440]: wlp1s0 {newlink} index 3 address 14:AB:C5:9D:A0:C1 mtu 1500
Sep 22 13:59:31 count0 connmand[2996]: wlp1s0 {RX} 25008 packets 24462788 bytes
Sep 22 13:59:31 count0 connman-vpnd[440]: wlp1s0 {update} flags 102403 <UP,LOWER_UP>
Sep 22 13:59:31 count0 wpa_supplicant[449]: wlp1s0: BSSID 6c:55:e8:58:d5:78 ignore list count incremented to 2, ignoring for 10 seconds
Sep 22 13:59:31 count0 wpa_supplicant[449]: wlp1s0: Added BSSID 6c:55:e8:58:d5:78 into ignore list, ignoring for 10 seconds
Sep 22 13:59:31 count0 connmand[2996]: Probably roaming right now! Staying connected...
Sep 22 13:59:31 count0 wpa_supplicant[449]: wlp1s0: SME: Trying to authenticate with 6c:55:e8:58:d5:78 (SSID='Vodafone-D574' freq=2462 MHz)
Sep 22 13:59:31 count0 wpa_supplicant[449]: wlp1s0: WNM: Preferred List Available
Sep 22 13:59:11 count0 wpa_supplicant[449]: wlp1s0: CTRL-EVENT-SIGNAL-CHANGE above=1 signal=-37 noise=9999 txrate=0
Sep 22 13:58:57 count0 wpa_supplicant[449]: wlp1s0: CTRL-EVENT-SIGNAL-CHANGE above=0 signal=-38 noise=9999 txrate=0

The only way to reconnect is to restart connman, maybe there are other services that could be restarted as well, but this is the one that intuitively made sense to me and it always fixes it temporarily.

So far my understanding of the issue is this: while already being connected to the WiFi by one band, my PC discovers the other band (I've seen the logs with 2.5GHz and 5GHz respectively). While trying to connect to that, it runs into an authentication issue and times out. This is when I restart connman and it can just reconnect without the "confusion" it suffers from when switching.

I looked through older posts on the forum and so far the closest occurrences of similar problems seemed to be this post about some microcode issues that have the same number as my iwlwifi error (0000:01:00.0) and this Ubuntu forum post that also contains the PREV_AUTH_NOT_VALID. The solution of the former didn't appear to fix it, but the latter post pointed to my dual band WiFi being part of the issue and therefore providing some base to fix it.

Apart from looking through forums, I also dug in some manuals and I'm sure that there is one that contains the solution, but I'm not sure what manual to read and where to look for answers.

As far as my other attempts at fixing it are concerned I turned on AddressConflictDetection in connmans main.conf, but that didn't resolve the issue. One quick fix could be to disable bgscanning for wpa_supplicant, but this wouldn't allow me to roam, without suffering from the same issue, just not randomly, but whenever I move my laptop at uni for example. I looked into disabling the band switching explicitly, but couldn't find anything about it, neither for Connman nor for wpa_supplicant. I was also not able to find proper documentation for the error codes I see in the logs, but this could also be a skill issue on my end.

I hope I was able to describe my issue properly and would be happy if somebody with more knowledge is able to help me or point me to resources I haven't considered yet.

Fnordinger

Last edited by Fnordinger (2024-09-22 16:00:07)

Offline

#2 2024-09-22 13:46:45

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 75,808

Re: [solved] WiFi randomly disconnects

https://superuser.com/questions/472731/ … s-by-bssid

If you're not sold on connman+wpa_supplicant you could also try whether iwd's roaming is less annoying (or you have to fine-tune that, too)

Offline

#3 2024-09-22 14:24:27

Fnordinger
Member
Registered: 2024-09-22
Posts: 6

Re: [solved] WiFi randomly disconnects

Thank you for the reply! Is iwd more robust than wpa_supplicant in your experience? I saw the possibility to use it instead in the wiki, but figured that there would be a reason why wpa_supplicant is the standard with connman. I would prefer if there was a way I could fix the problem that exists now, especially because I'm afraid that there might be an underlying issue that needs to be resolved and will come back later if I only work around the problem. But I will definitely try it with iwd and come back with results.

Offline

#4 2024-09-22 14:32:13

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 75,808

Re: [solved] WiFi randomly disconnects

I've no experience w/ connman specifically and generally do not roam.
Assuming connman completely delegates roaming to the carrier, you can fine-tune wpa_supplicant roaming just as iwd (where with that the idea would have been to use it instead of connman, as it can also configure your network)
https://wiki.archlinux.org/title/Wpa_supplicant#Roaming

For your specific situation, if the problem is exclusively one AP that you cannot properly roam because the 2.4/5GHz signal qualities are swapping places all the time, the alternative would be to pin a BSSID (but idk whether connman can do that and could not find anything itr) or blacklist one of them (5GHz is favorable on permanently short distances, 2.4GHz on long distances)

Offline

#5 2024-09-22 14:42:16

Fnordinger
Member
Registered: 2024-09-22
Posts: 6

Re: [solved] WiFi randomly disconnects

Okay, I would try to preserve the ability to switch bands if possible and am setting up connman up to use iwd. I hope that iwd is smarter with handling those switches.

If this doesn't work I think I will first try out another network manager, because while I'm not roaming at home (just seems that the signals change in intensity) I will roam in Uni and won't be able to blacklist BSSIDs (I could blacklist them of course, but I would have to adjust my blacklist depending on my location). I will keep you posted smile

Offline

#6 2024-09-22 15:59:22

Fnordinger
Member
Registered: 2024-09-22
Posts: 6

Re: [solved] WiFi randomly disconnects

Pretty sure it's fixed now, haven't had any issues and looking at the logs it is constantly looking for roams and handling problems properly.

Sep 22 17:48:16 count0 iwd[8652]: event: roam-scan,
Sep 22 17:44:50 count0 iwd[8652]: event: roam-scan,
Sep 22 17:42:11 count0 iwd[8652]: event: roam-scan,
Sep 22 17:41:39 count0 kernel: perf: interrupt took too long (5252 > 5016), lowering kernel.perf_event_max_sample_rate to 37800
Sep 22 17:37:32 count0 iwd[8652]: event: roam-scan,
Sep 22 17:30:34 count0 iwd[8652]: event: roam-scan,
Sep 22 17:28:32 count0 iwd[8652]: event: roam-scan,
Sep 22 17:24:23 count0 iwd[8652]: event: roam-scan,
Sep 22 17:21:27 count0 kernel: perf: interrupt took too long (4013 > 4011), lowering kernel.perf_event_max_sample_rate to 49800
Sep 22 17:21:15 count0 iwd[8652]: event: roam-scan,
Sep 22 17:15:58 count0 iwd[8652]: event: roam-scan,
Sep 22 17:14:28 count0 iwd[8652]: event: roam-scan,
Sep 22 17:14:18 count0 iwd[8652]: event: roam-scan,

Just had to install iwd, create the service file at /etc/systemd/system/connman_iwd.service:

[Unit]
Description=Connection service
DefaultDependencies=false
Conflicts=shutdown.target
RequiresMountsFor=/var/lib/connman
After=dbus.service network-pre.target systemd-sysusers.service iwd.service
Before=network.target multi-user.target shutdown.target
Wants=network.target
Requires=iwd.service

[Service]
Type=dbus
BusName=net.connman
Restart=on-failure
ExecStart=/usr/bin/connmand --wifi=iwd_agent -n
StandardOutput=null
CapabilityBoundingSet=CAP_NET_ADMIN CAP_NET_BIND_SERVICE CAP_NET_RAW CAP_SYS_TIME CAP_SYS_MODULE
ProtectHome=true
ProtectSystem=true

[Install]
WantedBy=multi-user.target

and then I stopped connman and wpa_supplicant and started connman_iwd instead.

Thank you very much big_smile

Offline

#7 2024-09-22 16:06:32

mithrial
Member
Registered: 2017-03-05
Posts: 151

Re: [solved] WiFi randomly disconnects

Hopefully, you did not only stop the services but also disable them, right?

Offline

#8 2024-09-22 16:09:33

Fnordinger
Member
Registered: 2024-09-22
Posts: 6

Re: [solved] WiFi randomly disconnects

Thanks for the heads up, I actually forgot to disable connman, but now wpa_supplicant and connman are disabled.

Offline

Board footer

Powered by FluxBB