- Computers & Software»
- Computer How-Tos & Tutorials
Connecting Two Computers With USB
There are few things in this life with which I am unapologetically enamored. I won't go into my bizarre list of eccentric joys (you don't care that I love "People of Wal*Mart" or ridiculous conspiracy theories) but I will say with vigor that I love, love, love Universal Serial Bus, or USB, technology. Parallel, serial, GPIB, and communications ports express great sorrow at that last sentence.
USB ports, connectors, and cables are so engrained in our culture that every device comes with some sort of USB functionality. You never see floppy disc drives and even serial ports are a rarity on most new computers but those USB ports keep multiplying like rabbits. Computers come with multiple USB ports since all of the peripherals now run off of USB connections. USB hubs can be purchased with seven ports (and there are some out there with even more.) Phone chargers are now two-in-one with USB capabilities. The list of possibilities with USB cables is near endless . . . so it is concerning when one encounters an application where USB just will not do . . . or will it?
The Challenge of Connecting Two Hosts
Recently I was entangled with a dilemma in which I needed to transfer data from, essentially, one hard drive to another. A piece of equipment in the laboratory would make a measurement and record the results in a file internal to its own hard drive. I had created an Excel program, slopped together through Visual Basic coding reminiscent of a Frankenstein creation, and needed to extract the data from the measurement device and utilize it with my program. Previous to that point, I used a USB flash drive because, as stated, I love all things USB. I would load the data onto the stick, physically transport it to the computer, and then upload it into my, for lack of a more appropriate term, 'program.' This became tiresome . . . and hilarious when a colleague turned around in his chair and bent the flash drive in half with his knee. It still worked, though it was (by that point) an 'ergonomically structured USB drive.' In business terms, there was an extremely poor 'economy of motion' involved with this process and, add to that, the USB flash drive would change drive letters based on whoever was logged into the PC (my program would only search for a specific drive letter.)
So what was a handsome, witty, brave, and modest gentleman such as myself to do? The initial reaction was to simply link the two through an Ethernet connection but the issue with that proposal was that the piece of equipment was rather expensive and we did not want any random person communicating with it. Plus the red tape and litigation that would ensue from placing an unknown object on the network would probably give me a headache and get the entire operation shut down. We were also limited due to my lack of knowledge in regards to coding associated with serial and GPIB ports. Essentially I only knew how to find, save, copy, and delete files - transporting discrete data was an unknown to me (and still is.) With IT and my own brain working against me, I turned to my old friend, USB.
USB architecture consists of a host and a device. In most cases, your computer is a host while your webcam / iPod / printer / scanner / mouse / keyboard / etc. is the device. With a USB, data is dumped from one to the other with the host essentially calling the shots and telling the device what to do. Wikipedia states it more eloquently:
"The host controller directs traffic flow to devices, so no USB device can transfer any data on the bus without an explicit request from the host controller. In USB 2.0, the host controller polls the bus for traffic, usually in a round-robin fashion. The throughput of each USB port is determined by the slower speed of either the USB port or the USB device connected to the port."
What about, say, your phone? It can connect to a computer as a device but, with the right connectors, it can also act as a host to other devices. This is becoming more and more common as products become more versatile and interchangeable. Luckily, Engineers and Programmers are always in step with demands (or at least trailing closely) and created USB-On-The-Go (USB OTG) which essentially allows USB connections for that very concern. Now, products with USB OTG can act as either the host or the device, dependent upon the configuration.
Not included in USB architecture, though, is host-to-host communications which does not bode well in this day and age of 'well, why not?'
USB Host-to-Host Connections
Thankfully it is possible to connect two 'hosts' but one must exercise caution and carefully read the product package when choosing the proper USB cable. There are USB cables in existence which have Type A plug connectors on both ends and physically will plug into two hosts without any mechanical resistance. These are NOT to be used; directly connecting two hosts with one of these 'straight' connector cables will potentially destroy both the port and/or the power supply associated with each host USB. Again, DO NOT CONNECT TWO HOSTS WITH A STRAIGHT-THROUGH USB CABLE.
Now that I've got that out of my system, I can tell you about USB Bridge cables. USB Bridge Cables, sometimes referred to as USB transfer cables or USB Host-to-Host cables, do connect hosts but not directly as one might desire.
Essentially, the bridge cable has hardware within it which acts as the 'device' to both hosts. Software is utilized on both machines to transfer files and data between them but with the caveat that the bridge circuitry acts as the messenger, or middleman. To use this, one must use software provided with the USB bridge cable to perform 'drag-and-drop' functions from folders on the host and folders on the bridge device. The only issue one might have with this, as I did, is that the bridge cable device that appears as a drive under 'my computer' is not, for lack of a better term, 'explorable.'
For instance, the shoddy program I created would look for files in a specific folder but could not open and access the USB Bridge cable drive because it is not merely a drive, it is a program. This would have added the step of me having to transfer data on my own to a known folder for the program to work. Neither my program nor the USB bridge cable was at fault - it was merely an instance of trying to slam a square peg into a round hole.
USB bridge / transfer cables are useful for host-to-host applications where the user does not want to take the trouble of setting up a network via Ethernet. The drawback is that it is still not a 'straight' connection, requiring a device within the bridge to transfer data. This may be troublesome for the individual who does not want to drag and drop files from the bridge device to the host but I imagine the number of people who would be irritated by this includes myself and maybe one or two others.
USB, in this case, did not do the trick for me. I ended up using the network (*gasp*) but made sure to password protect the measurement equipment. I additionally setup the measurement equipment so that only one computer at a time could explore the specified folder on the machine. I learned a lot about USB in the process, though, and knowledge is power . . . or something like that.