To hibernate my Debian Wheezy system, I run the following command:

sudo sh -c 'echo disk > /sys/power/state'

To wake up the system, I can press any key on my USB keyboard. My understanding of hibernation/suspend to disk is that the machine state is saved into swap space, and the machine is completely powered off.

Is it possible to enable "Wake on USB" without hibernating the system? So I can power on the system, by pressing a key on the keyboard, after a normal shutdown?

So far I have located the USB port the keyboard is connected to, and tried the following command:

sudo sh -c 'echo enabled > /sys/bus/usb/devices/2-4/power/wakeup'

But after shutting the system down, I cannot turn it on again by pressing a key on the keyboard. The fact that the power is completely cut off when hibernating the system, makes me believe that it could also be possible to wake the system by USB from normal shutdown. But I have not found any solution yet.

  • 3
    This is typically dependent on BIOS settings that the operating system may not be able to affect. What exact model of computer/motherboard do you have? Have you explored the BIOS settings? – Gilles Nov 30 '13 at 18:00
  • There are no settings in the BIOS regarding USB wake, only wake on LAN.When hibernating the system, USB wake works fine, and in this case the system is completely powered down, so it should be possible to configure it from the OS. – user53477 Nov 30 '13 at 18:05
  • @Gilles : If the OS can tell the BIOS to wake from hiberation on a HID event into a normal boot -- which is what it does, restoring state is then done optionally by the OS -- then it that should be possible regardless of whether or not an image was saved; the BIOS can't know or care about that. So there must be a way to do this, although it might require a kernel hack... – goldilocks Nov 30 '13 at 19:36

This depends on what level of ACPI wakeup is supported in your BIOS and motherboard. For more detail, please see ACPI global states; but in short, it will come down to your BIOS supporting wake from various states:

  • S3: Suspend to RAM
  • S4: Hiberate
  • G2/S5: Soft off

Additionally, on some motherboards, only a subset of USB ports might support wake-on-USB. I suggest checking the documentation for your manualboard.

Goldilocks did suggest in comments that a kernel hack might help, and he was close, but you don't actually need to modify the kernel. Instead, you would modify your poweroff scripts, such that at the last phase of poweroff, you write 4 or disk to /sys/power/state. I'm not sure that approach will actually help, unless your system only implements USB-wake-from-S4 and not USB-wake-from-S5, which is unlikely (they are practically identical in system design).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.