pi-as-keyboard icon indicating copy to clipboard operation
pi-as-keyboard copied to clipboard

Can I use this for System Sleep, Wakeup?

Open baseman2 opened this issue 5 years ago • 2 comments

How can I test for echo command "system sleep" and "system wake up"?

1 Generic Desktop 0x82 System Sleep 0x83 System Wake Up

Please help me.

baseman2 avatar Nov 02 '19 07:11 baseman2

Hi,

Sorry for the delay. You had to create a script like :

#!/bin/bash
echo -ne "\x00\x00\x82\x00\x00\x00\x00\x00" > /dev/hidg0
echo -ne "\x00\x00\x00\x00\x00\x00\x00\x00"  > /dev/hidg0

I don't have my pi with me right now. But I guess you got the idea. Let me know if you want me to test.

PS : Run as root

c4software avatar Nov 05 '19 14:11 c4software

Thanks for your reply. I think that it's not doing exactly. Because your hid descriptor set as keyboard(Usage 7 : Keyboard). at the usage keyboard, code 82 means "Keyboard Locking Caps Lock"

System Sleep and wake up is at the Usage 80 : System Control. So I try to make a new hid descriptor and try to send byte. But it's not easy to me.

Reference : https://www.freebsddiary.org/APC/usb_hid_usages.php

baseman2 avatar Nov 05 '19 15:11 baseman2