Master & slave mode with Pi Zero 2

August 27, 2024, 12:51

nex0rion

Hi, is there a way to achieve a Master + Slave mode using the Pi Zero 2? With the USB data port I can connect a hub and have multiple usb devices attached to the Pi host, removing all of that I can use the port and configfs to use the Pi as a HID device. Given the single USB controller on the Pi, I don't think it's possible to use both mode at the same time. So, is there a cable or a hub that can do this type of thing? If it doesn't exist, does a USB switch cable exist? A cable that can toggle between Master and Slave mode?

oops.se

The protocol for USB client and USB Host is quite different. Mobile phone has a feature called OTG that is the same as you describe.

nex0rion

Yes, however I can alternatively use them. If I use the Zero as host, I can connect various USB devices like a keyboard and a mouse, while if I use it with an OTG cable I can use it as a HID device (a slave, like sending keystroke to a PC attached to the Zero and the Zero is seen as a keyboard)

nex0rion

I know I can't do both ilat the same time, but do you know if there is a way to alternate between the two modes?