2

I am running Ubuntu 16.04 and when the lid of my laptop is closed the wifi disconnects and needs to be turned on manually when the lid is opened.

I have tried the following till now, without any success:

sudo -H gedit /etc/systemd/logind.conf, Add a line HandleLidSwitch=ignore

IgnoreLid=true in /etc/UPower/UPower.conf

My settings in the power-manager are set to 'Do Nothing'. Can you please help in identifying the issue?

  • When your laptop is suspended pretty much everything is turned off. What you really want is WiFi to be turned back on automatically on resume. Try searching that in ask Ubuntu. – WinEunuuchs2Unix Sep 27 '16 at 14:49
  • @WinEunuuchs2Unix OP's wifi is disconnecting in spite of the fact that he disabled suspend. – negusp Sep 27 '16 at 15:08
  • 1
    @patrickyi So right you are. I tend to miss things on the smartphone screen. Even though it's 1920x1080 it's still small. Thanks for pointing it out. – WinEunuuchs2Unix Sep 28 '16 at 1:41
  • @WinEunuuchs2Unix yup, lol – negusp Sep 28 '16 at 1:44
  • Any help guys... – user2849789 Oct 1 '16 at 12:00
1

At first I didn't understand your question but then surmised if you are closing your lid and want WiFi to stay on that must mean you have your Laptop docked or have an HDMI monitor attached and the system is suspending the Wifi.

You already edited logind.conf once and need to again. Set the line:

HandleLidSwitchDocked=ignore

Then save the file and reboot. Hopefully this solves the problem. If so mark this as solution by clicking check mark, if not post a comment.

  • Sorry but my laptop is neither docked, nor I am using a docking station. I want to close the lid and switch the screen off but still stay connected with the wifi network. Even then I tried this solution and somehow this too doesnt work, – user2849789 Sep 28 '16 at 13:01
  • The screen will switch off regardless of whether sleep is enabled. There is a magnetic sensor within the frame of the screen. You can't keep the wifi on and also use suspend. Is your computer suspending when you close the lid? The wifi shouldn't disconnect if its not suspending. – negusp Sep 28 '16 at 14:41
  • Nope my computer doesn't suspend as I can play the songs when the lid is closed, but somehow the wifi is switched off and it doesnt even start automatically when I open the lid again – user2849789 Sep 29 '16 at 12:37
0

I had the same issue. What was happening was when I closed my laptop's lid, it went into a suspended state thereby shutting off my wifi (along with some other side effects).
What you can do is change the following:

  1. Go to the System Settings and select Power setting
  2. Change the When the lid is closed option to Do Nothing

That's it. Your wifi won't automatically disconnect now.

PS.
Additionally, you might still want a bit security after you reopen your laptop lid, so make sure you have the Lock turned On for Lock screen after with setting Screen turns off.

0

I had a similar issue with an HP 250 G5. Power manager was also configured to do nothing (except turning off the display). Funny thing was that when I closed the lid, wifi continued to operate. However, as soon as I opened the lid, wifi was switched off.

I solved this by an acpi triggered script (see e.g. https://forums.fedoraforum.org/showthread.php?291877-Run-a-script-when-laptop-lid-opens-closes and don't forget to make the script executable) which runs "rfkill unblock wifi" whenever I open the lid. I guess you could do the same (maybe at closing the lid or for both events). It is not super clean, as it also activates wifi on such events even when it was turned off before, but it solved my problem.

Peace out.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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