How to statically assign USB port numbers?

7 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

Log in or register to post comments