4

I have an Arduino Pro Micro mimicking as a HID, connected to a PC.

The PC BIOS is configured to wake from keyboard events - it is switched on by hitting a key on the regular keyboard. This is a wanted feature and should stay.

Unfortunately, it also wakes when the Arduino sends HID events, which is understandable and pretty obvious, but to be avoided.

Is there something in the USB protocoll, or even in the Arduino HID libraries, that lets me tell the chip to either not wake up the host (unlikely, I guess); or so that I can detect when the PC has shut down, so I can tell the Arduino to go sleeping as well until the PC wakes up again?

EDIT: I am using the "HID-project" USB library (HID 2.4.3) from https://github.com/NicoHood/HID.

15
  • You should be able to detect if the host is sleeping. Which USB library are you using?
    – Gerben
    Jun 7, 2017 at 20:41
  • @Gerben, I use the library at github.com/NicoHood/HID .
    – AnoE
    Jun 7, 2017 at 20:49
  • you can simply disable the "wake on keyboard" feature of your pc, if that helps
    – dandavis
    Jun 8, 2017 at 6:27
  • No, @dandavis, I would like just this one device to "behave".
    – AnoE
    Jun 8, 2017 at 6:50
  • maybe there is a key or two that doesn't wake up the pc. i always used pause to wake, but one laptop i had ignored that and a few other keys. it might also be possible to interrogate the locks without toggling, which hopefully wouldn't wake the PC. i think it's possible because i thought i've plugged in a keyboard to a sleeping PC, had the caps lock light come on, but still had to press space to actually wake up the PC... Also, i wonder if those lock interrogations would time out were the PC sleeping; a way to detect sleep.
    – dandavis
    Jun 8, 2017 at 6:57

2 Answers 2

2

Assuming you are using windows, on the device manager you can access each device's properties (power management tab), where you can allow or not each device to wake your system up.

1

Check your BIOS for an option to wake up on a particular key combination, rather than "any key".

Another option is to configure a particular USB port to be powered down when the computer is asleep (or discover which ports are powered down if no such option is available). If that doesn't help, you can try to put a USB hub between the Arduino and the PC: many hubs don't cope with sleep modes very well, so there's a chance they won't re-transmit anything your Arduino is sending unless the PC wakes up. If your computer has USB3, you can try a USB3 hub, which has an even higher chance of exhibiting this behavior since BIOS often lacks USB3 hub support.

1
  • Any bios have this particular key option?
    – user30878
    Feb 16, 2018 at 22:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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