So I have a pi0 2W setup outside and often find network connectivity to be poor. In these cases, I really want to get a wired connection to ssh into the device and debug directly. I've seen lots of documentation on activating OTG / gadget mode / g_ether module in order to get a serial connection over usb, which would normally be fine. However, the problem is that I also have a usb hub with multiple peripherals running on the device. As far as I understand it, the pi can either act as a usb slave or usb host, but not both. Therefore I don't think that approach will work for me.
It can do both just not both at the same time.
So, my question is this. Is there any way to get a wired ssh connection to the device without using gadget mode? Perhaps using the gpio pins? Or another usb approach? Or perhaps I'm mistaken about gadget mode being one way only?
You're mistaken.
The (should be) obvious way is to add a USB to ethernet adapter (and a bigger hub if necessary). Or a USB to serial adapter
If should also be posible to add ethernet via SPI (GPIO pins) e.g. by using an ENC28J60 (see =https://raspi.tv/2015/ethernet-on-pi-z ... our-pihere for one write up) but it will be at minimal speed.
Even if you did try gadget mode, the maximum certified length of a cable for USB 2 is 5m. More than that and it will likely fail or you'll need a repeater/active cable (essentially a single port USB hub) every 5m. Ethernet tops out at about 100m. RS232 serial at 15m. TTL serial (as present on the GPIO pins) at, I think, about 0.5m.
Statistics: Posted by thagrol — Thu Apr 18, 2024 11:45 pm