I have spent a number of hours following various guides on setting up OpenWrt on a RPi Zero W with Ethernet over USB. I have no problem with OpenWrt running on the RPi nor the WiFi, but I can't get the USB Ethernet working. It doesn't show up in any way on my laptop when I plug the RPi into my laptop nor as an interface in OpenWrt. However, I know that my laptop setup and all hardware is good because I am able to get it working using Raspbian.
This is the tutorial that got me started on the idea and the setup is ultimately what I want, but I want to use the latest OpenWrt 19.07. I tried using the LEDE image linked in the README and everything worked as expected.
With OpenWrt 19.07, I tried installing the kmod-usb-dwc2 and kmod-usb-gadget-eth packages and adding dtoverlay=dwc2 to /boot/config.txt but there was no connection when plugged into my laptop and no interface showed up in OpenWrt (with ifconfig). I started messing around and searching online trying various other things. I tried the kmod-usb-core kmod-usb-net kmod-usb-net-asix kmod-usb-net-asix-ax88179 kmod-usb-net and kmod-usb-net-cdc-ether packages which also didn't seem to help. No interface shows up in OpenWrt under ifconfig and nothing shows up on my laptop.
Eventually, after trying everything I could think of, I resorted to building a snapshot image as advised here on the OpenWrt Raspberry Pi page. It states in the 'How to use USB-Ethernet with Raspberry Pi Zero' section that system does not support USB OTG by default so you need to compile your own brcm2708-brcm2708 image with the kmod-usb-net, kmod-usb-net-asix, and asix-ax88179 kernel modules.
So I followed the instructions here to build an image on the openwrt-19.07 branch. After successfully creating the image, with the added kernel modules I still was not able to get any results. I've tried adding all kernel modules under USB Support in MenuConfig but still no results.
My next test is building the 18.06 and 17.01 releases and see if that makes any difference and perhaps trying to figure out why.
What am I missing/need to change/fix to get Ethernet over USB working with my Pi Zero??
- I have confirmed that everything works correctly when using LEDE/OpenWrt v17.01.6
- I have confirmed Ethernet over USB works in the Raspbian lite OS using the gadget driver (same drive as used on OpenWrt)
- I have confirmed that OpenWrt v18.06.8 and v18.06.0 don't work and presumably has the same problem as v19
- Here is a comparison of the dmesg output from LEDE (left side) and OpenWrt v18.06.0 (right side)
Note, my laptop is running Manjaro.
Some of the sources I've used to try to get it working are are follows: