cgeeter
Posts: 2
Joined: Tue Jun 18, 2019 6:26 pm

Pi Zero with ConfigFS as Xbox Controller for PC host

Mon Apr 20, 2020 10:13 pm

Hey all,

I'm working on using ConfigFS to make a Pi Zero W look like an Xbox controller to a PC host, with the goal of being able to send gamepad HID packets and have the host listen to them. I've been able to get this working with a keyboard based off of this example: https://gist.github.com/rmed/0d11b7225b ... 108ee93df0

I've changed the vendorID and ProductID and relevant fields in the config descriptor to make the host believe a gamepad is plugged in (shows up as a gamepad in device manager on windows).

The issue comes in when I try to write bytes to the hid.usb0 file:

In the shell script, I change hid.usb0/protocol and hid.usb0/subclass to 0. I use the HID descriptor found here: https://gist.github.com/fendent/5709856

I use a simple python file write to write a byte string to /dev/hidg0, but I see no transactions happen over the wire using a usb sniffer. Why does this work when writing as a keyboard but not as a gamepad? I'm assuming there is a field I'm supposed to change, but I'm not sure what that would be. Does anyone here have experience with ConfigFS and gamepads? Any examples would be greatly appreciated!

Thanks in advance!

Return to “Python”