3

When waking from sleep, sometimes my Linux laptop won't reestablish it's Wi-Fi internet connection.

Interestingly, rebooting fixes it, although it's kind of a pain to have to do a full shutdown/reboot.

In other words, when coming out of sleep, sometimes my HP Debian Buster v10.4 laptop fails to reconnect to my home access point. This occurs at a rate, very roughly of about 1 out of every 6 sleepovers or so.


After noticing that the Wi-fi is down, clicking on rescan for wireless networks does not fix it. Also, iw wlan0 scan, (or explicitly iw dev wlan0 scan) gives: 'command failed: Network is down (-100)'.


Carefully studding the output of journalctl -n 1000 -u NetworkManager -u wpa_supplicant I can see that very soon after the line: "NetworkManager state is now ASLEEP" (i.e. when waking up), the first trouble appears to be at a line that says: "device (wlan0): supplicant interface state: completed -> disabled".

I think this should have been rather, "... completed -> disconnected", which appears in working wake-ups, i.e. when WI-fi properly works again after waking up.

What doesn't fix it:

  • Logout and log back in;
  • Sleeping and waking up again,
  • Hibernating and then waking back up from that
  • Restarting Network Manager (with $ sudo systemctl restart NetworkManager.service)
  • Running $ sudo nmcli networking on
  • Deleting and recreating the wlan0 network device with: iw dev wlan0 del, then iw phy phy0 interface add wlan0 type managed addr ca:xxx:4b. Even though this appeared to work, wi-fi still does not.

I've also checked that $ rfkill list doesn't report any blockages.


Here's the status report from nmcli when in a failed (internet down) state. Notice the GENERAL.STATE below. (I've obfuscated real addresses.)

$ nmcli device show wlan0
GENERAL.DEVICE:                         wlan0
GENERAL.TYPE:                           wifi
GENERAL.HWADDR:                         00:26:##:##:##:2A
GENERAL.MTU:                            1500
GENERAL.STATE:                          20 (unavailable)    <-- this is not right
GENERAL.CONNECTION:                     --
GENERAL.CON-PATH:                       --
...

Also, here's the status report from a normal working wifi connection:

$ nmcli device show wlan0
GENERAL.DEVICE:                         wlan0
GENERAL.TYPE:                           wifi
GENERAL.HWADDR:                         00:26:##:##:##:2A
GENERAL.MTU:                            1500
GENERAL.STATE:                          100 (connected)     <--- this is when it works
GENERAL.CONNECTION:                     Auto NETGEAR14
GENERAL.CON-PATH:                       /org/freedesktop/NetworkManager/ActiveConnection/1
IP4.ADDRESS[1]:                         192.168.1.128/32
IP4.GATEWAY:                            192.168.1.1
IP4.ROUTE[1]:                           dst = 192.168.1.128/32, nh = 0.0.0.0, mt = 600
IP4.ROUTE[2]:                           dst = 192.168.1.1/32, nh = 0.0.0.0, mt = 600
IP4.ROUTE[3]:                           dst = 169.254.0.0/16, nh = 0.0.0.0, mt = 1000
IP4.ROUTE[4]:                           dst = 0.0.0.0/0, nh = 192.168.1.1, mt = 600
IP4.DNS[1]:                             192.168.1.1
IP6.ADDRESS[1]:                         fe80::...:7f2a/64
IP6.GATEWAY:                            --
IP6.ROUTE[1]:                           dst = fe80::/64, nh = ::, mt = 600
IP6.ROUTE[2]:                           dst = ff00::/8, nh = ::, mt = 256, table=255

Any ideas? Is there a way to reinitialize the phy0 radio driver?

2 Answers 2

3

The best way to debug this by checking the system log messages at around the time your connection disappears:

journalctl -n 1000 -u NetworkManager -u wpa_supplicant

NetworkManager does not directly use the kernel Wi-Fi APIs, it relies on wpa_supplicant for this. It could be that wpa_supplicant.service is wedged up, or keeps crashing, or is conflicting with another Wi-Fi tool (e.g. iwd, connman, or a different wpa_supplicant instance accidentally launched by another app).

You can increase the verbosity of NetworkManager by running:

nmcli gen log level debug

and of wpa_supplicant by running:

busctl set-property fi.w1.wpa_supplicant1 \
                   /fi/w1/wpa_supplicant1 \
                    fi.w1.wpa_supplicant1 DebugLevel s debug

Additionally, try to completely bypass NM & w_s and directly ask the kernel to scan for networks – if it works, the problem is likely to be on the userspace side; if it doesn't, it's likely on the driver/hardware side:

iw wlan0 scan
3
  • Using journalctl -n 1000 -u NetworkManager -u wpa_supplicant I can see that very soon after "NetworkManager state is now ASLEEP" (i.e. when waking up), the first trouble appears to be at "device (wlan0): supplicant interface state: completed -> disabled". I think this should have been rather, "... completed -> disconnected", which appears in working wake-ups, i.e. when wi-fi works properly after waking up. iw wlan0 scan, (and explicitly iw dev wlan0 scan) give: 'command failed: Network is down (-100)'. Jul 20, 2020 at 2:26
  • I also tried deleting and recreating the wlan0 network device: iw dev wlan0 del then iw phy phy0 interface add wlan0 type managed addr ca:xxx:4b. Even though this appeared to work, wi-fi still does not. 5 of 6 sleepovers everything works. Only once in awhile does it fail to wakup properly. Thanks for your help! Jul 20, 2020 at 2:30
  • It looks to be a hardware problem after all. Also got an error from BIOS on one of the hybernate restarts, so this proved it wasn't a GNU/Linux thing. So popped the PCI wi-fi card out of the back of the laptop, reseated it's contacts by wiggling it about, put it back in and so far it's ok. Time will tell. If it persists, now I can see that I can get a new replacement card. The humidity here makes things go funny faster I think. THANKS ever so much! Jul 21, 2020 at 7:49
0

Try replacing your WI-FI card (hardware).

It cost me about $20 for a new one, and it's fairly easy to find inside your laptop, (search for help on you-tube). I got the part# right off of the old card. You'll need some small watch type screwdrivers.

It's been two months since getting the new card and problem is gone.

Mine looked like this:

enter image description here

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .