Wifi randomly stops working when on battery power

My laptop’s WiFi connectivity is unreliable while on battery power. It will function properly for a brief period before disconnecting. I have discovered that disconnecting and then reconnecting from the taskbar applet is an effective troubleshooting method for restoring connectivity.

I did a little digging and found this article and comment that seem relevant to my WiFi chipset.
Network configuration/Wireless - ArchWiki and Random failure on PopOS (Debian Base) · Issue #275 · lwfinger/rtw89 · GitHub

Based on the suggestions mentioned in the section relevant to my driver (rtw89), I changed the following config file on my system with this entry.

/etc/modprobe.d/70-rtw89.conf

options rtw89_pci disable_aspm_l1=y disable_aspm_l1ss=y
options rtw89pci disable_aspm_l1=y disable_aspm_l1ss=y
options rtw89_core disable_ps_mode=y
options rtw89core disable_ps_mode=y

Unfortunately, this didn’t really solve the issue. The alternative was to build the open source driver for this wifi chipset from GitHub - lwfinger/rtw89: Driver for Realtek 8852AE, an 802.11ax device and rebuild and reload it on every kernel update. This already sounds like a lot of work to get wifi working! and I am confused with the installation steps as well.

The following is my system configuration.

$ inxi -SNn --filter
System:
  Kernel: 6.10.6-200.fc40.x86_64 arch: x86_64 bits: 64
  Desktop: Cinnamon v: 6.2.8 Distro: Fedora Linux 40 (Cinnamon)
Network:
  Device-1: Realtek RTL8111/8168/8211/8411 PCI Express Gigabit Ethernet
    driver: r8169
  IF: eno1 state: up speed: 100 Mbps duplex: full mac: <filter>
  Device-2: Realtek RTL8852AE 802.11ax PCIe Wireless Network Adapter
    driver: rtw89_8852ae
  IF: wlo1 state: up mac: <filter>

$ lspci
...
04:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168/8211/8411 PCI Express Gigabit Ethernet Controller (rev 16)
05:00.0 Network controller: Realtek Semiconductor Co., Ltd. RTL8852AE 802.11ax PCIe Wireless Network Adapter
...
$ lsmod | grep rtw
rtw89_8852ae           12288  0
rtw89_8852a           716800  1 rtw89_8852ae
rtw89_pci             114688  1 rtw89_8852ae
rtw89_core            950272  2 rtw89_pci,rtw89_8852a
mac80211             1753088  2 rtw89_core,rtw89_pci
cfg80211             1421312  3 rtw89_core,mac80211,rtw89_8852a

Can anyone show me a way to solve this. Luckily my laptop has an Ethernet port and I use it more like a desktop these days due to this issue. I have been using Linux on this laptop for quite a long time and there were never any issues like this a year ago and I have only seen this network regression since last year. I have seen this problem persist while running arch-based EndeavourOS with the KDE desktop environment, and now on Fedora.

I suspect it is related to the power conservation settings to reduce power consumption when on the battery. Wifi constantly consumes power to stay connected while ethernet does not.

Check your settings there before digging a deeper hole.

I don’t think there is any user setting that I can change from Cinnamon DE. The config changes in /etc/modprobe.d/70-rtw89.conf is meant to take care of this power saving feature for the chipset.

See also:
How to keep internet connection connected without interruption - #4 by vgaetera

I have a Microsoft Studio Surface laptop and I also noticed just now that my wifi disappears when on battery power. I don’t think this happened a few kernel versions ago… :frowning_face:

I tried older kernel versions from my list, but couldn’t see a pattern. Sometimes when rebooting the wifi option in the menu (Gnome for me) is simply gone, and sometimes it’s there but it doesn’t populate the list of available networks. Only when I plug in my laptop to power does it behave as one would reasonably expect.

I have found that my laptop keeps disconnecting even when plugged in and present in different room. This is also not a consistent behavior because the network speed and latency would be perfectly normal for 10-15 minutes and then it drops.

Let me know if you want to look at the logs. I can share them in ways you want. I am viewing them with Gnome Logs.