0

I upgraded from Ubuntu 22.04 to 22.10 not too long ago, and I recently started having issues with the wifi.

Issue: apparently randomly, the wifi sometimes works and some times it doesn't. At times it will connect but with no internet access, at other times it won't connect at all, and at other times it will connect but internet will be rather slow.

It is 100% certain this is an Ubuntu software issue as I can exclude everything else:

  • not a PC hardware issue: same PC has a separate HD with Windows on it, connection works (Windows fast load has been disabled, does not solve the issue)
  • not a router issue: other devices can connect to the network
  • (???) weirdly, some times I can hotspot from my phone (on the same wifi network) and my PC can connect to internet through there. Sometimes this does not work.

On the Ubuntu forums they have a script that collects a bunch of information to troubleshoot the issue, which I've pasted here: https://pastebin.ubuntu.com/p/bc5RCgnv2Y/

I received no response on the forums so I'm hoping this is a more frequented place!

Thank you to anyone who might be able to help.

Edit: also, I just tried connecting to a different network (e.g. Starbucks) and that one works. But I'd really like to just use my network, which works with everything else.

Edit 2: dmesg comes up with a bunch of red error messages when it fails to connect to the router. Here are the relevant logs when I tried connecting multiple times: https://pastebin.ubuntu.com/p/jRdtGvWwwD/ and here are the relevant logs when I successfully switched to the Starbucks network instead: https://pastebin.ubuntu.com/p/33wxHwKts9/

  • 2
    "not a router issue: other devices can connect to the network" Actually, that's CLASSIC behavior of a flaky cheap consumer-grade wi-fi router. I have one of those, and must reboot every few days, and then all the wi-fi problems vanish. So it doesn't prove the router blameless -- it's quite possible that you PC and your router might both have independent problems, or not. – user535733 Jan 27 '23 at 23:15
  • I've restarted my router many times, but I don't get a working connection after I do. It's been working fine for the past 8 months, and issues are only happening with ubuntu – tartartar Jan 28 '23 at 13:18

1 Answers1

1

Your wireless may be dropping because there are two wireless access points with the same name and password. This is typical when you have a 2.4 gHz segment and a 5 gHz segment of the same router. Your wireless may be roaming, looking for a better connection. If this is the case, I suggest that you rename the access points; something like myrouter2.4 and myrouter5.

Your wireless may be dropping because of power management; that is, the feature where the card partially powers down to save battery power during periods of inactivity and then, ideally, powers back up seamlessly when activity resumes. Let's disable power saving to see if it helps. From the terminal:

sudo sed -i 's/3/2/' /etc/NetworkManager/conf.d/*

Your wireless may be dropping because the channel to which it was connected has suddenly changed. Please be certain to set a fixed channel, not auto-select.

After making these changes, reboot the router.

EDIT1: In both pastes, we see many repeats of the following:

ieee80211 phy0: Hardware restart was requested
iwlwifi 0000:04:00.0: Queue 2 is stuck 0 2
iwlwifi 0000:04:00.0: Microcode SW error detected. Restarting 0x0.
iwlwifi 0000:04:00.0: Start IWL Error Log Dump:

In other words, as soon as the wireless device/driver/firmware combination sees and tries to connect with an access point; usually your own router, it stumbles on a stuck queue, dumps the firmware and restarts. All of this takes some seconds of time, during which you are disconnected and then reconnected.

In the Starbucks case, your wireless recovers and then connects to, I assume, the relatively simple 2.4 gHz router and doesn’t stumble.

In the case of your home router, I’m confident that the advanced Intel AX200 tries to connect to the 5 gHz segment and stumbles, disconnects, recovers, etc. again and again.

I suggest that we try some driver parameters to see if we can fix it. Please open a terminal and do:

sudo -i
echo “options iwlwifi amsdu_size=1 disable_11ax=true”  >>  /etc/modprobe.d/iwlwifi.conf
echo “options iwlmvm power_scheme=1”  >  /etc/modprobe.d/iwlmvm.conf
exit

We are disabling 80211ax even though your device is capable, because neither your router nor Starbucks are capable.

Reboot and tell us if there is any improvement:

sudo dmesg | grep iwl

I also suggest that you bind to the 5 gHz segment of your router like this: 19.10 Ubuntu automatically connects to a weaker Wi-Fi Please note that the 2.4 and 5 gHz segments will have different MAC addresses; you want to bind, of course to the 5 gHz segment.

chili555
  • 60,188
  • Thanks for your answer! I've executed the command to disable power saving, and then went to change SSID... only to notice that my router allows me to have only one network name for both frequencies. So it will always be two access points with the same name :/ still experiencing the problem, and added some dmesg output to my original post. There are some error logs there, maybe those can help identify the issue? – tartartar Jan 28 '23 at 13:17
  • Please see my edit above in a few moments. – chili555 Jan 28 '23 at 14:27
  • So I did as you suggested but it did not work - it kept trying to connect to the 5 GHz segment (and I couldn't connect to it specifically via network manager). But I knew that the router manager allows me to turn off either the 5 GHz or the 2.4 GHz, so I turned off the 5 GHz and my PC now seems very happy to connect to the 2.4 GHz segment and hasn't complained since. Thank you so much for your help with this, you've been very patient and helped me sort out this headache! – tartartar Jan 28 '23 at 21:38