Ethernet-over-usb not working with usb-c to usb-c cable, working with adapter
I have an OTG device that exposes a network interface over USB-C, providing a DHCP server (think a raspberry pi or similar). When I plug it into my Linux computer (USB-A on the computer, USB-C in the device), then Linux shows a new interface with an IP, and I can SSH into the device.
On a Macbook (where the Macbook also has USB-C connectors), it does not always work:
- If I take a usb-c to usb-c cable and use it to connect the Macbook to the device, it does not seem to get recognized (the network interface is not appearing in
ifconfig
). - If I connect a USB adapter to the Macbook (one of those USB hubs exposing 3 USB-A sockets), and then I connect a usb-a to usb-c cable between the hub and the device (so it's usb-c <--> usb-a <--> usb hub <--> usb-c), then it is recognized.
My first thought was that the hub was definitely a USB device/gadget, and maybe that helped because both the Macbook and the device were USB hosts. But I am pretty sure that the device is OTG, and the fact that the device can connect directly to the Linux shows that it can run as a gadget (and for sure the Macbook can run as a host).
What could be the reason for that issue? And optionally: is it correct to think that the Macbook USB ports are not OTG but always host (I have never heard of an OTG port in a computer, not sure if that's a thing)?
Note: it seems similiar to this old unanswered question.
EDIT: as required, the System Report
when it works. When it doesn't (i.e. with the usb-c-only cable), then the line just does not appear in "USB 3.0 Bus"...
I think the problem is that your USB-C to USB-C cable is in fact power only.
The setup you have should work when you connect it directly, but you write the USB part of System Report gives no indication that anything at all is plugged in. If you have used a charger cable that has no data lines, this is what would happen.
Try with a different USB-C to USB-C cable and it should hopefully work.
UPDATE: Based on your comments, the problem seems to be that the device itself doesn't actually support USB-C fully. You'll need to configure the Linux kernel with the CONFIG_TYPEC
option in make menuconfig
in order to have support for USB-C build.