Perhaps I'm overlooking the obvious, but the client API documentation doesn't list an option for this, so here goes: Could you please add an option to connect to a device nickname? This would make scripting a lot easier as there's no need to take the ever-changing port numbers into account when turning devices on and off or restarting the host.
BTW: Just noticed that the device nickname is reset as soon as the device is turned off and on / plugged out and in again. In order for the above to work, we'd need persistent nicknames of course. Is that even possible?
Nicknames shouldnt change.
Nicknames are qualified by the device serial number. Right click on the device in the properties and see if it has a serial number. In theory the USB specification that manufacturers must abide by says that a USB device should have a serial number. However some devices dont have a serial number so there is no way to uniquely identify a device other than by the port its in. Can you tell me if your device has a serial number?
Does the command line client list the serial number with "DEVICE INFO"? If so, both devices don't seem to have one, only a product ID.
Ok thats the problem, there is no serial number so there is no way to identify an individual device. But there is a setting you can use to qualify a device by port, just dont change the device to a different port, then it should work fine.
1. Exit the virtualhere client
2. Open the file c:\Users\<username>\AppData\Roaming\vhui.ini using e.g Notepad
3. Under the
[General] section add a line
4. Save the vhui.ini file and exit notepad
5. Start the virtualhere client again. Now give the device a nickname and it will now save it on the server so its qualified by port instead of vendor/product
Thank you for the description. Unfortunately, this doesn't seem to work in my case with the latest Android server and Linux client. The nicknames always revert to the default when plugging USB device. I am using a hub in between the server and the devices - could that be the issue?
Just tested it: Even directly connected devices lose their nickname after plugging them out and in again.
In the virtualhere client, right click on the device and select Properties and note the Address
Unplug/replug and then see if the address is still the same.?
The address changes each time the device is unplugged / replugged, i.e. "localhost.1004" becomes "localhost.1005" the next time and so on.
OK i think your out of luck, if your device has no serial number and the port number is changing there is no way to identify a particular device. You either need to use some other server besides Android so you can assign it a nickname based on USB port, or you cant change the nickname. *Note the port is allocated by Android, it should be stable but it seems like your Android device is not allocating stable ports)
Thank you for the answer and let's revisit my initial post then: Could you add an option to connect to a device name? I can't set a nickname for the device, but the generic name (e.g. "USB Audio Device") always stays the same. As long as there's only one device of this kind, connecting to its name shouldn't lead to any problems, or would it?
No because there are too many changes required in the server and client to implement this and its not particularly useful for most people