VirtualHere Server does not release USB?

I have a program on the VirtualHere server that (also) sends commands to a USB device. Note: Only only application will ever connect to a USB device at a time. I'm not trying to have simultaneous access to the device from more than one client.

This works until a VH client ever connects to a USB device via vhusbarm. Killing and starting vhusbarm does not seem to work. My only workaround is to restart the entire server.

This blocks not only access to device that was opened, but to any USB device on the server. This uses the hidapi (https://github.com/libusb/hidapi) and hd_init() fails before it ever accesses the device. Perhaps there a better library to use or someway to reset vhusbarm?

Perhaps there is some workaround I can do before and after the call to my application (e.g., stop vhusbarm with some special option (disconnecting any vh clients), run the app, and then start vhusbarm).

Thanks!

#2

Try this:

1. Stop and exit the vhusbdarm process
2. Edit the config.ini file and add the line

AutoAttachToKernel=1

3. Start the vhusbdarm process again

Now when you stop using the device, it will reattach itself to the host machine and be usable there

#3

That works, thanks! I now see the other articles in support on this (now that I know what to look for).

Is there any way for the server to bump a client off a device?

Worst case I can stop the server process and then start it up again when the sever is done with the device, but that is a bit crude.

#4

Yes you can bump a client of a device (via another client) by starting one of the clients with the -a argument (for administrator)

e.g

vhui64.exe -a

then right click on an "In-Use" device and select "Disconnect from User"

#5

I'm hoping to do that programmatically.

Could I use vhui64.exe -a -t "STOP USING,id"?

#6

Yes you can do that, no -a required

#7

I tried all of the following and got back FAILED when the remote mac client had server.113 in use (and verified via list)
- STOP USING,server.113
- STOP USING,113
- STOP USING ALL

This failed on the local when the device was free
- USE,113
- USE,server.113

Surprisingly, these worked:
- DEVICE INFO,113
- DEVICE INFO,server.113

Server is a raspberry pi that runs vhusbdarm (and now vhclientarmhf)

I also tried the use and stop using commands on the Mac and they failed as well.

#8

Is the mac client, auto-using the device? If so it will recapture it again even if it is kicked.

#10

OK when you use STOP USING you need to pass the correct address of the device to stop using it. Im thinking SERVER.113 might not be the correct address

Could you post the output of LIST when the mac client is using the device so i can see the address (the value in the brackets)

#12

Here you go.

Note that STOP USING ALL says OK, but fails to release it.

I get similar results running these commands on the client that is using the device.

$ sudo ./vhclientarmhf -a -t list
VirtualHere Client IPC, below are the available devices:
(Value in brackets = address, * = Auto-Use)

Raspberry Hub (quadusb:7575)
--> AmpliFire (quadusb.113) (In-use by:XXX (xxx) at 10.0.0.233)

Auto-Find currently on
Auto-Use All currently off
Reverse Lookup currently off
Reverse SSL Lookup currently off
VirtualHere Client is running as a service

$ sudo ./vhclientarmhf -a -t "STOP USING,113"
FAILED
$ sudo ./vhclientarmhf -a -t "STOP USING,quadusb.113"
FAILED
$ sudo ./vhclientarmhf -a -t "STOP USING ALL"
OK

$ sudo ./vhclientarmhf -a -t list
VirtualHere Client IPC, below are the available devices:
(Value in brackets = address, * = Auto-Use)

Raspberry Hub (quadusb:7575)
--> AmpliFire (quadusb.113) (In-use by:XXX (xxx) at 10.0.0.233)

#13

Works fine for me. Have you purchased virtualhere? You cant use the console client without purchasing the server.

(Also note you dont need to use the -a argument on the command line to kick a user.)

See this log from my test setup, kicking a mac off an iLok on readynas.11:

michael@ubuntu:~$ ./vhclientx86_64 -t "LIST"
VirtualHere Client IPC, below are the available devices:
(Value in brackets = address, * = Auto-Use)

Synology Hub (DiskStation:17570) 
   --> STORE N GO (DiskStation.21) 
ReadyNAS Hub (readynas:7575) 
   --> iLok (readynas.11) (In-use by:Michael Broadfoot (michael) at 192.168.1.211)
CloudHub_00298f (CloudHub_00298f:7575) 
QNAP Hub (QNAP:7575) 
   --> iLok (QNAP.11) 
ASUSTOR Hub (ASUS:7575) 
   --> STORE N GO (ASUS.44) 
CloudHub_GLMT300NV2 (CloudHub_00c662:7575) 
   --> STORE N GO (CloudHub_00c662.11) 
Main Server (SERVER:7575) 
   --> Token JC (SERVER.72) (In-use by: (michael) at 192.168.1.233)
MyCloud PR4100 (MyCloudPR4100:7575) 
   --> WIBU-BOX/U (MyCloudPR4100.13) 
MyCloud EX2Ultra (MyCloudEX2Ultra:7575) 
   --> RTL2838UHIDIR (MyCloudEX2Ultra.11) 

Auto-Find currently on
Auto-Use All currently off
Reverse Lookup currently off
Reverse SSL Lookup currently off
VirtualHere Client is running as a service
michael@ubuntu:~$ ./vhclientx86_64 -t "STOP USING,readynas.11"
OK
michael@ubuntu:~$ ./vhclientx86_64 -t "LIST"
VirtualHere Client IPC, below are the available devices:
(Value in brackets = address, * = Auto-Use)

Synology Hub (DiskStation:17570) 
   --> STORE N GO (DiskStation.21) 
ReadyNAS Hub (readynas:7575) 
   --> iLok (readynas.11) 
CloudHub_00298f (CloudHub_00298f:7575) 
QNAP Hub (QNAP:7575) 
   --> iLok (QNAP.11) 
ASUSTOR Hub (ASUS:7575) 
   --> STORE N GO (ASUS.44) 
CloudHub_GLMT300NV2 (CloudHub_00c662:7575) 
   --> STORE N GO (CloudHub_00c662.11) 
Main Server (SERVER:7575) 
   --> Token JC (SERVER.72) (In-use by: (michael) at 192.168.1.233)
MyCloud PR4100 (MyCloudPR4100:7575) 
   --> WIBU-BOX/U (MyCloudPR4100.13) 
MyCloud EX2Ultra (MyCloudEX2Ultra:7575) 
   --> RTL2838UHIDIR (MyCloudEX2Ultra.11) 

Auto-Find currently on
Auto-Use All currently off
Reverse Lookup currently off
Reverse SSL Lookup currently off
VirtualHere Client is running as a service
michael@ubuntu:~$