Connect two USB hosts to one device

Thread Starter

JuBlue

Joined Apr 12, 2021
3
Hi new member here! :)

I am currently playing with the idea of building a Gameboy like handheld using a BananaPi Zero. I would like to integrate some usb devices into the device and I was thinking of making them availiable to the outside of the handheld during the off state of the pi by connecting them to the pi as well as to a second female usb socket. I would use a switch to connect the 5V pin of the usb device to either the pi or the second socket.
My question is can I connect the data lines directly between all three ends or do you think I would have to switch them as well?
I am not too concerend regarding the grounds i will just connect all grounds to a common line.

Thanks in advance :)
 

Papabravo

Joined Feb 24, 2006
16,159
Hi new member here! :)

I am currently playing with the idea of building a Gameboy like handheld using a BananaPi Zero. I would like to integrate some usb devices into the device and I was thinking of making them availiable to the outside of the handheld during the off state of the pi by connecting them to the pi as well as to a second female usb socket. I would use a switch to connect the 5V pin of the usb device to either the pi or the second socket.
My question is can I connect the data lines directly between all three ends or do you think I would have to switch them as well?
I am not too concerend regarding the grounds i will just connect all grounds to a common line.

Thanks in advance :)
I wouldn't do that if I were you. It is designed to be one "function" per plug.
You can get yourself a hub, connect your devices to the hub and then connect the hub to the RPi
 

Thread Starter

JuBlue

Joined Apr 12, 2021
3
I wouldn't do that if I were you. It is designed to be one "function" per plug.
You can get yourself a hub, connect your devices to the hub and then connect the hub to the RPi
Yes i know that, I actually plan to build a hub but I thought it would be nice to be able to connect he hub to the pi and an a second PC like it would be possible with a kvm switch but easier by just switching the 5V line between ports i will attach a picture tomorrow to better explain what i want to do
 

Papabravo

Joined Feb 24, 2006
16,159
Yes i know that, I actually plan to build a hub but I thought it would be nice to be able to connect he hub to the pi and an a second PC like it would be possible with a kvm switch but easier by just switching the 5V line between ports i will attach a picture tomorrow to better explain what i want to do
If the configuration is not in the specification I would refrain from doing it regardless of your motivation.
 

DickCappels

Joined Aug 21, 2008
7,441
However you can get electric switches (transmission gates, I believe) to switch a device between two hosts or hubs. That would not violate any rules as far as I can see (its been the 1990's since I read an USB spec in detail).
 

Thread Starter

JuBlue

Joined Apr 12, 2021
3
Thank you, I looked that up and it sounds fitting I will test that!
For those who might find this forum enty, looking for an answer there is also a device called usb mux for example MAX4899, but for my purpose this is kind of an overkill solution
 
Top