How do i make the usb location constant

12 posts / 0 new
Last post
ahmed_eshra
How do i make the usb location constant

I am trying to make the location of shared usb devices constant.
When i connect Device A it is in Port_#0001.Hub_#0001 as reported by device manager, and when i plug in Device B in a different port it is reported as Port_#0002.Hub_#0001 , so far so good, but when i unplug Device A then i unplug Device B and plus it back into same port it is reported as Port_#0001.Hub_#0001.

I want the location to be related to the port at which the device is connected to not the order at which it is bound by.

Thanks in advance.

Michael
VirtualHere finds the first

VirtualHere finds the first available empty (virtual) port to plug a device into, so it matters which order you plug the devices. There are technical reasons why it must work this way. The usb tree is flattened by virtualhere (i.e there are no virtual hub attached) so its not possible to map 1-1 to a contant port number.

Therefore #port and #hub are not reliable to use to match a device, you should use the Device Instance Path (found in device manager->Right click on the usb device->Properties) which would provide the canonical way to identify a device.

Or you must plug in the devices in the same order

ahmed_eshra
It changes with device plugged into another port

If i plug in Device A to Port A it would end with .11.ns but if i plug in Device B to port A it will end with .22.ns.

I want connect multible cameras to same client and have it recognize which is which.

Michael
Your have cameras that dont

You have cameras that dont have a serial number (i write "ns" if the usb device has no serial number) its physically impossible to know what camera is what.

What brand are they? Its against the usb spec to not have a serial number

ahmed_eshra
Some have tge brand name

Some have the brand name removed while others have same serial so it shows there serial instead of .11.ns

Can you make it so that the device instance path is based on its port in the server and is constant between devices.

So when i want to access port1 i search for .11.ns for example.

Michael
.

Yes, there is a facility in the client to do this.

Stop and exit the client then edit the vhui.ini file and change the line SetAddressInstanceId under the General section to 1 instead of 0 and see if that solves your issue.

ahmed_eshra
It works but,

when i connect some flash drives for testing they are have their device instance id correct based on their port , but when i connect a serial device it get .71.ns while a flash drive connected to the same port gets 31.ns so the serial always gets +4 on the number that the other device got on every port.

Michael
.

Actually on each client you need to make change to SetAddressInstanceId to 1

The instance id's will always end with a 'ms' which means manual set address, they would never end with a ns if the SetAddressInstanceId setting is being used

ahmed_eshra
Typo.

Typo.
It is .*1.ms
sorry about that.
How do i make it so that any device plugged into a certain port will have same ending .

ahmed_eshra
After tinkering i found tgat

After tinkering i found tgat usb 1.1 devices get listed as diffrent ports in tinycore linux.

So virtualhere thinks they are on diffrent ports.

Michael
I think you should use

I think you should use something like raspbian or armbian instead of neo linux as it seems problematic regarding the address assignment by the kernel

ahmed_eshra
I am using tinycore linux

I am using tinycore linux because of its fast boot time.

Log in or register to post comments