All we need to do is run a couple of commands and create or edit a file in /etc/pm/power.d that will basically tell Ubuntu to turn the wi-fi power management off and to keep it off permanently when in battery mode, so we can use the wi-fi wherever and whenever we choose to.To apply the fix, follow the steps below or the following link
Step 1 – Check that wi-fi power management is turned on
In order to turn off the power management we first need to ensure that it is turned on.
*Open a terminal window by pressing Ctrl+Alt+t
*Now type: iwconfig and press Enter
‘iwconfig’ will then list all the available wireless devices connected to your system.
Step 2 – Turning Power Management off
*Type: sudo iwconfig wlan0 power off – This disables the wi-fi power management
Step 3 - will show us how to make this fix permanent by firstly moving to another directory and then editing or creating (if it doesn’t exist already) the file /etc/pm/power.d/wireless
Step 3 – Making the fix permanent – Moving to /etc/pm/power.d directory
We must now move to the directory/etc/pm/power.d we do this by typing the command below into the terminal (see image below)- Note, if the directory does not exist you must create it by typing: mkdir /etc/pm/power.d
*Type: cd /etc/pm/power.d and press Enter
Above: Moving to the /etc/pm/power.d directory
Step 4 – Creating the wireless file in the /etc/pm/power.d directory
Once we are in /etc/pm/power.d we must create the wireless file.
*Type: sudo pico /etc/pm/power.d/wireless into the terminal command and press enter, this will create the wireless file and open the file for editing as a root user.
Step 5 – Add a couple of lines of code to the wireless file, save and exit and its all done !
Now that you are in /etc/pm/power.d/wireless we add two lines of code which tell Ubuntu to stop managing the power management of our wireless device, thus keeping the wi-fi power management permanently turned off (even if we shut down or restart the system)
*Type: #!/bin/sh
/sbin/iwconfig wlan0 power off
Above: Add two lines of code to the file: /etc/pm/power.d/wireless
Now save and exit – note if you can’t find a save button just close the terminal window and restart your laptop/notebook. The changes will take effect. Also note that when you reboot, do it on battery power, reopen the terminal and type iwconfig’ and check that the power management for your wlan0 device reads: OFF.