smallpig01
Posts: 1
Joined: Sat May 18, 2019 12:26 am

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

Sat May 18, 2019 1:14 am

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.

User avatar
mahjongg
Forum Moderator
Forum Moderator
Posts: 11762
Joined: Sun Mar 11, 2012 12:19 am
Location: South Holland, The Netherlands

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

Sat May 18, 2019 2:40 pm

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).

amzounslide
Posts: 1
Joined: Sat May 18, 2019 4:18 pm

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

Sat May 18, 2019 4:19 pm

I can confirm that DetailedInterfaceDataStructure has an interface number in case of HID composite devise (at least).

User avatar
thagrol
Posts: 1479
Joined: Fri Jan 13, 2012 4:41 pm
Location: Darkest Somerset, UK
Contact: Website

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

Sun May 19, 2019 10:28 am

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.
Note to self: don't feed the trolls

If I've asked you a question, please answer it. I'm unlikely to be able to help without that information.

PiGraham
Posts: 3531
Joined: Fri Jun 07, 2013 12:37 pm
Location: Waterlooville

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

Sun May 19, 2019 11:37 am

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).

Return to “General discussion”