intel ax 200 adapter can't connect to wifi when managed by NetworkManager
I'm using ubuntu 20.04 and with everything updated and their latest 5.4.0 based kernel I was not able to connect to my home wifi when using my motherboard's (Asrock Taichi x570) built-in wifi 6 adapter which is based on intel ax 200 chipset. I upgraded my kernel to 5.10 and was still not able to connect and was getting the following errors in dmesg:
[нд яну 17 22:01:33 2021] iwlwifi 0000:05:00.0: No beacon heard and the session protection is over already...
[нд яну 17 22:01:33 2021] wlp5s0: Connection to AP 30:b5:c2:75:a4:ce lost
[нд яну 17 22:01:33 2021] wlp5s0: send auth to 30:b5:c2:75:a4:ce (try 3/3)
[нд яну 17 22:01:34 2021] wlp5s0: authentication with 30:b5:c2:75:a4:ce timed out
[нд яну 17 22:01:35 2021] wlp5s0: authenticate with 30:b5:c2:75:a4:ce
[нд яну 17 22:01:35 2021] wlp5s0: send auth to 30:b5:c2:75:a4:ce (try 1/3)
[нд яну 17 22:01:36 2021] iwlwifi 0000:05:00.0: No beacon heard and the session protection is over already...
[нд яну 17 22:01:36 2021] wlp5s0: Connection to AP 30:b5:c2:75:a4:ce lost
[нд яну 17 22:01:36 2021] wlp5s0: send auth to 30:b5:c2:75:a4:ce (try 2/3)
[нд яну 17 22:01:37 2021] iwlwifi 0000:05:00.0: No beacon heard and the session protection is over already...
[нд яну 17 22:01:37 2021] wlp5s0: Connection to AP 30:b5:c2:75:a4:ce lost
[нд яну 17 22:01:37 2021] wlp5s0: send auth to 30:b5:c2:75:a4:ce (try 3/3)
At this point I thought that the problem is related to the kernel driver, however I tested making the interface managed by ifupdown scripts by putting the following in my /etc/network/interfaces file:
allow-hotplug wlp5s0
iface wlp5s0 inet dhcp
wpa-ssid HOME
wpa-psk <REDACTED>
wpa-debug-level 2
And executing ifup wlp5s0 made the interface connect to my home wifi. I then re-tried again using NM by commenting out those lines and restarting network manager - I got the same set of errors i.e time outs and no beacons heard. To try and debug it myself I acquired -dd output of both wpa_supplicant when run from ifupdown script (working) and when run from NM(by modifying /lib/systemd/system/wpa_supplicant.service) but couldn't find any glaring difference that would point at the issue. I've attached both files to this issue. wpa-supllicant-workingwpa-supllicant-broken
The package version in ubuntu is Version: 1.22.10-1ubuntu2.2 . Looking at the changelog of the package I don't see any major changes the distro has done