How to statically assign USB port numbers?

9 posts / 0 new
Last post
MasterHome
How to statically assign USB port numbers?

Hello! There are several identical flatbed scanners connected to Raspberry. The scanner driver uses the USB port number. If the port numbers are changed, then the drivers connect the wrong scanners. For example Port_ # 0002.Hub_ # 0001. The next time you connect Port_ # 0001.Hub_ # 0001. How can I statically set the usb port number on the client?

MasterHome
Scanners are connected to

Scanners are connected to different Raspberry.

Michael
.

You cannot set those values, they are generated by windows (wrong - see below)

MasterHome
Is it possible for each

Is it possible for each connected server to create its own hub?

Michael
.

Actually! i reviewed my driver code again and i remembered i added this feature a few years back and if you use windows 10 then Yes you can allocate a specific port to a specific device.

1. Run regedt32
2. Add the key PortMappings of type REG_SZ to registry entry Computer\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\vhusb3hc\Parameters.
3. And set the value like this <local port>=<remote address>[,<local_port>=<remote address>...]

e.g

1=1121,2=212

4. Now save and reboot the computer

To find the remote address, right click on the device and select Properties and look at "Address"

Everytime you change the registry you must reboot the computer for the driver to reload the values.

MasterHome
It's working! Thank!

It's working! Thank!
I have 3 scanners. Raspberry has 4 USB ports. I had to connect to different ports so that there were different addresses. Can you improve the mapping, for example by adding a client name?

Michael
.

No

suaz
Static port with multiple servers

Hello,

i thought what you describe as a solution here would have fitted my needed but there's something i don't understand.
In my case, i have multiple raspberrys running vh servers with a single usb port used on each of them.
On client side (running on windows 10), i would have like to assign a COM port per raspberry/server.

The rationale is that the COM ports are usually the same, but they do change as soon as i add a new raspberry or change the update the vh server version.

In the post above, you suggest to check the address of the device and edit the registry.
But in my case, the address always appears to be the same (114) for the device attached to each raspberry.

So i'm note quite sure how to make the solution proposed work accross multiple servers.

Thx for the help

Michael
.

No its not supported over multiple servers, its a big change so i wont add it unless i get a fair few requests for this...

Log in or register to post comments