0

Ethernet Gadget on MacOS
Moderators: adafruit_support_bill, adafruit

Forum rules
Talk about Adafruit Raspberry Pi® accessories! Please do not ask for Linux support, this is for Adafruit products only! For Raspberry Pi help please visit: http://www.raspberrypi.org/phpBB3/
Please be positive and constructive with your questions and comments.

Ethernet Gadget on MacOS

by andrewvit on Wed Sep 22, 2021 3:56 am

I'm not having any success following the guide for connecting to my Pi Zero (non"-W") using USB/ethernet gadget mode.

I imaged Raspbian Lite (buster) using Raspberry Pi imager, and configured according to:

https://learn.adafruit.com/turning-your ... net-gadget

It looks like the OS boots correctly and puts me at the login prompt, which I can see when I connect an HDMI cable. I can see the `g_ether` module being loaded and configured. I also tried adding the various recommended module options to the cmdline.txt script including static addresses, too:

Code: Select all | TOGGLE FULL SIZE
modules-load=dwc2,g_ether g_ether.host_addr=11:22:33:44:55:66 g_ether.dev_addr=66:55:44:33:22:11 g_ether.use_eem=0


However, I'm unable to see the device show up on the host machine, and cannot SSH to it. In Network Settings there is no "RNDIS/Ethernet Gadget".

For what it's worth, the Pi is not receptive to normal USB input if I try to boot it standalone and plug in a keyboard so I suspect it's doing the right thing and setting up the USB as an ethernet adapter.

I'm running MacOS Catalina: is this known to be supported there, or does it need to have HoRNDIS installed separately? (This is not documented and it sounds like it should just work without it.)

Does anyone know if the guide I'm following is up to date, or anything else I might be missing? Any tips or help appreciated. Thanks!

andrewvit
 
Posts: 6
Joined: Fri Sep 17, 2021 2:26 am

Re: Ethernet Gadget on MacOS

by mikeysklar on Wed Sep 22, 2021 7:17 pm

Can you post a photo of how you have the Pi connected? I really just want to make sure you are going into the micro USB connect with the ethernet gadget.

If you manually tried to load the module after boot do you see the USB device?

Code: Select all | TOGGLE FULL SIZE
modprobe g_ether host_addr=00:11:22:33:44:55


Check for usb0 device using

Code: Select all | TOGGLE FULL SIZE
ifconfig -a

mikeysklar
 
Posts: 5885
Joined: Mon Aug 01, 2016 8:10 pm

Re: Ethernet Gadget on MacOS

by andrewvit on Thu Sep 23, 2021 4:45 am

Thanks for the response. I tried imaging the SD again, and booting without any config changes.

After doing both `sudo modprobe g_ether` and `modprobe dwc2` I can only see the loopback device under `ifconfig -a`. No usb0.

This is my connection. The grey microUSB has USB-A on the other end, into the USB-C adapter, which I plug into to the MacBookPro host machine. This cable works for programming Arduino, so I believe it should work here too.

Screen Shot 2021-09-23 at 1.39.41 AM.png
Screen Shot 2021-09-23 at 1.39.41 AM.png (903.31 KiB) Viewed 1174 times

andrewvit
 
Posts: 6
Joined: Fri Sep 17, 2021 2:26 am

Re: Ethernet Gadget on MacOS

by mikeysklar on Thu Sep 23, 2021 3:02 pm

Don't forget to plug in the USB cable from your computer to the "USB" connector port on the Pi Zero, not the PWR connector.


Based on the photo provided and the note from our guide above it looks like you need to be on the Pi Zero micro-USB port (not the micro-USB power port) with your data cable.

mikeysklar
 
Posts: 5885
Joined: Mon Aug 01, 2016 8:10 pm

Re: Ethernet Gadget on MacOS

by andrewvit on Thu Sep 23, 2021 10:53 pm

Yes, I thought that's what I had: unless these are labelled incorrectly?

Screen Shot 2021-09-23 at 7.45.28 PM.png
Screen Shot 2021-09-23 at 7.45.28 PM.png (677.95 KiB) Viewed 1158 times


It lights up the LED and boots up when plugged into this port marked "USB" using a data cable. It also boots when powered standalone from the port marked "PWR". I'm not sure if the ports are interchangeable in that case, I haven't tried to swap them around yet.

andrewvit
 
Posts: 6
Joined: Fri Sep 17, 2021 2:26 am

Re: Ethernet Gadget on MacOS

by mikeysklar on Fri Sep 24, 2021 2:12 pm

micro-USB port looks good. Thanks for the close up shot.

There is a short RNDIS setup guide here that is not ours, but is MAC specific and might be helpful to try.

https://gist.github.com/superdodd/06b91 ... 8b27dc601e

mikeysklar
 
Posts: 5885
Joined: Mon Aug 01, 2016 8:10 pm

Re: Ethernet Gadget on MacOS

by andrewvit on Wed Sep 29, 2021 3:47 am

There is a short note on this page, which makes me wonder if it can even work on a Pi Zero if the board doesn't have its own ethernet:

due to the lack of built-in Ethernet on the board, you will either need a USB Ethernet adapter that you can use to configure the Pi, or a Serial-to-UART cable.


https://www.instructables.com/Set-Up-a- ... ing-a-Mac/

andrewvit
 
Posts: 6
Joined: Fri Sep 17, 2021 2:26 am

Re: Ethernet Gadget on MacOS

by mikeysklar on Wed Sep 29, 2021 4:07 pm

No people are doing this with the Pi Zero no USB or UART cable.

Try the 'superdodd' github link I sent and see if / where that fails. It is Pi Zero based.

mikeysklar
 
Posts: 5885
Joined: Mon Aug 01, 2016 8:10 pm

Please be positive and constructive with your questions and comments.