Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 8013

Interfacing (DSI, CSI, I2C, etc.) • Re: dwc2 ethenet driver on PI02W issue

$
0
0
I must be doing something differently, because I can config a pi02w with dwc2 installed and have it successfully connect as ethernet device usb0 to usb hosts on linux and windows.

In looking at the auto-generated configuration I see

Code:

dtoverlay=dwc2
at the end of /boot/firmware/config.txt

This is in cmdline.txt

Code:

modules-load=dwc2,g_ether g_ether.dev_addr=dc:a6:32:78:d7:47 g_ether.host_addr=dc:a6:32:78:d7:42 
And this command was executed:

Code:

sudo sed 's/^[^#]*gadget/#\ &/' /usr/lib/udev/rules.d/85-nm-unmanaged.rules >| /etc/udev/rules.d/85-nm-unmanaged.rules
And last but not least, there's a new nm connection created via this

Code:

    cat <<- EOF > /etc/NetworkManager/usb-dhcp.nmconnection[connection]id=usb0-dhcpuuid=<some uuid>type=ethernetinterface-name=usb0autoconnect-priority=100autoconnect-retries=5[ethernet][ipv4]dhcp-timeout=60method=auto[ipv6]addr-gen-mode=defaultmethod=disabled[proxy]EOF
This is from the pi02w:

Code:

p022w~# pimodelRaspberry Pi Zero 2 W Rev 1.0p022w~# ip a1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00    inet 127.0.0.1/8 scope host lo       valid_lft forever preferred_lft forever    inet6 ::1/128 scope host        valid_lft forever preferred_lft forever2: usb0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000    link/ether dc:a6:32:78:d7:47 brd ff:ff:ff:ff:ff:ff    inet 10.42.0.2/24 brd 10.42.0.255 scope global noprefixroute usb0       valid_lft forever preferred_lft forever    inet6 fe80::7856:9847:d00e:8be8/64 scope link noprefixroute        valid_lft forever preferred_lft forever3: wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000    link/ether d8:3a:dd:d0:e1:9f brd ff:ff:ff:ff:ff:ff    inet 192.168.92.136/24 brd 192.168.92.255 scope global dynamic noprefixroute wlan0       valid_lft 84444sec preferred_lft 84444secp022w~# ping 10.42.0.1PING 10.42.0.1 (10.42.0.1) 56(84) bytes of data.64 bytes from 10.42.0.1: icmp_seq=1 ttl=128 time=1.23 ms64 bytes from 10.42.0.1: icmp_seq=2 ttl=128 time=0.301 ms64 bytes from 10.42.0.1: icmp_seq=3 ttl=128 time=1.39 ms64 bytes from 10.42.0.1: icmp_seq=4 ttl=128 time=0.972 ms--- 10.42.0.1 ping statistics ---4 packets transmitted, 4 received, 0% packet loss, time 3020msrtt min/avg/max/mdev = 0.301/0.971/1.385/0.414 ms
I suspect you're missing the udev rule change, but if there's something else as well, you can try this yourself:

Code:

curl -L https://raw.githubusercontent.com/gitbls/sdm/master/install-sdm | bashsudo touch /etc/sdm/history    # workaround for a dumb bug ;(sdm --runonly plugins --oklive --plugin gadgetmode:static-mac# then reboot
A couple of final notes:
  • I've only tested against one Win11 laptop, so it may be that system, but the USB connection on the Windows side didn't provide a DHCP address for the 02W. I haven't researched this any further yet, but it works if I configure the both the Windows RNDIS and 02w usb0 connection with static IPs and I also had to enable the firewall's ICMPV4 inbound rule for Public networks.
  • On the Linux side, I used the sdm plugin "hotspot" to create the tether host.
  • The basis for the gadgetmode plugin's libcomposite code: https://blog.hardill.me.uk/2023/12/23/pi5-usb-c-gadget/

Statistics: Posted by bls — Mon Aug 25, 2025 5:55 pm



Viewing all articles
Browse latest Browse all 8013

Trending Articles