Use a USB Hub to share a device?

Could I use a multi-USB port connector as a ‘hub’, to share a device among computers?

Say I’ve got 3 PC’s located near each other, but I’ve only got one printer. Can I take a USB cable from each PC, and another one from the printer, and hook them all up into a single USB multi-port (a port like one of these)? I’m aware that I’d need the appropriate printer drivers installed on each machine.

Instead of using the port expander to connect (up to) 4 USB devices to one computer, I’d be connecting one USB device to multiple computers.

Any problems doing this? Anyone have any experience with this type of situation? I’m at a loss.

No. The first hint that it won’t work will come when you try to hook it up.

Some reference: The flat, thin end of a USB cable is the “A” end. The roughly square connector is the “B” end. (There’s also a “female A”, but they’re pretty much only used on extension cables.)

Standard USB cables have an A connector on one end, and a B on the other. The B generally goes to the device (and if the device has an integrated cable, like a mouse, the B connector is built in to the device). The “A” end goes into the computer or hub.

A usb hub will have one B and multiple A ports. The B is used to connect to the computer via a standard cable. Since there’s only one, you can’t hook up multiple computers.

If you get A-A, non extension cables (which are hard to come by), and a B-B for the printer (which is almost impossible to come by) you can hook it up, but it’s still not going to work. The USB “root hub” (actually not a hub at all, but inside your computer) is responsible for assigning addresses to the devices as they request them. If you have multiple root hubs, they start “fighting” over device addresses, and things get ugly pretty quick.

However, I’m tired of being Mr. Doom and Gloom TimeWinder, so here’s something that WILL work: a USB switchbox. Belkin makes a nice one for about $30, which will connect four computers to a single device, but only one at a time. You have to hit a switch to rotate between the computers (so that there’s only one root hub at any time). It’s basically equivalent to pulling the cable out of one computer and plugging it into the next one, but made all shiny, plastic, and automated (glowing LED numbers, too!).

I use this, in combination with a hub, to share a USB keyboard/mouse/printer setup between a Mac and a PC, for example. You just need to remember not to switch it while one computer is printing.

The other possibility is just to set up a small LAN - which just takes a router or switch and some Ethernet cables (probably in the $50-$100 range), and share the printer over a network. This is a much better, more supported solution.

Not only will it not work but you will damage the motherboards of your computers. So don’t even try it.

But they do make USB share switches… I use one at home to share a printer and scanner between two computers. An example can be seen here. This works much better than the print servers I had tried to date.

Aha!

Thanks.

Since the OP has been answered, I’ll hijack a little. How would this cause damage?

If you want to be cheap, you can just simply plug the printer into whichever computer needs to use it at that moment. USB cables can be plugged/unplugged while the computer is running without hurting anything, so it’s not too inconvenient - you don’t have to reboot or anything. That’s what I used to do when I had a computer that was cranky about sharing its printer.

Hijack #2

We have dozens disks being accessed off a single USB connection to XP. The disks are typically only “seen” one at a time. We send a command down to the device, and it “places” the disk on the USB.

Here’s some of the problems we are having.

The system call GetLogicalDrives(), is supposed to return a bit signifying a new drive has come online. Sometimes it works, sometimes it doesn’t.

Once XP assigns a device letter to a disk, it likes to save that device letter for that physical disk forever. We have hundreds of devices we need to pop in and out of the system. We eventually run out of device letters on XP.

Is there any way to tell XP to NOT “remember” letters it has assigned to a device?

Is there any other way to probe the XP system to find out when a new drive has been connected?

Let me take a crack at both hijacks:

Damage from pluging USB drives in backwards: USB carries a small amount of power (which is why USB flash drives, those little USB lights, and other small USB devices can be self-powered). This power comes from the root hub end (the computer), and is generally not enough to support a large number of devices. You can buy “powered” USB hubs that will refresh the power level for devices attached to that hub - I recommend ALWAYS buying powered hubs for this reason, they usually only cost a buck or two more.

However, reversing this setup shouldn’t cause damage; even root devices are supposed to (according to spec) tolerate power on this line even if they don’t use it. I suppose a badly designed device might have try to power an already-powered line, though.

ccwaterback, if you’ve got access to the Windows SDK (and it looks like you do), you can trap the WM_DEVICECHANGE message at some window’s message pump. wParam will be set to DBT_DEVICEARRIVAL for a new volume being mounted. You can create a new (invisible) window for this purpose, if necessary – the message is delivered to all of them.

It has generally been my experience that XP is more than happy to reuse drive letters for drives which it consideres “removable.” I’ve got (literally) a bag of USB flash drives sitting in front of me to test a program I’m writing, and it appears to take them in any order and assign them the next drive letter–regardless of what letter it had the previous time. I’m not sure what the difference is between my scenario and yours, I’m afraid.

Thanks for the info. I was also looking into “DeleteVolumeMountPoint” and “GetLogicalDriveStrings” as a way of keeping the system “clean” and unaware of previous disks it has connected to. We have hundreds, perhaps thousands, of USB disks we need to plug and play (one at a time) on a single XP system.