FeralAI / GP2040

Gamepad firmware for Raspberry Pi Pico and other RP2040 microcontrollers supporting Nintendo Switch, XInput and DirectInput
https://gp2040.info
MIT License
577 stars 125 forks source link

Enhance Web Configurator Compatibility #43

Open FeralAI opened 2 years ago

FeralAI commented 2 years ago

Currently the web configurator runs via lwIP over RNDIS from the TinyUSB library. RNDIS seems to only work on Windows platforms at the moment. Evaluate other ethernet emulation methods over USB such as CDC-ECM for compatibility with Mac and Linux platforms.

brndd commented 2 years ago

Linux should support RNDIS, so it's strange that it doesn't work. On Fedora 35, Kernel 5.17.7, I'm getting the following errors in dmesg:

[42460.907888] usb 1-11.2: new full-speed USB device number 16 using xhci_hcd
[42460.989825] usb 1-11.2: language id specifier not provided by device, defaulting to English
[42460.994904] usb 1-11.2: New USB device found, idVendor=cafe, idProduct=4001, bcdDevice= 1.01
[42460.994913] usb 1-11.2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[42471.437718] usbcore: registered new interface driver cdc_ether
[42476.483284] rndis_host 1-11.2:1.0: RNDIS init failed, -110
[42476.483388] rndis_host: probe of 1-11.2:1.0 failed with error -110
[42476.483431] usbcore: registered new interface driver rndis_host

As far as I can tell, return code -110 means ETIMEDOUT, ie. the connection times out for one reason or another (as per errno.h). Maybe it trying to register cdc along with rndis is mucking things up?

This is probably the line in the rndis driver that's returning the error, if it's any help: https://github.com/torvalds/linux/blob/664a393a2663a0f62fc1b18157ccae33dcdbb8c8/drivers/net/usb/rndis_host.c#L207

domdfcoding commented 2 years ago

@brndd what a coincidence that you and I should both be trying this at the same time and hitting the same error.

I tried on a Windows PC and Windows was initially unhappy as well, reporting that the device couldn't be started. Unplugging the board and reconnecting it fixed it, but I wonder whether it was the same timeout issue as on Linux.