Page 1 of 1

how to connect another USB device when pi zero is turned to HID device?

Posted: Sat May 18, 2019 1:14 am
by smallpig01
Hi all,

I already turned pi zero as HID device(slave), after connect to PC(host) by micro USB port with a normal Type-A to micro cable, Host can Identify as a HID and avaliable to trans keyboard message.

now I need to connect an another USB UVC device to pi zero because I want generate some message from image to send out through HID.
(I know there have a PICam, but not suite me.)

But I have no addational USB port to use…

I tried use a org cable (micro-M to A-F) and USB hub to extend USB port, but HID function invalid.



1. Is HID function can normally use through a Hub?
2. or there have another method to connect another USB device when pi zero is turned to HID device?

Thanks.

Re: how to connect another USB device when pi zero is turned to HID device?

Posted: Sat May 18, 2019 2:40 pm
by mahjongg
You cannot do this the way you want.
the zero only has one USB which can be either in master OR in slave mode, and any hub will disable slave mode.

you can try to communicate with a second zero using the PIs built in serial interface (UART).

Re: how to connect another USB device when pi zero is turned to HID device?

Posted: Sat May 18, 2019 4:19 pm
by amzounslide
I can confirm that DetailedInterfaceDataStructure has an interface number in case of HID composite devise (at least).

Re: how to connect another USB device when pi zero is turned to HID device?

Posted: Sun May 19, 2019 10:28 am
by thagrol
A couple of other suggestions:
  1. Switch to a zeroW and communicate with a second device over wifi
  2. There are such things a spi to USB host chips. While I have no experience of them it may be possible to add a secnd USB port using one of those.

Re: how to connect another USB device when pi zero is turned to HID device?

Posted: Sun May 19, 2019 11:37 am
by PiGraham
thagrol wrote:
Sun May 19, 2019 10:28 am

[*]There are such things a spi to USB host chips. While I have no experience of them it may be possible to add a secnd USB port using one of
There are. Here's a post containing a suggestion that it works on Rasbian, maybe.
https://www.raspberrypi.org/forums/view ... p?t=201262

There are Arduino shields available with the MAX3421E which is capable of full-speed (USB1.1 fastest speed, 12 Mbps).