You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Press Ctrl + Raspberry to grab/release your keyboard and mouse, switching between local use and USB.
Press Ctrl + Shift + Raspberry (on the grabbed keyboard) to exit.
However, Ctrl + Raspberry doesn't seem to grab/release the keyboard (Ctrl + Shift + Raspberry works fine, though).
I'll document my debugging journey to get the main branch working after compiling and installing (may help #39):
added libcomposite to /etc/modules (echo 'libcomposite' | sudo tee -a /etc/modules, as commented on readme: Autorun example #19 ), and rebooted
HOOK_PATH is hard-coded to /home/pi/pi400kb/hook.sh on pi400.h and on CMakeLists.txt; updated and re-compiled.
LED path may be outdated for Bullseye (replaced /sys/class/leds/led0/trigger and /sys/class/leds/led0/brightness to /sys/class/leds/PWR/trigger and /sys/class/leds/PWR/brightness, respectively, in hook.sh).
Manually inspected the Keyboard and Mouse variables passed to CMake and manually passed them when building: cmake .. -DMOUSE_DEV="/dev/input/by-id/usb-PixArt_USB_Optical_Mouse-event-mouse" -DMOUSE_VID=0x093a -DMOUSE_PID=0x2510 -DKEYBOARD_DEV="/dev/input/by-id/usb-_Raspberry_Pi_Internal_Keyboard-event-kbd" -DKEYBOARD_VID=0x04d9 -DKEYBOARD_PID=0x0007
I have tried:
creating a shortcut to manually restart the service (doesn't work?) in /etc/xdg/openbox/lxde-pi-rc.xml (though I'm not sure if C-W is the right combination for Ctrl + Raspberry).
Manually inspected the pi400kb.service logs (journalctl -f -u pi400kb.service), and found the following error message:
Jun 12 14:33:53 pi systemd[1]: Started pi400kb USB OTG Keyboard & Mouse forwarding.
Jun 12 14:33:53 pi pi400kb[2515]: usbg_create_gadget() duplicate gadget name
Jun 12 14:33:53 pi pi400kb[2515]:
Jun 12 14:33:53 pi pi400kb[2515]: Error creating gadget
Jun 12 14:33:53 pi pi400kb[2515]: Error: USBG_ERROR_EXIST : Already exist
Jun 12 14:33:54 pi pi400kb[2515]: Found keyboard at: /dev/hidraw1
Jun 12 14:33:54 pi pi400kb[2515]: Found mouse at: /dev/hidraw0
Jun 12 14:33:54 pi pi400kb[2515]: Grabbing Keyboard and/or Mouse
Jun 12 14:33:54 pi pi400kb[2515]: Grabbing: /dev/input/by-id/usb-_Raspberry_Pi_Internal_Keyboard-event-kbd
Jun 12 14:33:54 pi pi400kb[2515]: Grabbing: /dev/input/by-id/usb-PixArt_USB_Optical_Mouse-event-mouse
Jun 12 14:33:54 pi pi400kb[2515]: Running...
Jun 12 14:33:54 pi pi400kb[2515]: K:1 0 0 0 0 0 0 0
Jun 12 14:33:54 pi pi400kb[2515]: K:9 0 0 0 0 0 0 0
Jun 12 14:33:54 pi pi400kb[2515]: Releasing Keyboard and/or Mouse
Jun 12 14:33:54 pi pi400kb[2515]: K:b 0 0 0 0 0 0 0
Jun 12 14:33:54 pi pi400kb[2515]: Releasing Keyboard and/or Mouse
Jun 12 14:33:54 pi pi400kb[2515]: Cleanup USB
Jun 12 14:33:54 pi systemd[1]: pi400kb.service: Succeeded.
I'm not knowledgeable in C, so that's the limit to my ability to debug (and I'm unsure if the problem may be on pi400kb's gadget-hid.c:
According to the ReadMe:
However,
Ctrl + Raspberry
doesn't seem to grab/release the keyboard (Ctrl + Shift + Raspberry
works fine, though).I'll document my debugging journey to get the
main
branch working after compiling and installing (may help #39):libcomposite
to/etc/modules
(echo 'libcomposite' | sudo tee -a /etc/modules
, as commented on readme: Autorun example #19 ), and rebootedHOOK_PATH
is hard-coded to/home/pi/pi400kb/hook.sh
onpi400.h
and onCMakeLists.txt
; updated and re-compiled./sys/class/leds/led0/trigger
and/sys/class/leds/led0/brightness
to/sys/class/leds/PWR/trigger
and/sys/class/leds/PWR/brightness
, respectively, inhook.sh
).cmake .. -DMOUSE_DEV="/dev/input/by-id/usb-PixArt_USB_Optical_Mouse-event-mouse" -DMOUSE_VID=0x093a -DMOUSE_PID=0x2510 -DKEYBOARD_DEV="/dev/input/by-id/usb-_Raspberry_Pi_Internal_Keyboard-event-kbd" -DKEYBOARD_VID=0x04d9 -DKEYBOARD_PID=0x0007
I have tried:
/etc/xdg/openbox/lxde-pi-rc.xml
(though I'm not sure ifC-W
is the right combination forCtrl + Raspberry
).pi400kb.service
logs (journalctl -f -u pi400kb.service
), and found the following error message:I'm not knowledgeable in C, so that's the limit to my ability to debug (and I'm unsure if the problem may be on pi400kb's gadget-hid.c:
pi400kb/gadget-hid.c
Line 120 in ad102c2
... or the
usbg_create_gadget
function from libusbgx:https://github.com/linux-usb-gadgets/libusbgx/blob/721e3a1cbd7e2b6361bb439d3959e7403e4f0092/src/usbg.c#L1531
I'd like to help in getting it to work... so, please let me know what I can do to continue debugging.
The text was updated successfully, but these errors were encountered: