Mach das PiZero zu einem KEyboard via USB ;)

---

erstmal zugriff schaffen über usb: https://raspberrypi.stackexchange.com/questions/66431/headless-pi-zero-ssh-access-over-usb
Dann zum eigentlichen Anliegen:
https://randomnerdtutorials.com/raspberry-pi-zero-usb-keyboard-hid/
und hier wie es mit der config funktioniert!: https://forums.raspberrypi.com/viewtopic.php?t=151940
und hier weitere tips und tricks:
https://www.isticktoit.net/?p=1383
aha und der trick das es schlussendlich mit dem neuen kernel das hid /dev/hidg0 anlegt löste ich indem ich in der
/boot/cmdline.txt g_ether in modules_load heraus nahm, sodass nur noch modules-load=dwc2 drinnestand 😉
liste der tastatureingaben: https://github.com/raspberrypisig/pizero-usb-hid-keyboard/blob/master/hid-gadget-test.c
CTRL+ALT+DEL ist also: echo -ne “\x41\0\x4c\0\0\0\0\0” > /dev/hidg0;
andere:
CTRL: echo -ne “\x01\0\0\0\0\0\0\0” > /dev/hidg0
ALT: echo -ne “\x4\0\0\0\0\0\0\0” > /dev/hidg0
DEL: echo -ne “\0\0\x4c\0\0\0\0\0” > /dev/hidg0
hier die ganze liste: https://github.com/raspberrypisig/pizero-usb-hid-keyboard/blob/master/hid-gadget-test.c
Clear all keys: echo -ne “\0\0\0\0\0\0\0\0″ > /dev/hidg0
aus:
in python wiederum: write_report(str(b”\x41″)+NULL_CHAR+str(b”\x4c”)+NULL_CHAR*5)
^^funktioniert allerdings noch nicht…
ich probiere es einfach mal mit bash etc 😉

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>