Are you using a Notebook Computer?
IF so, may need to disable powersave that cuts wifi if Notebook battery is draining:
sudo nano /etc/NetworkManager/conf.d/default-wifi-powersave-on.conf
You will see:
[connection]
wifi.powersave = 3
Change the 3
to a 2
to disable powersave, so that it looks exactly like:
[connection]
wifi.powersave = 2
To save and exit; tap the keyboard shortcut ctrl+x
, then the y
key to say yes to save then the enter
key to save as current configuration.