Comment 93 for bug 1589401

Revision history for this message
Anders J (andersj23) wrote :

I'm seeing the same problem on a Thinkpad T450s with "Intel Corporation Wireless 7265 (rev 59)" (iwlwifi) on Ubuntu 16.04.1, all packages up-to-date as of time of writing:

Kernel 4.4.0-43-generic
network-manager 1.2.2-0ubuntu0.16.04.3
network-manager-gnome 1.2.0-0ubuntu0.16.04.4

This is a bog-standard install with all the defaults (i.e. LightDM, Unity, ..).

(I have also tried all this with my normal setup, which is booting to console (no LightDM) and using startx to start i3 (no Unity). Exact same issue.)

On laptop resume wifi connection still works but nm-applet no longer shows a list of available wifi networks. However, 'nmcli dev wifi list' *DOES* show the normal list of the couple of dozens networks around me.

The suggested workaround 'sudo iw dev wlan0 scan' (or, for me, wlp3s0) has no effect. It shows info about the networks in the console but changes nothing in nm-applet.

If I simply kill nm-applet and start it again, everything is fine. (I saw someone above killing nm-applet and starting it as root. You should start it as your normal user.)

I came up with a simple workaround. If you're in the same boat (i.e., if "killall nm-applet && nm-applet &" makes it work again), the following might work for you too. Add the following to a new file, /lib/systemd/system-sleep/fix-nm-applet, replacing yourusername with whatever user you're logged in to X as:

#!/bin/sh
USER=yourusername
export DISPLAY=:0

case $1 in
  post/*)
    su $USER -c 'killall nm-applet; sleep 4; nm-applet' &
    ;;
esac

Then make it executable: chmod +x /lib/systemd/system-sleep/fix-nm-applet

Then try suspending and resuming. The script simply kills nm-applet on resume, waits 4 seconds, and starts nm-applet again. (It appears that nm-applet will still b0rk if executed too early after resume, thus the sleep -- if it doesn't work, try a higher value.)

It's an ugly solution (I also tried to do it as a systemd service, but no dice, and my patience was running low) -- but it's the best I've got at the moment...