6

When I wake my laptop up after being suspended for a little while, the WiFi signal gets replaced by up and down arrows. The connection still works, but is rather annoying nonetheless. Restarting the Network Manager works, but is only a temporary fix.

I read somewhere that it might be because the connection is getting renamed, thus causing it to think I'm connected via Ethernet instead of WiFi?

How can I fix this?

Edit: I've noticed that this also happens on occasion after turning WiFi on/off.

Mixx
  • 673

2 Answers2

5

Automatic Method

Using sudo powers create the file /lib/systemd/system-sleep/iwlwifi-reset containing:

#!/bin/sh

NAME: /lib/systemd/system-sleep/iwlwifi-reset

DESC: Resets Intel WiFi after a long suspend.

DATE: Apr 1, 2017. Modified April 8, 2017.

NOTE: Per AU comment restart network.

MYNAME=$0

restart_wifi() { /usr/bin/logger $MYNAME 'restart_wifi BEGIN'

/sbin/modprobe -v -r iwldvm # This removes iwlwifi too

/sbin/modprobe -v iwlwifi # This starts iwldvm too

systemctl restart NetworkManager.service
/usr/bin/logger $MYNAME 'restart_wifi END'

}

/usr/bin/logger $MYNAME 'case=[' ${1}' ]' case "${1}/${2}" in hibernate|suspend|pre) ;; resume|thaw|post) restart_wifi;; esac

Mark the script as executable using:

sudo chmod a+x /lib/systemd/system-sleep/iwlwifi-reset

To check execution of the script after waking up from suspend use:

cat /var/log/syslog | grep iwlwifi

Don't get too excited if it seems to work during testing because there are times when this script works with a short suspend but doesn't work after a long suspend.

If this doesn't work, before trying the Manual Method in the next section, place the command sleep 5 before the line restart_wifi;;.

Manual Method

If the automatic method isn't working using sudo powers create the script /usr/local/bin/iwlwifi-reset containing:

#!/bin/sh

NAME: /usr/lib/bin/iwlwifi-reset

DESC: Manually reset Intel WiFi.

DATE: Apr 1, 2017. Modified April 8, 2017.

NOTE: Must call using SUDO POWERS.

MYNAME=$0

/usr/bin/logger $MYNAME 'restart_wifi BEGIN'

modprobe -r iwldvm # This removes iwlwifi too

modprobe iwlwifi # This starts iwldvm too

systemctl restart NetworkManager.service /usr/bin/logger $MYNAME 'restart_wifi END'

Mark the script as executable using:

sudo chmod a+x /usr/local/bin/iwlwifi-reset

As described in the last section you can check /var/log/syslog for messages when this script is run but you will see any error messages in your terminal anyway.

To call this script use:

sudo iwlwifi-reset

You don't need to specify the directory because /usr/local/bin is in the terminal's command search path.


Edit April 8, 2017 As per OP comment and this How-To, revisions to script were made. Instead of removing and reinserting kernel modules, restarting network services were used.

0

I had this issue also with my HP pavilon G6, which didn't really start until I got a new usb adaptor and plugged it in. After some searching I figured out that the wrong drivers were being used so I installed the correct drivers (Ralink) and it worked out. You didn't mention that you had a second adaptor but maybe checking to see what modprobe returns will help.

I got the idea from the last answer in this thread: Wifi doesn't work after suspend after 16.04 upgrade