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!
.
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
.
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.
.
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"
I'm hoping to do that
I'm hoping to do that programmatically.
Could I use
vhui64.exe -a -t "STOP USING,id"
?.
Yes you can do that, no -a required
I tried all of the following
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.
.
Is the mac client, auto-using the device? If so it will recapture it again even if it is kicked.
I tried with auto use on and
I tried with auto use on and off, both failed.
.
OK when you use
STOP USING
you need to pass the correct address of the device to stop using it. Im thinkingSERVER.113
might not be the correct addressCould 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)I can post the list later,
I can post the list later, but the DEVICE INFO command worked.
.
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)
.
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: