How to use a detected USB RNDIS gadget as network adapter
I have a RaspberyPi module, with USB connected to another module computer (as USB host) running Linux. The RasPi is configured as USB ethernet gadget.
Once I boot the RasPi, and enter dmesg on the host computer, I see:
[ 2918.753649] usb 1-1: Product: RNDIS/Ethernet Gadget
So the Raspi is detected as gadget on the USB host computer.
But unlike a previous experiment, where I used another RaspberryPi as the host, where it also detected the 1st raspi as gadget and created a usb0 network adapter and assigned an IP configuration to it, this is not the case here. No usb-anything under ifconfig -a. Not listing it with the -a option means that no network device usb0 exists, configured or not?
My current host computer runs a rather down-sized Linux based on buildroot/busybox.
Is there a certain configuration missing that allows using this detected RNDIS gadget for network - which just happens to be done automatically on the default Raspi Linux distribution - but not necessarily on others?
1 answer
I was looking through the unpacked file that I find in /proc/config.gz on the host system.
There was: # CONFIG_USB_NET_DRIVERS is not set
What I also found is that, the host side counterpart to the gadget device's g_ether driver, is supposedly the cdc_ether driver. I found mentions of CONFIG_USB_NET_CDCETHER , CONFIG_USB_USBNET and other USB_NET options that supposedly need to be onm in other posts elsewhere. My config file does not contain that text except for the mentioned CONFIG_USB_NET_DRIVERS - but apparently, dependant options of a main option are not always also put into the config text file.
Generating a new kernel image, with the following items added to the kernel configuration, helped, and I now get a "usb0" interface shown under ifconfig -a :
- CONFIG_USB_NET_DRIVERS
- CONFIG_USB_USBNET
- CONFIG_USB_NET_CDCETHER
- CONFIG_USB_NET_CDC_EEM
next to options generally enabling USB and enable it as a host (or dual role). I'm not sure whether the last one is necessary, haven't tried. Its description sounded like it could be relevant, as it mentions a usbX interface name, which I knew from the Raspi4-as-host experiment.
0 comment threads