Configuring USB as host


#1

Hello -

With my Zero I have successfully loaded the default firmware which sets the USB port in device / serial gadget mode.

I want to set it up as a usb host to connect keyboard, external wifi, etc - is there a tutorial on this, or did anyone figure out how to do it?

Thanks in advance!


#2

You will need an USB OTG Adapter. They are often used to convert the micro usb port of a smartphone (Android) to a usb host.
I think you don’t have to change anything in Linux.


#3

I believe the OTG adapters are simply a port changer, with no special connections or electronics.

So, if it’s just a matter of the software automatically detecting a connected device, that’s great to know. I’ll have to give it a try.

Thank you!


#4

OTG adapters are not only port changers !
There is special Connection !
Micro/Mini USB connector on board have special pin USBID, which connection inside cable affect board behavior as Host or as Device.
If pin USBID in cable connector is shorted to ground, then board going to be Host and must provide power (could be connected USB devices).
If this pin is unconnected in cable connector, then board must be Device with No power output ! (connection to PC or charger).
Status of this pin is read by OTG driver and automatically switch board behavior, so user do not have to change anything in Linux.


#5

Thank you! I did not realize that. Should make things much easier to test!