2

After a recent upgrade noticing wifi disconnects randomly, speeds vary back and forth from 0.1Mbps to 100Mbps within a few seconds, can be up for a few seconds, or a few hours, not predictable. I'm trying to file a bug report using ubuntu-bug but I don't know which package is at fault.

This might be some relevant information, but I looked through the modules and don't see anything like rtw_8821ce, there are rtw88_* modules which might be relevant, but in any case I can't map these to any packages as far as I can tell.

Distributor ID: Ubuntu
Description:    Ubuntu 23.10
Release:        23.10
Codename:       mantic
  *-network
       description: Wireless interface
       product: Realtek Semiconductor Co., Ltd.
       vendor: Realtek Semiconductor Co., Ltd.
       physical id: 0
       bus info: pci@0000:02:00.0
       logical name: wlp2s0
       version: 00
       serial: b4:b0:24:d4:d7:ea
       width: 64 bits
       clock: 33MHz
       capabilities: pm msi pciexpress bus_master cap_list ethernet physical wireless
       configuration: broadcast=yes driver=rtw_8821ce driverversion=6.5.0-15-generic firmware=N/A ip=192.168.2.52 latency=0 link=yes multicast=yes wireless=IEEE 802.11
       resources: irq:33 ioport:e000(size=256) memory:f7c00000-f7c0ffff
02:00.0 Network controller: Realtek Semiconductor Co., Ltd. Device b821
        Subsystem: Realtek Semiconductor Co., Ltd. Device b821
        Flags: bus master, fast devsel, latency 0, IRQ 33
        I/O ports at e000 [size=256]
        Memory at f7c00000 (64-bit, non-prefetchable) [size=64K]
        Capabilities: [40] Power Management version 3
        Capabilities: [50] MSI: Enable+ Count=1/1 Maskable- 64bit+
        Capabilities: [70] Express Endpoint, MSI 00
        Capabilities: [100] Advanced Error Reporting
        Capabilities: [148] Device Serial Number 00-e0-4c-ff-fe-c8-21-01
        Capabilities: [158] Latency Tolerance Reporting
        Capabilities: [160] L1 PM Substates
        Capabilities: [170] Precision Time Measurement
        Capabilities: [17c] Vendor Specific Information: ID=0003 Rev=1 Len=054 <?>
        Kernel driver in use: rtw_8821ce
        Kernel modules: rtw88_8821ce

This was the best reference I can find: WiFi frequently and randomly disconnects, rtw_8821ce driver, but even though it's in the "Newbie Corner" section, I'm not able to follow what they're doing. Like "Have you tried connecting with just wpa_supplicant (and a DHCP client if needed)?" is way over my skill level.

In any case, I'd like to at least fill out a bug report if anyone can help with identifying the relevant package.


As requested, this is the relevant output from iwconfig, I've just rebooted, as that sometimes helps for a bit, so the stats might not be representative:

wlp2s0    IEEE 802.11  ESSID:"************"  
          Mode:Managed  Frequency:5.785 GHz  Access Point: 0E:**:**:**:**:0F   
          Bit Rate=13 Mb/s   Tx-Power=30 dBm   
          Retry short limit:7   RTS thr:off   Fragment thr:off
          Encryption key:off
          Power Management:off
          Link Quality=50/70  Signal level=-60 dBm  
          Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0
          Tx excessive retries:92  Invalid misc:0   Missed beacon:0

And another output a few minutes later:

wlp2s0    IEEE 802.11  ESSID:"************"  
          Mode:Managed  Frequency:2.412 GHz  Access Point: 0C:**:**:**:**:0D   
          Bit Rate=58.5 Mb/s   Tx-Power=30 dBm   
          Retry short limit:7   RTS thr:off   Fragment thr:off
          Encryption key:off
          Power Management:off
          Link Quality=62/70  Signal level=-48 dBm  
          Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0
          Tx excessive retries:9  Invalid misc:1   Missed beacon:0

And after a few hours, note the speed looks really good, but the connection isn't working. I'm running off a hot spot now.

wlp2s0    IEEE 802.11  ESSID:"************"  
          Mode:Managed  Frequency:5.785 GHz  Access Point: 0E:**:**:**:**:0F   
          Bit Rate=175.5 Mb/s   Tx-Power=30 dBm   
          Retry short limit:7   RTS thr:off   Fragment thr:off
          Encryption key:off
          Power Management:off
          Link Quality=39/70  Signal level=-71 dBm  
          Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0
          Tx excessive retries:146  Invalid misc:66   Missed beacon:0
Yimin Rong
  • 123
  • 5

1 Answers1

1

To file a bug report on the WiFi drivers do ubuntu-bug linux. You can also try "network-manager" if you believe it's a userspace problem.

The actual problem

Your connection is switching between 2.4GHz and 5GHz. That also caused problems for me in the past. Let's run the following command to disable the automatic switching by making it use your 2.4GHz version only:

nmcli connection modify YOUR_ESSID 802-11-wireless.bssid 0C:**:**:**:**:0D
# This assumes one router like a home network.
# If on an enterprise network, you might need to move around and
# add commas for all the MACs
reboot

In the 3 iwconfig outputs you posted, the only reliable connection was the 2.4GHz one. Switching between frequencies is a common thing to stop working, and I have had multiple phones and laptops lose internet until reconnecting before one day I just put the 2.4 and 5 GHz networks on different names.

It is not a good idea to use 5 GHz at your location. You are far or walled off from the access point, as shown by your "Link Quality=50/70" and "Link Quality=39/70". Yes, 5GHz is faster but only when it's reliably connected. In this case your 5GHz has "Tx excessive retries:92" and "Tx excessive retries:146". Not only is your connection slower on average because of the retries, your connection speed will jump up and down.

The numbers for your 2.4GHz WiFi are much better, so you should just use that. 2.4GHz is able to travel further and go through walls better. The recent upgrade must have change the WiFi logic to prefer switching to 5GHz, but evidently that change worsened your case.

Daniel T
  • 4,594
  • Thank you. I tried that but still getting the connections failing. I've installed a WiFi dongle as a backup to the WiFi card and set both to equal priority, but Ubuntu doesn't seem to want to use it when the card loses connection, instead I have to manually select the dongle. I'll see what comes up from the bug report. Thanks again. – Yimin Rong Jan 30 '24 at 11:32
  • @YiminRong If you want to always use the WiFi dongle and disable the internal WiFi card, you can see my rfkill answer at https://askubuntu.com/a/1501779/1004020 and just do it for the wlan type instead of the bluetooth type – Daniel T Jan 30 '24 at 21:41
  • I'd prefer to use the card because it's faster (when it works!), but then have it switch automatically to the dongle when the card goes down. After some time, the card often starts working again, so it would be great if it would switch back, but that's crazy talk. – Yimin Rong Feb 02 '24 at 16:59