6

I've tried quite a few approaches to this but haven't been able to get a working solution.

On my laptop I noticed that the wifi 'sleeps' under screen lock which makes it impossible to leave it doing things that require an internet connection. For example: if a backup upload operation is running I would want to lock the laptop and leave it doing the upload.

I didn't see this issue with 15.10 so I'm guessing there's something either in device management or OS which I haven't figured out yet.

After spending a lot of time trying three different ways of turning off power management on the wireless interface I realised even that wasn't preventing the sleep.

For example:

sudo iwconfig wlp2s0 power off

Turns off the power management on the device until reboot but doesn't seem to affect the wireless-sleep-during-screen-lock feature. I've tried something similar with /etc/pm/config.d/wireless containing a script to do the same command as above but no dice.

Hibernate, sleep and suspend are all turned off and the laptop is a Surface Pro 4 i7.

I'm probably just missing something simple but can't figure it out. Any ideas?

Update 21-06-2016

This morning I've noticed that when a second monitor is plugged in it is ignored on wake / return-from-lock-screen. By unplugging and plugging monitor connection back in all returns to normal.

I think that perhaps somehow the two issues are linked.

Update 10-8-2016 Didn't get anywhere with the links I found in my comment below but found this clue in syslog:

NetworkManager[21369]: <info>  [1470826457.2514] manager: wake requested (sleeping: yes  enabled: yes)

I left my desk for 10 mins and when I returned I thought the wifi had stayed up. But no - it looks like it had resumed by the time I'd logged back in - perhaps the question here should really be

How do you turn off sleep and wake capability in Ubuntu 16.04.1?

As the standard UI (inc. Gnome tweak) tools & settings don't appear to achieve the right result, turning acpi=off has other consequences; what other safe methods are there?

Steve
  • 91
  • 1
  • 2
  • 9
  • There seem to be problems with wireless in 16.04. A lot of people are complaining. When you come back to your machine, can you reconnect to the internet? if not, see if this works to restart your wireless: `sudo systemctl restart network-manager.service`. Even if so, that won't solve your overall problem, but that's helping some people. (I'm running 16.04, but on a wired connection, so I can't test it now.) – Diagon Jun 20 '16 at 15:46
  • Hi @Diagon - thanks for that, good to know I'm not going nuts on my own :) It seems to reconnect without issue once woken up and it's only when I've tried to turn power management off via `/etc/network/interfaces` that I need to restart networking & network-manager. Will update the symptoms in a moment as I've also noticed a similar effect with the multi-display on wake-up – Steve Jun 21 '16 at 08:10
  • Looks like this is related to [link](http://askubuntu.com/questions/779220/xubuntu-16-04-second-monitor-disabled-after-display-sleep "AskUbuntu: 2nd Monitor Disable After Sleep") but am going to try the solution outlined in the answer to this [link](http://askubuntu.com/questions/768304/preventing-my-machine-from-sleeping "AskUbuntu: Prevent sleep") – Steve Jul 06 '16 at 08:02

1 Answers1

3

Fixed it. Tested by locking and leaving laptop running whilst running a DR / backup - not only did the laptop immediately respond to keyboard unlock but the upload completed in the background.

I had to use the dconf editor after finding some more details on how to disable suspend options - I'm guessing this is only needed for the laptop (Surface Pro 4 i7) due to driver support issues as my desktop does not have this problem. Laptop has this issue even with ethernet connected via docking port so this isn't WiFi specific, it's Ubuntu suspend specific.

The solution is to disable suspend and hibernate altogether, which may seem a bit extreme but I don't have any scenarios where I want the laptop to hibernate under linux. I dual boot with W10 (can't be helped unfortunately) and that deals with the suspend capability very well.

Clues found here and here - they didn't exactly match the resolution but I used them to test out the settings changes.

I changed the settings in org.gnome.settings-daemon.plugins.power a few times but the active=false clinched it in the end.

Also tried setting sleep-inactive-ac-timeout and sleep-inactive-battery-timeout to 0 (i.e. never) but that didn't seem to effect it.

Had a terminal running with

sudo tail -f /var/log/syslog | grip networkmanager

(grip is an alias of grep -i) and once I'd changed active=false the terminal went quiet all the way through to unlock.

N.B. As I'm using Ubuntu Gnome these settings may not directly match with other DM configurations.

Steve
  • 91
  • 1
  • 2
  • 9