6
\$\begingroup\$

Is it in principle possible to connect two computers with a USB A to USB A cable, and have one pretend to be a USB device, and the other act as host?

Assume I have complete control on the software side (via driver / kernel module), and the cable can be modded (e.g. crossover).

If it's not possible, why not? (For example, maybe the host chipset can't be made to send neccessary signals by software, or something.) And what is the minimal hardware I'd have to put between the two computers to make this work?

\$\endgroup\$
2
  • \$\begingroup\$ FYI, “USB On-the-Go” includes the capability of a device to switch between acting as host or peripheral. I don't know whether the chipset for non-OTG devices has the same capabilities, though. \$\endgroup\$
    – Kevin Reid
    Commented Feb 2, 2013 at 23:39
  • 3
    \$\begingroup\$ In addition to PC-style USB host controllers not tending to be able to operate as slaves, the exposed USB ports are almost always downstream ports from onboad USB hubs, which would tend to get in the way of turning things around to run backwards. That's notably different from dual-function micrcontroller or smartphone SOC type USB OTG ports, which tend to be "bare" without an onboard hub in the way. \$\endgroup\$ Commented Feb 3, 2013 at 22:52

3 Answers 3

2
\$\begingroup\$

I found the Facedancer board, which looks interesting. It contains a FTDI, a microcontroler, and a MAX3421E USB controler, and allows you to emulate a USB device in Python! That is, you basically write bit-banging code in Python on your PC, and the other PC sees the USB device that you emulate. It could be interesting for prototyping, and it has been used for fuzzing (automatically finding errors in USB host implementations and software).

\$\endgroup\$
1
  • 1
    \$\begingroup\$ That's not bit-banging, and it is using an actual USB device chip. \$\endgroup\$
    – Ben Voigt
    Commented Mar 5, 2013 at 17:06
1
\$\begingroup\$

Yes, It is possible to connect two computers via USB.

It is not as simple as crossover wires. It needs active circuitry to do that. There are commercial cables available that allow you to connect two computers. They are generally used to transfer data across or migrate from old to new computer / laptop.

If it's not possible, why not? (For example, maybe the host chipset can't be made to send necessary signals by software, or something.)

It is not possible in case of a computer (assuming a PC as you mentioned USB-A) because the USB generated from the chipset (ICH in case of Intel) is only capable as a host.


And what is the minimal hardware I'd have to put between the two computers to make this work?

Take a look at Belkin Easy Transfer (F5U279)

\$\endgroup\$
7
  • 1
    \$\begingroup\$ That has both computers acting as the USB Host, which isn't what the OP asked about though. \$\endgroup\$
    – Passerby
    Commented Feb 2, 2013 at 23:53
  • \$\begingroup\$ (Did not DV) However, this answer doesn't address the question. The cable basically contains a device that appears to each computer as a peripheral and routes data between these peripheral connections. \$\endgroup\$ Commented Feb 3, 2013 at 1:14
  • 1
    \$\begingroup\$ practically USB OTG is not seen on computers. This answer does answer OPs "Minimal hardware required" question. According to wikipedia article "USB OTG, is a specification that allows USB devices such as digital audio players or mobile phones to act as a host". \$\endgroup\$ Commented Feb 3, 2013 at 2:39
  • \$\begingroup\$ Only for limited definitions of computer. Cell phones are computers. Raspberry Pi, Beagle Bones, ARM SOCs, Pogoplugs are all computers, and tend to have OTG. All-winner nano-itx Linux Computers have OTG. The question isn't about practicality, it's about theory. (Also didn't downvote) \$\endgroup\$
    – Passerby
    Commented Feb 3, 2013 at 4:57
  • 1
    \$\begingroup\$ @jdm - This answer has both computers pretending to be USB devices to the other, which is all you have asked for. If you need it to be a specific type of USB device (from the multitude of possibilities), you'll need to specify that requirement. \$\endgroup\$ Commented Feb 3, 2013 at 22:36
-1
\$\begingroup\$

In principle, yes You can. Assuming you have complete driver support and documentation. Unless the chipset doesn't allow direct control.

It's basically how USB OTG words. A slave device that can also act as a host device, and vise versa. Just specialized software. Also similar to how Firewire Target Disk Mode works.

It would involve a lot of coding though. Hardware could be as minimal as a (non-standard) USB A to USB A cable.

In principle at least.

\$\endgroup\$
8
  • 4
    \$\begingroup\$ USB OTG is not present on computers unless specifically added by using an extra piece of hardware. \$\endgroup\$ Commented Feb 3, 2013 at 2:48
  • 2
    \$\begingroup\$ Well, considering this is a thought exercise instead of practical design, that's not a problem. USB OTG doesn't require any special hardware any more than USB itself does (you can bitbang USB). And if you can use the USB pins as GPIO with direct hardware control, you could use software to turn it into a usb slave device. It's not practical, but possible. \$\endgroup\$
    – Passerby
    Commented Feb 3, 2013 at 4:53
  • 1
    \$\begingroup\$ Incorrect. You cannot even remotely bitbang USB on most modern computers, as you don't have sufficiently realtime access to any GPIOs. That's become the exclusive domain of embedded microcontrollers with real I/O hanging directly off the processor, instead of at arms length downstream of some bridge device as is done in modern general purpose computers. \$\endgroup\$ Commented Feb 3, 2013 at 22:29
  • 1
    \$\begingroup\$ @Passerby - the lack of low-latency GPIO on modern computers is well known to everyone who works in the embedded and control fields, as its a major example of how technology has moved backwards in versatility, with things that used to be possible on older systems ceasing to be possible on newer ones as the increasingly faster CPU becomes increasingly more isolated from the real world. \$\endgroup\$ Commented Feb 3, 2013 at 22:37
  • 2
    \$\begingroup\$ No, the only unsupported claim here is that this would be possible on typical computers. You are ignoring that this has been demonstrated on embedded devices with low-latency GPIO optimized for real-world interaction, not on more complicated systems with I/O's neither intended nor suitable for bit-banging type usage even at clock rates a small fraction of the lowest USB speed. Embedded engineers develop an extreme experience-driven awareness of such distinctions, as it's essential to picking appropriate platforms for systems, and even their mockups/test harnesses. \$\endgroup\$ Commented Feb 4, 2013 at 3:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.