Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RNDIS / g_ether not working #810

Open
jayofelony opened this issue Nov 20, 2024 · 4 comments
Open

RNDIS / g_ether not working #810

jayofelony opened this issue Nov 20, 2024 · 4 comments

Comments

@jayofelony
Copy link

jayofelony commented Nov 20, 2024

I edited my /boot/firmware/config.txt and /boot/firmware/cmdline.txt how I always did, with dtoverlay=dwc2 and modules-load=dwc2,g_ether. Than I add a usb0-cfg configuration file to /etc/network/interfaces.d, but apparently I have missed some commit or change somewhere I fear.

This does not seem to work anymore, any help would be greatly appreciated in getting this to work. So I can connect to my RPi Zero 2W again over usb with the latest kernel.

Please excuse me for the lack of logs, but I cannot login to my 02w for reasons mentioned above and see them.

edit:
setting managed = true in NetworkManager.conf doesn't help either.

@XECDesign
Copy link
Member

I believe the issue is that ifupdown has been removed from the latest image. An appropriate configuration file would need to be added for NetworkManager or systemd-networkd instead.

The reason ifupdown was taken out was because it's not used on a default install, but eats up some boot time.

If it's not possible to do this without ifupdown, maybe the solution is to keep ifupdown in the image, but disable the services by default. I don't see why ifupdown would be required, but I also see that it's not nice to break things that used to work. It's just a matter of whether or not it's justified in this case and how easy it is to work around it...

@jayofelony
Copy link
Author

I'll install ifupdown and try again, I don't mind a prolonged boot time. But I do require rndis for my images.

@jayofelony
Copy link
Author

I installed ifupdown and now everything is working as it was. I did disable [email protected].

@jayofelony
Copy link
Author

jayofelony commented Dec 22, 2024

I took a deep dive into NetworkManager and found out how to enable g_ether with it.
usr/lib/udev/rules.d/85-nm-unmanaged.rules needs to be copied to /etc/udev/rules.d and
ENV{DEVTYPE}=="gadget", ENV{NM_UNMANAGED}="0" needs to be added to bottom before last line.

then:

[connection]
id=usb0
type=ethernet
interface-name=usb0
autoconnect=true

[ethernet]

[ipv4]
address1=10.0.0.2/24,10.0.0.1
dns=8.8.8.8;1.1.1.1;
method=manual

[ipv6]
method=disabled

Can be added as a file to /etc/NetworkManager/system-connections/usb0.nmconnection

Then the interface will be up at boot with a fixed IP of 10.0.0.2. Maybe it can be added to pi-gen by default? Saves a lot of work to get it working after flashing to an SD card. If the corresponding dtoverlays have been added to config.txt and cmdline.txt ofcourse.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants