Using Ubuntu as a workstation

Enabling system wake-up from USB device

Run the following to get a list of your USB devices:

lsusb

The output should look like:

# ... more ...
Bus 004 Device 003: ID 05e3:0626 Genesys Logic, Inc. USB3.1 Hub
Bus 001 Device 002: ID 1d6b:0003 Linux Foundation 3.0 root hub
# ... more ...

In the above output, the hex numbers represent the vendor ID followed by the product ID, eg. 05e3 is the vendor ID (idVendor) for Genesys Logic and 0626 is the product ID (idProduct).

The files that store configurations for the above can be found at /sys/bus/usb/devices. To identify which directory in there contains the desired USB device (you will need to run these as root):

cd /sys/bus/usb/devices;
ls -1 \
  | grep -v '\:' \
  | xargs -I@ sh -c 'printf -- "@ == " && printf -- "$(cat @/idVendor):" && printf -- "$(cat @/idProduct)\n"'

The output should look like (intentionally matched with the lsusb output):

# ... more ...
4-1 == 05e3:0626
usb4 == 1d6b:0003
# ... more ...

Match the above output from lsusb with the most recent output and note the left value (eg. 4-1 refers to the Genesys Logic device)

Run the following to enable wake-up from the USB device:

echo enabled > /sys/bus/usb/devices/4-1/power/wakeup;

To enable persistence, put the above script in your /etc/rc.local as well.

Last updated