Ubuntu – Wake up from suspend using wireless USB keyboard or mouse (for any Linux Distro)

suspendusbwakeupwireless

I was looking for hours, maybe more, for a solution and i just found it. I want to share it with everyone. This way it will be easier googling this problem to find the solution faster. So, just like the title says, below is the solution.

Best Answer

hit in terminal:

grep . /sys/bus/usb/devices/*/power/wakeup

The result, for me, was to find out that all usb were disabled. So now, type:

1.

sudo su

we have now root privillages.

2.I have 8 usb ports (you do that for as many usb ports you have) ,so:

echo enabled > /sys/bus/usb/devices/usb1/power/wakeup
echo enabled > /sys/bus/usb/devices/usb2/power/wakeup
echo enabled > /sys/bus/usb/devices/usb3/power/wakeup
echo enabled > /sys/bus/usb/devices/usb4/power/wakeup
echo enabled > /sys/bus/usb/devices/usb5/power/wakeup
echo enabled > /sys/bus/usb/devices/usb6/power/wakeup
echo enabled > /sys/bus/usb/devices/usb7/power/wakeup
echo enabled > /sys/bus/usb/devices/usb8/power/wakeup

Go ahead and test it. Now you can wake up from any wireless or wired usb keyboard and mouse.

So then, the reason we must enable all of them, is because in the next step, we will write this in rc.local to execute the command after every reboot, and after reboot some linux distros (maybe all) change the usb ports. We don't have to worry for anything going wrong by enabling all of them, since linux is in suspend or hibernation, it can't use the wifi to download anything, so it won't wake up without we wake it up on purpose.

Next step:

3.

sudo nano /etc/rc.local

and we paste everything from step 2. in there (before the exit 0 of course).

That's it. From now on we can use our wireless usb and mouse to wake up from suspend.

I hope it works for all of you. This guide was made after testing all other possible solutions around the internet.

Related Question