Info Stopping a USB device from waking the computer (running Linux)

mikeymikec

Lifer
May 19, 2011
21,402
16,609
136
I didn't have this problem with my previous Logitech MX Revolution mouse (cordless, USB receiver), but I have with my replacement Logitech MX Master 3S (also cordless, USB receiver).

I'm sharing this information because this is the easiest way I'm aware of to disable the mouse from waking the computer (or more specifically in my case, the computer would immediately wake up after entering sleep mode because of the communication system for the mouse).

If you have this problem, you can expect it to reoccur should you change the USB connection to another port, or for example if you do a BIOS update.

Step 1: Get up a terminal window

Step 1: Unplug the receiver

Step 2: In the terminal window, run:

Code:
tail /var/log/syslog

Example output:

Code:
Jan  8 08:58:53 mikepc kernel: [ 4739.372858] usb 7-1.3: USB disconnect, device number 5

Step 3: In the terminal, type (and modify depending on the USB location numbers):

Code:
sudo nano  /sys/bus/usb/devices/7-1.3/power/wakeup

Step 4: Change ‘disabled’ to ‘enabled’ (I got an error in nano about being unable to modify another file, I ignored it)

No need to restart anything, test away.

Tested on Linux Mint 21.1, kernel 6.8.x.

I imagine with this technique that if you have a cordless keyboard & mouse combo controlled by the same receiver then both devices will be stopped from waking the computer. There are further techniques to further narrow down which capability you're stopping from waking the computer (because the receiver for my current mouse shows up as having other capabilities like supposedly having a keyboard attached to it), but I prefer to keep things simple at least for me!
 
Last edited: