Due to some issues I had with Proxmox, I am moving to Hyper-V 2019 as my new Hypervisor. As part of that, I need to figure out how to allow the OpenHAB VM to access my Aeotech Z-stick. I have seen people like @Bruce_Osborne say that they were able to pass the COM port through to the VM. Does anyone have experience with Hyper-V in getting the Z-wave Controller to work? BTW I plan to make my OpenHab VM an Ubuntu VM.
Thanks for the reply. So just to confirm, the Z-Stick is plugged into the server where the VM exists and you are able to pass it from the hypervisor to the VM without doing any kind of USB or Serial over IP?
The USB driver on the server presents the stick to the hypervisor as a serial port that can then be mapped to the VM. I understand you need to unmap it before shutting down the VM
Well I appreciate your responses. Iâm going to mess around with it and Ill let you know if I get stuck anywhere.
Does anyone have experience with the reliability of the few USB over IP solutions? I have seen people connect the Z-stick to a RPI and allow the VM to access it like this. Just not sure how reliable it is and if there is any lag.
Iâve been using this ever since i wrote the tutorial. The solution has never failed, worked flawlessly. Except for the rebootâs of Openhab or the machine itâs running on. Then you sometimes need to take some additional care of this setup. But once itâs running itâs running like a charm.
Since connected over the local netwerk this solution addâs maybe 1 or 2 ms additional latency to the z-wave traffic⊠you probably wont notice it at all.
Hey guys sorry for the delay in my response. I have been very busy getting my Hyper-V server up and running. So far its working well with OpenHAB. I will describe below how I was able to pass the Z-wave Controller through to the VM. I am using the Aeotec Z-stick Gen 5
Basically I created the named pipe and used a program called COMPipe to allow the VM to access it.
On Hyper-V, Download COMPipe from GitHub and save it to any directory on Hyper-V but remember where you save it cause youâll have to access it later.
I used this guide to make a named pipe on Hyper-V. Again, remember what you name your pipe. Also, if you changed the name of your VM, you might have to rename your pipe. The name of the pipe in the above guide is âdv0-com1â
On Hyper-V, enter powershell and enter this command: âGet-WMIObject WIN32_SerialPortâ. This will list all COM ports Hyper-v has and youâll need to identify which one the Z-wave Controller is using. Youâll want to look for something like âusb deviceâ and the manufacturer name. It shouldnât be hard to identify this. If you are unsure which device is your controller, then unplug all other USB devices other than the controller and re-run the command. Mine used COM3.
on Hyper-v navigate to where you saved the COMPipe utility in step 1. Exit powershell if youâre still in it by using âexitâ then you can use âcd âŠâ to go up a folder level, âcd [folder]â to go down a level, and âdirâ to list the subfolders in the parent folder youâre in. Once you find the COMPipe folder go inside it to bin/released/ and you should see COMPipe.exe in there.
Once you are in the âreleasedâ folder, run .\COMPipe and it will give you a couple examples on how to run a COMPipe command. mine looks like this: â.\COMpipe.exe -c \.\COM3 -p \.\pipe\OpenHAB-com1â. When you run it, it should give you a message that says something like âpipe opened successfully, press q to quitâ. Leave the command prompt window open on this page. if you press control-c it will exit the command and the Z-wave controller will no longer be accessible to the VM.
Youâll have to run that every time the VM reboots and I find it works best to run it very close to the time it reboots so the controller is present when OpenHAB comes up. If you boot the VM, run that command on Hyper-v and your controller still isnât showing in OpenHAB then try re-running the command in Hyper-v and if that fails, try rebooting the VM again and re-running the command during reboot.
Im sure there is a nice way to trigger running a Hyper-v command when a specific VM reboots but I havenât gotten that advanced yet. I hope this helps someone in the future!!
Hi,
Iâm trying to do similar however, I donât believe the device is starting. I used /dev/ttyS0 as the device path, could you tell me if yours was the same? Thanks
Please note that after creating the named pipe, you must Stop/Start your VM in order for the named pipe to take effect. This wasted a couple hours of my life