Hello! I searched everywhere, but I still can't find a solution. Maybe you guys can help, here is my problem:
Is there any way to find out the (psysical) hardware addresses of specific USB ports? I have a program that tests certain things on external tape drives. The program worked fine on SCSI, SAS and FC connector drives, but those ports all have unique identifiers. Now, I have to do this with USB connector ones. Here is how it goes: one instance of the program can only test one drive at a time, but I need to test 8 drives simultaneously. Each port has an extension cable and they are all numbered. 8 instances of the program is launched, each with specific launch parameters to use one specific port (so program 1 uses port 1, program 2 uses port 2, etc). This worked fine with other connector types, but ran into a brick wall with USB, since the ports doesn't seem to have unique identifiers, as if they don't even exist and the ports themselves are created from thin air when a device is plugged in.
So my question is, is there a way to identify specific (physical) USB ports? So I could tell program instance 1 to look for a drive on USB port 1, instance 2 to 2, 3 to 3, etc?
I dont believe that can be done, although im not quite certain.. From my understanding of it, the usb system is an adressable bus system, meaning that the "addresses" are handed out when a device is connected; which is why you can run a usb hub, and then a hub from that hub, etc, etc, up to i believe 5 'hops' from the computer itself (may be off). I dont believe each
I do believe you could get an interface card and plug it into a usb port, and then that would have a base address you could reach it at, but the usb itself does not.
Other than that, im not really sure how your system is set up, but you can assign a usb device a specific drive letter. I.E. every time you plug in a specific device, for example a specific thumb drive, called "playbahnosh's thumbdrive" it will assume the letter 'W'. Maybe if you did something to that effect it could communicate with your program?
Yes, that's what I was afraid of. I also noticed that the USB ports themselves are created basically out of thin air when a device is connected, until then they don't even show up in the hardware manager either, only the hubs.
The system is set up so it looks for drives at a given port address, not drive letter. The drives to be tested doesn't even have drive letters so they have to be accessed directly through a port. This worked fine with all other port types (SCSI, SAS, FC, etc) because those ports are persistent, their addresses are persistent (they show up in the device manager), so if I want to communicate with a drive at a specific port, I can just call it by address like "SCSI6:1,1,0". But USB ports are random, they show up in the order the devices are plugged into them, and also if you disconnect and reconnect a drive, it might have a totally different port address with USB.
And that's another problem, since the drives are power-cycled a few times during test, so the port addresses are changing around like crazy. Until this point I could only run the test on one drive at a time, since if it's the only drive on the system, it always gets the same address. The problems started when I wanted to test multiple drives, the test program went bonkers since it either did not find the drive or found a completely different one on the same address.
Right now, the only way I can think of to make it work, is to use individual USB hubs, since those are the only ones with persistent addresses. Either PCI or external USB hubs (since I need to connect 8 drives at once). It seems like a waste to use a separate hub for each drive, but I found no other alternative yet. Could this work?