This seems a rather frequent problem in ubuntu 16.04 on which Loki is based (askubuntu question: 16.04 LTS wifi connection issuesaskubuntu question: 16.04 LTS wifi connection issues) and it happened very often on my system.
You can try other answers under that askubuntu question, but for me it got less frequent (I guess) after following this answerthis answer .
What it says is:
- Get details of your PCI wireless card by running
sudo lshw -class network
- Get your card model info according to the product line. For instance, as you can see in the question description it says
product: RTL8723BE PCIe Wireless Network Adapter
so the model of my card isRTL8723BE
- Open or create
/etc/pm/config.d/config
and addSUSPEND_MODULES="rtl8723be"
(replace rtl8723be with your own model number) Then runecho "options rtl8723be fwlps=N" | sudo tee /etc/modprobe.d/rtl8723be.conf
and reboot.
It rarely happens now and when it does I use the command service network-manager restart
.
That can be associated with a shortcut key. I prefer a desktop launcher to run from Slingshot:
gedit ~/.local/share/applications/restart_wifi.desktop
with:
[Desktop Entry]
Icon=urserver
Name=Restart Wifi
Type=Application
Exec=bash -c 'service network-manager restart'
Categories=Network;