I have been banging my head against a wall for a couple days on this…I have read through several forums…etc. and nothing has worked. My machine is a Dell Optiplex 330 which originally ran Windows 10 and the wake from USB keyboard/mouse worked fine. Now, I can't seem to get my computer to wakeup from suspend with my keyboard and/or mouse no matter what I do. Any thoughts?
Ubuntu – How to wake from suspend with USB keyboard (16.04 LTS)
16.04suspendudevusbwakeup
Related Solutions
I had the same problem and was also stumped by my USBs not appearing in /proc/acpi/wakeup. In the end, however, despite many solutions suggesting this was required I did not need to enable USBs in ACPI.
Instead, enabling wakeup on the USB port my IR device was connected to was was enough.
Find your device ID:
$ lsusb
Bus 002 Device 002: ID 8087:8001 Intel Corp.
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 002: ID 8087:8009 Intel Corp.
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 003 Device 003: ID 13ba:0018 PCPlay Barcode PCP-BCG4209
Bus 003 Device 002: ID 1934:5168 Feature Integration Technology Inc. (Fintek) F71610A or F71612A Consumer Infrared Receiver/Transceiver
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
In the above example my device ID is 5168.
Grep /sys/bus/usb to find the port your device is plugged into:
$ grep 5168 /sys/bus/usb/devices/*/idProduct
/sys/bus/usb/devices/3-13/idProduct:5168
This indicates my device is plugged into bus3, port 13.
Confirm the port is correct:
$lsusb -t
/: Bus 04.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/6p, 5000M
/: Bus 03.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/14p, 480M
|__ Port 13: Dev 2, If 0, Class=Vendor Specific Class, Driver=mceusb, 12M
|__ Port 14: Dev 3, If 0, Class=Human Interface Device, Driver=usbhid, 1.5M
|__ Port 14: Dev 3, If 1, Class=Human Interface Device, Driver=usbhid, 1.5M
/: Bus 02.Port 1: Dev 1, Class=root_hub, Driver=ehci-pci/2p, 480M |__ Port 1: Dev 2, If 0, Class=Hub, Driver=hub/8p, 480M
/: Bus 01.Port 1: Dev 1, Class=root_hub, Driver=ehci-pci/2p, 480M
|__ Port 1: Dev 2, If 0, Class=Hub, Driver=hub/6p, 480M
Bus 3, port 13 matches the bus/port returned by grep (3-13)
Check if wakeup is enabled:
$ cat /sys/bus/usb/devices/3-13/power/wakeup
disabled
Enable wakeup on port:
$ sudo sh -c 'echo "enabled" > /sys/bus/usb/devices/3-13/power/wakeup'
Check if wakeup enabled:
$ cat /sys/bus/usb/devices/3-13/power/wakeup
enabled
Test your device, does it wake the system?
Make this change persistent across reboots:
$ sudo nano /etc/rc.local
Add the following lines after the comments and before 'exit 0'
# Enable Wake on IR for USB bus 3 port 13.
echo enabled > /sys/bus/usb/devices/3-13/power/wakeup
Now happily wake your PC from your USB device.
Limitations
One problem with this approach is that if the USB port the IR device is plugged into changes, then enabling that port specifically does not help.
This post has a way of enabling any IR port based on the device that is plugged into it using a Udev rule.
References
Kodi, MCE Remote and Ubuntu
Wake from suspend with keyboard or mouse
Enabling IR devices with a Udev rule
Here is what worked: Completely powering off my laptop, then turning it back on. Note: don't just reboot... fully power down.
The only side effect is that Wifi stops working (as in the wireless interface is not recognized at all). A simple sudo systemctl restart NetworkManager
solves that... and if you don't want to have to do that after ever suspend you could make a script this script:
/lib/systemd/system-sleep/99restartnm
That contains:
#!/bin/sh case "$1" in post) systemctl restart NetworkManager ;; esac
and make it executable:
sudo chmod +755 /lib/systemd/system-sleep/99restartnm
(I know that answer was in the comments of the question but its kinda easy to miss... thanks @BeeOnRope, I really did just about try anything else out except for fully powering down... facepalm)
Best Answer
Below is a pure udev way of doing what is suggested https://askubuntu.com/a/848699/1048516.