Ubuntu – USB IR remote wakup from Suspend

14.04suspendusbxbmc

I am running 14.04 XBMCbuntu and am a new user. I have got xbmc installed the way I want it and have an MCE remote setup.

I have got suspend working but the wake is only via the keyboard not IR Remote or mouse.

I have read up on a range of forums to find the answer and tried a number of things.

When I run cat /proc/acpi/wakeup

I get a list of items but no USB01 or USB02 files….. in spite of this I have tried

echo USB0 > /proc/acpi/wakeup

echo USB1 > /proc/acpi/wakeup

echo USB2 > /proc/acpi/wakeup

echo USB3 > /proc/acpi/wakeup

When I run lsusb

The device is there @ Bus02 Device 08: 0471:o60c Philips (or NXP) eHome Infrared Receiver

I have tried to edit the /sys/bus/usb/devices/usb2 power files to "enabled" however get error messages about failing to save a backup and thus can't write the file!

Any support would be appreciated on the following fronts:

  1. getting the ir receiver to Wake
  2. edit the sys files noted above
  3. I can't copy from xterm into the browser. I can copy from browser to xterm using Shift Insert, and can copy from one xterm to another xterm screen using control shift c and Shift Insert….

Best Answer

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

Related Question