HASSOS in Hyper-V - Is it possible to install USB Rediector or something similar for USB support?

Thanks to everyone contributed to this thread (especially @aceindy ), I can confirm the Netburner works.

A couple of tips if you want to go down this route:

1_ The port that you are trying to communicate on with the Netburner should be opened on windows firewall. This is one of those simple tasks that you do not pay attention to and it gives you a painful headache :slight_smile:

2_ As it has been mentioned above the virtual port should be created as a server. Also make sure that you use the correct USB Com port. In my case it was on Com4 .I attached a screenshot of mine. Hope that helps

3_ Most definitely you will see some issues with regards to communication between different components, make sure you look at this URL before anywhere else (well, I am talking about the zigbee2mqtt to be more specific): https://www.zigbee2mqtt.io/information/FAQ.html#help-zigbee2mqtt-fails-to-start

1 Like

@aryankids Great to hear it works.

Btw…you can also use telnet on the TCP port to monitor any activity; nice for testing :wink:

Still working stable with Netburner?

For me yes…no stability issues whatsoever :yum:

How did you find which COM port to use? By me also by devices it says by other devices, no drivers installed. Is that normal?

Guys do i need to install first some drivers for CC2531 on Windows before use netburner or other apps like that?

@Himdola Yes, if I remember correctly, the CC2531 needs to be flashed --> https://www.zigbee2mqtt.io/information/flashing_the_cc2531.html

After that it will be visible as an ordinary serial port in the device list:
image

So I shared com8 with netburn over tcp port 5008,
and configured zigbee2mqtt’s serial port as:

  "serial": {
    "port": "tcp://192.168.1.18:5008"
  },

(share/zigbee2mqtt/configuration.yaml)

I did already flashed that but windows can’t find any drivers for it.

afbeelding

Hmm…yeah I remember vaguely some people having issues…
I believe my drivers came along with the flashing software, but maybe try one of these ??

For anyone trying to flash a CC2531 with TI SmartRF Flash programmer software and a smartRF04 programmer, you may need the updated 64-bit windows drivers (swrc212a.zip):
SWRC212 Driver or library | TI.com
(how to flash the CC2531 · Issue #3 · zigbeer/zigbee-shepherd · GitHub)

or

or
CC2531EMK: windows 10 creators update driver - Zigbee & Thread forum - Zigbee & Thread - TI E2E support forums

1 Like

see…i did answer this question before :yum:

Yes, but found different sensors drop frequently when they are a bit far away from the USB stick. So I changed the plan as of last night and put a tasmotised Zigbee-wifi hub. Now ALL the sensors provide their data happily without any interruption!

Thank you very much! I know this is an old thread, but i’m new to HA. Now i’m able to connect my Sonoff Zigbee USB device (cost me only 8 EUR, pretty cheap IMO). My initial fault was creating virtual COM port instead of real. Now i must think of a way to passthrough bluetooth to my Hyper-V HASS installation. Maybe anyone succeded with that? I mean, i could use ESP32 as a bridge but at the moment i’m unable to purchase one, but i do have full Windows Server installation with Hyper-V running. Maybe there is a windows bluetooth to mqtt software? So far i didn’t find any.

Hello Guys,
i cant get this to work with netburner.
The Connection is up and running but i get an error while starting zigbee2mqtt.

Ports on Windows Firewall are opened.
COM 4 is the correct one.

Im using a Shaesh’s CC2652RB.

Any suggestions ?



image

1- how does you configuration in zigbee2mqtt look like? Please paste your config…
2- Can you connect with telnet from another machine?
telnet <ip address of host> 5656

im not that familiar with telnet.
if i try to connect my shell looks like that


and netburner shows 2 connections.

data_path: /share/zigbee2mqtt
external_converters:
devices: devices.yaml
groups: groups.yaml
homeassistant: true
permit_join: true
mqtt:
base_topic: zigbee2mqtt
server: mqtt://10.0.0.249:1883
user: xxxxxx
password: xxxxxxxx
serial:
port: tcp://10.0.0.250:5656
advanced:
log_level: info
pan_id: 6754
channel: 11
network_key:
- 1
- 3
- 5
- 7
- 9
- 11
- 13
- 15
- 0
- 2
- 4
- 6
- 8
- 10
- 12
- 13
availability_blocklist:
availability_passlist:
device_options: {}
blocklist:
passlist:
queue: {}
frontend:
port: 8099
experimental:
new_api: true
socat:
enabled: false
master: pty,raw,echo=0,link=/dev/ttyZ2M,mode=777
slave: tcp-listen:8485,keepalive,nodelay,reuseaddr,keepidle=1,keepintvl=1,keepcnt=5
restartdelay: 1
initialdelay: 1
options: ‘-d -d’
log: false
input:

  • ImExPS/2 Generic Explorer Mouse
  • AT Translated Set 2 keyboard
  • QEMU QEMU USB Tablet
  • Power Button
    disk:
    gpio:
    usb:
  • /dev/bus/usb/001/001
  • /dev/bus/usb/001/002
  • /dev/bus/usb/002/001
  • /dev/bus/usb/002/002
  • /dev/bus/usb/003/001
    audio: {}

apparently it looks ok…but yaml indentation is wrong, in fact there is no indentation at all :thinking:

It should have 2 spaces in front of tcp:

serial:
  port: tcp://10.0.0.250:5656

I am also a little confused about the input section? What is the part below log doing?
I don’t have that….

This is mine:

data_path: /share/zigbee2mqtt
external_converters: []
devices: devices.yaml
groups: groups.yaml
homeassistant: true
permit_join: false
mqtt:
  base_topic: zigbee2mqtt
  server: mqtt://192.168.1.2
  user: xxxxxx
  password: xxxxxx
serial:
  port: tcp://192.168.1.8:5005
advanced:
  log_level: debug
  pan_id: 6754
  channel: 11
  network_key:
    - 1
    - 3
    - 5
    - 7
    - 9
    - 11
    - 13
    - 15
    - 0
    - 2
    - 4
    - 6
    - 8
    - 10
    - 12
    - 13
  availability_blocklist: []
  availability_passlist: []
device_options: {}
blocklist: []
passlist: []
queue: {}
frontend:
  port: 8099
experimental:
  new_api: true
socat:
  enabled: false
  master: pty,raw,echo=0,link=/dev/ttyZ2M,mode=777
  slave: tcp-listen:8485,keepalive,nodelay,reuseaddr,keepidle=1,keepintvl=1,keepcnt=5
  options: '-d -d'
  log: false

oh, btw, telnet looks :+1:t4:

According github, some managed to get it working by re-flashing the stick:

1 Like

Hi,

Just to say that Virtual Here is perfectly running here (that’s a low-cost option, but not free) : HA Supervised on Debian 11, in Hyper-V Win Server 2019. Aeotec and Conbee plugged to a RPI.

I just carefully followed procedures on the VH website, and made it all work at first try. Didn’t believe my eyes, especially after reading the many comments about the difficulties.

There is a pretty good article regarding USB over IP solution for HA on Hyper-v:
https://dvlup.com/2020/10/23/usb-in-hyper-v/

Two usbip software were mentioned in the article: USB Network Gate ($159) and USB Redirector ($74). I also found a slightly cheaper one called VirtualHere ($49). I tested VirtualHere and it also works. Note that VirtualHere has a “node-locked” license that you cannot transfer to a different computer.

Now understood the concept and I start searching for a “FREE” solution (right, assume my time is free). And I did come up with a free solution. The only negative part is that the host windows OS has to run in Test Mode as the driver is self signed. In my use case I have an Intel NUC running Hyper-V and WSL2. A Zwave/Zigbee stick is plugged in the local NUC USB port.

And Here is the procedures:

  1. Install Debian 11 in Hyper-V

  2. Install Supervised HA on Debian

  3. Build uspip windows server
    3.1 Get the source code from github: https://github.com/cezanne/usbip-win. This is usbip server side driver and daemon.
    3.2 Set up the build environment (Visual Studio 2019 Community Edition, Windows DDK, etc)
    3.3 Build the binaries from the source
    3.4 install certificate (follow instructions on github)
    3.5 run command: “usbip list -l”, determine which usb device to bind
    3.6 bind the device and start daemon: usbipd

  4. Configure Debian usbip client
    4.1 enable usbip module: modprobe vhci-hcd
    4.2 attach usb over ip: usbip attach -r {host_ip} -b {bus_id}
    4.3 run command: “usbip port” to confirm usb device binds successfully

  5. In HA UI confirm the new device discovery. Test to make sure everything works (I did one z-wave switch inclusion and use that to test z-wave function)

  6. Now everything works we need to steamline the process
    6.1 Configure the Debian VM to remain off upon host start, and shutdown upon host shutdown
    6.1 In windows, launch Task Scheduler, create new task, set trigger to “run at logon”. Check “run at highest privilege”
    6.2 Add action to bind the usb device: {your_path}\usbip bind -b {bus_id}
    6.3 Add action to launch usbipd and dettach: powershell Start-Process -FilePath ‘{your_path}\usbipd.exe’ -ArgumentList ‘-d -4’
    6.4 Add action to start VM: powershell Start-VM ‘{your_VM_name}’
    6.5 by doing above we guarantee the VM only starts after usbipd is already running. You need to run usbip using powershell Start-Process and do not call the exe directly. otherwise it will run a infinite loop and you can never pass that step and proceed to start the VM.
    6.6 In Debian create a usbip.conf in /etc/modules-load.d to auto load module
    6.7 In Debian create a service to auto load “usbip attach …” after network-online, enable service by systemctl enable usbip.service

  7. Restart the system. by design the VM should shutdown when system is restarted. Upon logon, the task scheduler sequentially starts usbip binding, launches usbipd daemon and starts Debian VM. Inside Debian VM the vhci-hcd module gets loaded and the usbip service gets called to attach the remote usb device. Once HA core gets loaded we should have a fully functional system. Now we can finally sit back and enjoy the home automation.

If you use a RPI as server then you actually don’t need any commercial software. Linux has open-source support for usb over ip on both client and server side.

On RPI side, you do “modprobe usbpi-host” then “usbip bind -b {device_id}”, and start the damenon “usbipd -d”

On VM side, you run “modprobe vhci-hcd”, and attach usb device by “usbip attach -r {your_RPI_ip} -b {device_id}”.

You might have to install the usbip through apt-get and do an update and upgrade of apt-get.

I know this solution works because I am writing this post in the Debian VM on Windows Hyper-V (Ethernet), using a keyboard attached to a RPI 3B+ (Wifi). Honestly it just feels really cool (and weird) …