Hey so I'm having trouble with my Pi 5 and getting USB-Gadget mode to work. It's my first Pi ever and I'm trying to have it work as an HID emulator for keyboard and mouse while still being able to access it through Raspberry Pi OS as I use PyCharm to edit, run, stop, and test my script. I do not want to use SHELL, I like the visuals but I still want the Pi 5 to be in Gadget Mode. I've hooked up a Apple USB-C - USB-C plug from my Pi to my PC for power and also to connect them. Below I have posted my config.txt and cmdline.txt, when I tried to run a very basic HID script it returned to me
Config.txtcmdline.txt
and because I don't want a temporary solution but a permanent one I I tried to create a udev rule file using sudo nano /etc/udev/rules.d/99-hidg.rules followed by KERNEL=="hidg0", MODE="0666" and then sudo udevadm control --reload-rules and sudo udevadm trigger but when I go to verify permissions using ls -l /dev/hidg0 I get back so then I go to sudo /usr/bin/hid.sh and get back I'm completely lost and don't know how to fix this. Is there a way to get rid of all these permission for files and just have no security? This is only plugged into my home PC which doesn't move I don't need any 'owner root' I want to run my scripts without worry of some ridiculous permissions or something.Config.txt
Code:
# For more options and information see# http://rptl.io/configtxt# Some settings may impact device functionality. See link above for details# Uncomment some or all of these to enable the optional hardware interfaces#dtparam=i2c_arm=on#dtparam=i2s=on#dtparam=spi=on# Enable audio (loads snd_bcm2835)dtparam=audio=on# Additional overlays and parameters are documented# /boot/firmware/overlays/README# Automatically load overlays for detected camerascamera_auto_detect=1# Automatically load overlays for detected DSI displaysdisplay_auto_detect=1# Automatically load initramfs files, if foundauto_initramfs=1# Enable DRM VC4 V3D driverdtoverlay=vc4-kms-v3dmax_framebuffers=2# Don't have the firmware create an initial video= setting in cmdline.txt.# Use the kernel's default instead.disable_fw_kms_setup=1# Run in 64-bit modearm_64bit=1# Disable compensation for displays with overscandisable_overscan=1# Run as fast as firmware / board allowsarm_boost=1# Add this line for USB gadget mode (HID device: keyboard/mouse)dtoverlay=dwc2,dr_mode=peripheral[cm4]# Enable host mode on the 2711 built-in XHCI USB controller.# This line should be removed if the legacy DWC2 controller is required# (e.g. for USB device mode) or if USB support is not required.otg_mode=1[cm5]dtoverlay=dwc2,dr_mode=host[all]
Code:
console=serial0,115200 console=tty1 root=PARTUUID=17686e48-02 rootfstype=ext4 fsck.repair=yes rootwait modules-load=dwc2,g_hid quiet splash plymouth.ignore-serial-consoles cfg80211.ieee80211_regdom=US
Statistics: Posted by AlfieTheHunter — Wed Oct 02, 2024 12:52 pm — Replies 4 — Views 95