Cannot Wake UP Linux From USB Keyboard/Mouse Mar 7th 2021 Words: 343

Problem

After my linux laptop entering sleep mode, I failed to wake it up by using the external USB keyboard or mouse. It is extremely annoying because I mainly put my laptop underthe desk.

Solution

Check the device’s ability to wake the computer from sleep:

1
grep . /sys/bus/usb/devices/*/power/wakeup
1
2
3
4
5
6
/sys/bus/usb/devices/1-2.1/power/wakeup:disabled
/sys/bus/usb/devices/1-2.4/power/wakeup:enabled
/sys/bus/usb/devices/1-2/power/wakeup:disabled
/sys/bus/usb/devices/1-7/power/wakeup:disabled
/sys/bus/usb/devices/usb1/power/wakeup:disabled
/sys/bus/usb/devices/usb2/power/wakeup:disabled

List the USB devices connected to the host

1
lsusb
1
2
3
4
5
6
7
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 003: ID 0bda:b00b Realtek Semiconductor Corp. Realtek Bluetooth 4.2 Adapter
Bus 001 Device 002: ID 0bda:58eb Realtek Semiconductor Corp. HP Wide Vision HD Camera
Bus 001 Device 006: ID 24ae:4018 Shenzhen Rapoo Technology Co., Ltd. Rapoo Gaming Keyboard
Bus 001 Device 005: ID 1017:900a Speedy Industrial Supplies, Pte., Ltd USB Gaming Mouse
Bus 001 Device 004: ID 05e3:0608 Genesys Logic, Inc. Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

Add rules to allow wakeup by specific device. Edit /etc/uden/rules.d/10-wakeup.rules

1
ACTION=="add", SUBSYSTEM=="usb", ATTRS{idVendor}=="1017", ATTRS{idProduct}=="900a" RUN+="/bin/sh -c 'echo enabled > /sys/$env{DEVPATH}/power/wakeup'"

Reload the rules

1
sudo udevadm control --reload-rules

Reference

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