wiFi connection drops intermittently and I need to restart to get it working

Questions about Wi-Fi and other network devices, file sharing, firewalls, connection sharing etc
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Post Reply
blacksoldierfly
Level 1
Level 1
Posts: 4
Joined: Sun Nov 26, 2023 9:28 am

wiFi connection drops intermittently and I need to restart to get it working

Post by blacksoldierfly »

Hi Everybody - I have recently purchased a Thinkpad E14 G5 AMD version which came fitted with a Realtek card and have installed LMDE 6 Faye as my OS as I wanted to try and learn Linux. Being a lifelong windows user, it was a bit of a rude shock for me that LMDE didn't come with drivers and day 1 was spent trying to figure out how to get wiFi working. I had used anTIX in the past on an older machine and oddly enough, wiFi worked out of the box. Anyway, I somehow managed to install the drivers using this link https://github.com/lwfinger/rtw89 and all seemed to be working fine for the first 3 days but since last evening my wiFi has been dropping intermittently and it is starting to concern me. I have to restart the machine to so see the wiFi icon connected but in a matter of few hours, I simply get a notification that wiFi has been disconnected and the icon is greyed out. Upon clicking it, I only see an option for wired connection. Below are the basic network related details of my device

Code: Select all

blacksoldierfly@LMDE:~$ inxi -Fxmprz
System:
  Kernel: 6.1.0-13-amd64 arch: x86_64 bits: 64 compiler: gcc v: 12.2.0
    Desktop: Cinnamon v: 5.8.4 Distro: LMDE 6 Faye base: Debian 12.1 bookworm
Machine:
  Type: Laptop System: LENOVO product: 21JSCTO1WW v: ThinkPad E14 Gen 5
    serial: <superuser required>
  Mobo: LENOVO model: 21JSCTO1WW v: ThinkPad serial: <superuser required>
    UEFI: LENOVO v: R2CET31W (1.13) date: 09/26/2023
Battery:
  ID-1: BAT0 charge: 53.4 Wh (93.0%) condition: 57.4/57.0 Wh (100.6%)
    volts: 12.7 min: 11.5 model: Sunwoda L22D3PG5 status: discharging
Memory:
  RAM: total: 6.59 GiB used: 2.67 GiB (40.5%)
  RAM Report: permissions: Unable to run dmidecode. Root privileges
    required.
CPU:
  Info: 6-core model: AMD Ryzen 5 7530U with Radeon Graphics bits: 64
    type: MT MCP arch: Zen 3 rev: 0 cache: L1: 384 KiB L2: 3 MiB L3: 16 MiB
  Speed (MHz): avg: 1836 high: 3633 min/max: 1600/4547 boost: enabled cores:
    1: 1600 2: 1600 3: 1600 4: 1600 5: 2000 6: 1600 7: 1600 8: 1600 9: 3633
    10: 1600 11: 1600 12: 2000 bogomips: 47909
  Flags: avx avx2 ht lm nx pae sse sse2 sse3 sse4_1 sse4_2 sse4a ssse3 svm
Graphics:
  Device-1: AMD Barcelo vendor: Lenovo driver: amdgpu v: kernel arch: GCN-5
    bus-ID: 04:00.0 temp: 45.0 C
  Device-2: Syntek Integrated Camera type: USB driver: uvcvideo
    bus-ID: 1-3:2
  Display: x11 server: X.Org v: 1.21.1.7 with: Xwayland v: 22.1.9 driver: X:
    loaded: amdgpu unloaded: fbdev,modesetting,vesa dri: radeonsi gpu: amdgpu
    resolution: 2240x1400~60Hz
  API: OpenGL v: 4.6 Mesa 22.3.6 renderer: AMD Radeon Graphics (renoir LLVM
    15.0.6 DRM 3.49 6.1.0-13-amd64) direct-render: Yes
Audio:
  Device-1: AMD Renoir Radeon High Definition Audio vendor: Lenovo
    driver: snd_hda_intel v: kernel bus-ID: 04:00.1
  Device-2: AMD ACP/ACP3X/ACP6x Audio Coprocessor vendor: Lenovo
    driver: snd_rn_pci_acp3x v: kernel bus-ID: 04:00.5
  Device-3: AMD Family 17h/19h HD Audio vendor: Lenovo driver: snd_hda_intel
    v: kernel bus-ID: 04:00.6
  API: ALSA v: k6.1.0-13-amd64 status: kernel-api
  Server-1: PipeWire v: 0.3.65 status: active
Network:
  Device-1: Realtek RTL8111/8168/8411 PCI Express Gigabit Ethernet
    vendor: Lenovo driver: r8169 v: kernel port: 3000 bus-ID: 02:00.0
  IF: enp2s0 state: down mac: <filter>
  Device-2: Realtek vendor: Lenovo driver: rtw89_8852be v: N/A port: 2000
    bus-ID: 03:00.0
  IF: wlp3s0 state: up mac: <filter>
Drives:
  Local Storage: total: 238.47 GiB used: 10.9 GiB (4.6%)
  ID-1: /dev/nvme0n1 vendor: Western Digital model: WD PC SN740
    SDDQMQD-256G-1201 size: 238.47 GiB temp: 34.9 C
Partition:
  ID-1: / size: 226.61 GiB used: 10.89 GiB (4.8%) fs: ext4 dev: /dev/nvme0n1p3
  ID-2: /boot/efi size: 285.4 MiB used: 5.8 MiB (2.0%) fs: vfat
    dev: /dev/nvme0n1p1
Swap:
  ID-1: swap-1 type: partition size: 6.89 GiB used: 0 KiB (0.0%)
    dev: /dev/nvme0n1p2
Sensors:
  System Temperatures: cpu: 50.0 C mobo: N/A gpu: amdgpu temp: 45.0 C
  Fan Speeds (RPM): fan-1: 0 fan-2: 0
Repos:
  Packages: 2092
  No active apt repos in: /etc/apt/sources.list
  Active apt repos in: /etc/apt/sources.list.d/official-package-repositories.list
    1: deb http://packages.linuxmint.com faye main upstream import backport
    2: deb https://deb.debian.org/debian bookworm main contrib non-free non-free-firmware
    3: deb https://deb.debian.org/debian bookworm-updates main contrib non-free non-free-firmware
    4: deb http://security.debian.org bookworm-security main contrib non-free non-free-firmware
    5: deb https://deb.debian.org/debian bookworm-backports main contrib non-free non-free-firmware
Info:
  Processes: 299 Uptime: 38m Init: systemd target: graphical (5) Compilers:
  gcc: 12.2.0 Shell: Bash v: 5.2.15 inxi: 3.3.26

Code: Select all

blacksoldierfly@LMDE:~$ rfkill list all
0: tpacpi_bluetooth_sw: Bluetooth
	Soft blocked: yes
	Hard blocked: no
1: phy0: Wireless LAN
	Soft blocked: no
	Hard blocked: no

Code: Select all

blacksoldierfly@LMDE:~$ iwconfig
lo        no wireless extensions.

enp2s0    no wireless extensions.

wlp3s0    IEEE 802.11  ESSID:"TP-Link_D60A"  
          Mode:Managed  Frequency:2.412 GHz  Access Point: D8:0D:17:2E:D6:0A   
          Bit Rate=180 Mb/s   Tx-Power=20 dBm   
          Retry short limit:7   RTS thr:off   Fragment thr:off
          Power Management:on
          Link Quality=54/70  Signal level=-56 dBm  
          Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0
          Tx excessive retries:0  Invalid misc:118   Missed beacon:0

Code: Select all

blacksoldierfly@LMDE:~$ lspci
00:00.0 Host bridge: Advanced Micro Devices, Inc. [AMD] Renoir/Cezanne Root Complex
00:00.2 IOMMU: Advanced Micro Devices, Inc. [AMD] Renoir/Cezanne IOMMU
00:01.0 Host bridge: Advanced Micro Devices, Inc. [AMD] Renoir PCIe Dummy Host Bridge
00:02.0 Host bridge: Advanced Micro Devices, Inc. [AMD] Renoir PCIe Dummy Host Bridge
00:02.1 PCI bridge: Advanced Micro Devices, Inc. [AMD] Renoir/Cezanne PCIe GPP Bridge
00:02.2 PCI bridge: Advanced Micro Devices, Inc. [AMD] Renoir/Cezanne PCIe GPP Bridge
00:02.3 PCI bridge: Advanced Micro Devices, Inc. [AMD] Renoir/Cezanne PCIe GPP Bridge
00:08.0 Host bridge: Advanced Micro Devices, Inc. [AMD] Renoir PCIe Dummy Host Bridge
00:08.1 PCI bridge: Advanced Micro Devices, Inc. [AMD] Renoir Internal PCIe GPP Bridge to Bus
00:14.0 SMBus: Advanced Micro Devices, Inc. [AMD] FCH SMBus Controller (rev 51)
00:14.3 ISA bridge: Advanced Micro Devices, Inc. [AMD] FCH LPC Bridge (rev 51)
00:18.0 Host bridge: Advanced Micro Devices, Inc. [AMD] Cezanne Data Fabric; Function 0
00:18.1 Host bridge: Advanced Micro Devices, Inc. [AMD] Cezanne Data Fabric; Function 1
00:18.2 Host bridge: Advanced Micro Devices, Inc. [AMD] Cezanne Data Fabric; Function 2
00:18.3 Host bridge: Advanced Micro Devices, Inc. [AMD] Cezanne Data Fabric; Function 3
00:18.4 Host bridge: Advanced Micro Devices, Inc. [AMD] Cezanne Data Fabric; Function 4
00:18.5 Host bridge: Advanced Micro Devices, Inc. [AMD] Cezanne Data Fabric; Function 5
00:18.6 Host bridge: Advanced Micro Devices, Inc. [AMD] Cezanne Data Fabric; Function 6
00:18.7 Host bridge: Advanced Micro Devices, Inc. [AMD] Cezanne Data Fabric; Function 7
01:00.0 Non-Volatile memory controller: Sandisk Corp Device 5016 (rev 01)
02:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller (rev 15)
03:00.0 Network controller: Realtek Semiconductor Co., Ltd. Device b852
04:00.0 VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI] Barcelo (rev c5)
04:00.1 Audio device: Advanced Micro Devices, Inc. [AMD/ATI] Renoir Radeon High Definition Audio Controller
04:00.2 Encryption controller: Advanced Micro Devices, Inc. [AMD] Family 17h (Models 10h-1fh) Platform Security Processor
04:00.3 USB controller: Advanced Micro Devices, Inc. [AMD] Renoir/Cezanne USB 3.1
04:00.4 USB controller: Advanced Micro Devices, Inc. [AMD] Renoir/Cezanne USB 3.1
04:00.5 Multimedia controller: Advanced Micro Devices, Inc. [AMD] ACP/ACP3X/ACP6x Audio Coprocessor (rev 01)
04:00.6 Audio device: Advanced Micro Devices, Inc. [AMD] Family 17h/19h HD Audio Controller
Short of sending this device back to lenovo for a check or getting a new wiFi card, how can I diagnose this issue better and then resolve it?
User avatar
Pjotr
Level 24
Level 24
Posts: 20142
Joined: Mon Mar 07, 2011 10:18 am
Location: The Netherlands (Holland) 🇳🇱
Contact:

Re: wiFi connection drops intermittently and I need to restart to get it working

Post by Pjotr »

Disabling WiFi power management might help:
https://easylinuxtipsproject.blogspot.c ... ml#ID2.1.1
(item 2.1.1)
Tip: 10 things to do after installing Linux Mint 21.3 Virginia
Keep your Linux Mint healthy: Avoid these 10 fatal mistakes
Twitter: twitter.com/easylinuxtips
All in all, horse sense simply makes sense.
blacksoldierfly
Level 1
Level 1
Posts: 4
Joined: Sun Nov 26, 2023 9:28 am

Re: wiFi connection drops intermittently and I need to restart to get it working

Post by blacksoldierfly »

Hi Pjotr - Thank you for the quick response. Here is what happens when I follow the steps mentioned on the article

Code: Select all

blacksoldierfly@LMDE:~$ sudo sed -i 's/3/2/' /etc/NetworkManager/conf.d/default-wifi-powersave-on.conf
[sudo] password for blacksoldierfly:                  
sed: can't read /etc/NetworkManager/conf.d/default-wifi-powersave-on.conf: No such file or directory
Any thoughts on what I might be doing wrong?
User avatar
Pjotr
Level 24
Level 24
Posts: 20142
Joined: Mon Mar 07, 2011 10:18 am
Location: The Netherlands (Holland) 🇳🇱
Contact:

Re: wiFi connection drops intermittently and I need to restart to get it working

Post by Pjotr »

My guess: you're doing nothing wrong, but this might simply be one of the differences between LMDE and normal (Ubuntu based) Mint.

Create a file called /etc/NetworkManager/conf.d/default-wifi-powersave-off.conf:

Code: Select all

sudo touch /etc/NetworkManager/conf.d/default-wifi-powersave-off.conf
Open it for editing:

Code: Select all

xed admin:///etc/NetworkManager/conf.d/default-wifi-powersave-off.conf
Copy/paste this text into that empty text file:

Code: Select all

[connection]
wifi.powersave = 2
Reboot and test.

Reference:
https://forums.debian.net/viewtopic.php ... 65#p781065
Tip: 10 things to do after installing Linux Mint 21.3 Virginia
Keep your Linux Mint healthy: Avoid these 10 fatal mistakes
Twitter: twitter.com/easylinuxtips
All in all, horse sense simply makes sense.
blacksoldierfly
Level 1
Level 1
Posts: 4
Joined: Sun Nov 26, 2023 9:28 am

Re: wiFi connection drops intermittently and I need to restart to get it working

Post by blacksoldierfly »

Thank you, once again, for the quick response.

I followed the link you posted which then led me to this link https://bugs.launchpad.net/ubuntu/+sour ... ug/1960817

Followed these steps
--
When there's no such .conf file yet:
sudo touch /etc/NetworkManager/conf.d/default-wifi-powersave-off.conf

echo "[connection]" | sudo tee /etc/NetworkManager/conf.d/default-wifi-powersave-off.conf

echo "wifi.powersave = 2" | sudo tee -a /etc/NetworkManager/conf.d/default-wifi-powersave-off.conf

Reboot.
--
However, when I reboot, Power management turns on again. So I followed the steps again and this time, instead of reboot, simply restarted NetworkMAnager following this link https://gist.github.com/jcberthon/ea8cf ... 5344bc8b55
--
sudo systemctl restart NetworkManager
--
iwconfig now shows that Power management is turned off but I am yet to reboot and test again. will do so later today as I have to step out to get some work done urgently. Hopefully, this works. Will report back if it doesn't. Thanks all!
blacksoldierfly
Level 1
Level 1
Posts: 4
Joined: Sun Nov 26, 2023 9:28 am

Re: wiFi connection drops intermittently and I need to restart to get it working

Post by blacksoldierfly »

Got back home, logged in and in a minute the connection dropped. Rebooted and the wifi connection is back.

Retried with your steps only to realize that the file exists with the value 2 but iwconfig shows that Power management is still on. Arggh!

What else can I do?
User avatar
Pjotr
Level 24
Level 24
Posts: 20142
Joined: Mon Mar 07, 2011 10:18 am
Location: The Netherlands (Holland) 🇳🇱
Contact:

Re: wiFi connection drops intermittently and I need to restart to get it working

Post by Pjotr »

Weird.... Well, as a temporary workaround (until some future update fixes it), you might make a habit of executing systemctl restart NetworkManager after booting your system. On my ordinary Mint I don't even need to type sudo for that.

For the sake of convenience, you can use the memory of the terminal: the "up" arrow on your keyboard calls up the previous command in the terminal.
Tip: 10 things to do after installing Linux Mint 21.3 Virginia
Keep your Linux Mint healthy: Avoid these 10 fatal mistakes
Twitter: twitter.com/easylinuxtips
All in all, horse sense simply makes sense.
Post Reply

Return to “Networking”