Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I frequently leave my laptop idle and close the lid when i do so. Problem is that the wireless turns off if i do so and my downloads can't happen.

Is there anyway to prevent that from happening? I am using 10.04.

P.S. I have already disabled suspend from happening on default

share|improve this question
    
Answer given on this post helped me askubuntu.com/questions/65632/… – vaibhav jain May 4 at 7:02

Not only the wireless goes off, but the whole machine goes to sleep mode - disk spins down, CPU stops - the energy is only spent on keeping RAM alive. So, as you understand, in sleep mode downloads can't happen anyway.

The way to fix it is to adjust power settings to not to send the computer to sleep when the lid is closed. This, obviously, would result in power consumption similar to that when the lid is open.

UPDATE: If you already disabled suspend on lid close and the wireless still turns off, it suggests there may be some bug/glitch/misconfiguration in some versions of Ubuntu. I searched Ubuntu bug database but couldn't find anything similar - however, as this forum thread shows, there are other users who experienced similar problems.

So, if you really love to code as your avatar suggests, you may start from investigating /etc/acpi/lid.sh script, which, as I understand, is invoked when the lid is closed, and go from there - hopefully you will be able to find the cause of the problem, fix the issue for yourself and then report the bug+solution to the Ubuntu bugtracker.

share|improve this answer
    
i have already set my power settings so that when the lid closes only the display goes blank, yet still the wireless turns off – prometheuspk Feb 2 '12 at 6:33
1  
This is old, nevertheless: On my Thinkpad E531 and Ubuntu 14.04 LTS I don't have a file /etc/acpi/lid.sh. Do you happen to know where else I could find, or if I can just create it? Thanks! – AlexAffe Jan 7 '15 at 14:13

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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.