Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 2461

General discussion • documentation for Raspberry OTG

$
0
0
hello
Lately I've been struggling a lot with how to set up the raspberry Pi 4 B so that it behaves like a keyboard. I managed to do that thanks to this code.

Code:

#!/bin/bashcd /sys/kernel/config/usb_gadget/mkdir -p usbcd usbecho 0x1d6b > idVendor # Linux Foundationecho 0x0104 > idProduct # Multifunction Composite Gadgetecho 0x0100 > bcdDevice # v1.0.0echo 0x0200 > bcdUSB # USB2mkdir -p strings/0x409echo "0123456789" > strings/0x409/serialnumberecho "Manufacturer" > strings/0x409/manufacturerecho "USB device" > strings/0x409/productmkdir -p configs/c.1/strings/0x409echo "Config 1: ECM network" > configs/c.1/strings/0x409/configurationecho 250 > configs/c.1/MaxPowermkdir -p functions/hid.usb0echo 1 > functions/hid.usb0/protocolecho 1 > functions/hid.usb0/subclassecho 8 > functions/hid.usb0/report_lengthecho -ne \\x05\\x01\\x09\\x06\\xa1\\x01\\x05\\x07\\x19\\xe0\\x29\\xe7\\x15\\x00\\x25\\x01\\x75\\x01\\x95\\x08\\x81\\x02\\x95\\x01\\x75\\x08\\x81\\x03\\x95\\x05\\x75\\x01\\x05\\x08\\x19\\x01\\x29\\x05\\x91\\x02\\x95\\x01\\x75\\x03\\x91\\x03\\x95\\x06\\x75\\x08\\x15\\x00\\x25\\x65\\x05\\x07\\x19\\x00\\x29\\x65\\x81\\x00\\xc0 > functions/hid.usb0/report_descln -s functions/hid.usb0 configs/c.1/ls /sys/class/udc > UDC
But I found this code here on the forum and I couldn't find any official documentation on how to achieve what I was trying to do. I would be very interested in how someone even created such a code when there is no official procedure anywhere. If anyone knows, I would appreciate it

Statistics: Posted by Kubiiisek — Thu Feb 20, 2025 10:30 am



Viewing all articles
Browse latest Browse all 2461

Trending Articles