2

I just want to use usb devices between two computers.

I got an idea for this, so I started to use relays to control the data flow in usb, but it didn't recognized by a computer.

Does anyone get a better idea for doing such thing?

1
  • 2
    Ready-to-use devices like that are available from your favorite shop. No need to roll your own. That being said, you probably need to reset the device by disrupting power.
    – Daniel B
    Jul 18, 2016 at 14:27

2 Answers 2

2

If what you're switching between the computers is simply a keyboard and mouse, What you're most likely after is a KVM switch. Alternatively, if there are other USB devices, there are USB switches that are relatively cheap.

Back to your specific case, switching USB via relays should work as is, but there are two things that I can think of that needs to be looked into. However, be aware of the following caveats:

  • Disassembling a USB cable will involve taking apart shielding, which in turn can make the equipment susceptible to noise. Unbraid as little shielding as possible, and try both with and without connecting the shield on the computer side of the relay (if connected all the way, you can potentially get an antenna effect when the shielding has imperfections, which is why a lot of equipment only has the shield connected in one end).

  • Some devices needs to follow their own startup-cycle, which in turns allows it to communicate and identify with the host device. It could be that an already powered on device, when seamlessly switched over to a different computer assumes that the host should already know about it and therefore doesn't attempt at identifying with the host as the host would expect. Experiment with adding a small delay between the two hosts, i.e. instead of connecting seamlessly between host computers, there's an intermediate step where it's not connected to anything and not getting any power. I know some harddrives in particular are pretty cranky about startup sequences and some might actually struggle if they don't get power BEFORE having their datapins connected.

Can't think of anything else off the top of my head, at least not without knowing what kind of devices you're dealing with. +1 for DIY-effort.

2
  • Well, technically the power pins (first shielding, usually grounded, then power) are always connected first. It’s how USB plugs are designed. :D
    – Daniel B
    Jul 18, 2016 at 19:12
  • @DanielB True, for vanilla off-the-shelf USB. Most of the problems I've seen have been caused by introducing an intermediary layer. For example, when I worked offshore we had these databuckets that were in effect USB, but they connected via special watertight connectors that connected all pins at once. This sometimes cause some strange effects. This design was later changed to two cables: one for power, one for data. The correct procedure for the order of connecting these were stressed time and time again. The same could be the case in this setup with relays.
    – Jarmund
    Jul 18, 2016 at 19:36
0

There are specialized chips (essentially "switchable hubs") that provide this kind of functionality to share a set of USB peripherals between two or more computer hosts. These devices are commercially available, for example:

https://www.usbgear.com/USBG-3SH2.html

Or look for Iogear GUB431 4-Port USB 2.0 Automatic Printer Switch:

"IOGEAR's USB 2.0 automatic printer switch allows four PCs and/or Macs to share one printer or multi-function printer. Simply submit a print job and the printer automatically switches to the preferred computer. The switch also enables four computers to easily share one external hard drive, scanner, or any USB device. No more plugging and unplugging between computers."

Similar sharing devices are even available for USB3.0 peripherals: https://www.startech.com/Cards-Adapters/USB-3.0/Hubs/2-Port-2-to-1-USB-3-Peripheral-Sharing-Switch~USB221SS

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .