I’ll start this one off with a funny story. Whenever I spark something in the room (like, my hand on a doorknob), my linux box wakes up from sleep. I tracked the problem down to the wireless receiver for the Logitech M570 wireless mouse on my desk – the electrostatic discharge from the spark causes the USB receiver to send some signal to the computer.
The problem is, that every time this happens (4+ times per day), it wakes up my machine. I then have to wait for everything to wake up, enter my password to unlock it, then put it back to sleep. Not fun. So I determined what I needed to do was prevent the USB ports from waking up the machine (or replace my beloved mouse). I chose the former, but for the longest time, could not figure out how the hell to do it. I finally figured it out, and to save anyone else from my misery, here’s the short version.
Just add the following to
echo "EHC1" > /proc/acpi/wakeup
echo "EHC2" > /proc/acpi/wakeup
(add more if you have more than two USB2.0 host controllers)
If you have something plugged into a USB3.0 port, then add:
echo "XHC" > /proc/acpi/wakeup
Now, when the computer boots, it disables waking up for USB events. It seems a little counterintuitive, but the above lines actually toggle the wakeup states in