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

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) …

Haha ok, thanks a lot Dalong… I missed that part, despite so much readings and searches on the web.

This sounds so logical. I was very surprised not finding any free solution in the HA world.

I hope (many) others will find your post here and spare 50€ (one time fee, which is correct for the VH solution, unlike other where you ca pay a lot every year or so).

Thanks again,

Michel

You are welcome Michelob1.

I was also looking for the solution (when realize Hyper-V does not support USB path-through). I read that usbip is built into the linux kernel from 3.17 and for a while I only used the usbip client in Linux (and usbip server on windows). But then I saw quite a few people talking about using RPI as the usbip server and thought I might give it a try (since I remembered linux support both client and server). I have a old RPI 3B+ laying around and initially there was binding issues (after enable usbip-host). It turned out to be mismatch between kernel and usbip tools. After I did apt-get update & upgrade it finally binds and works.

Unfortunately there is no true free solution on Windows platform. This is niche market and vendors don’t mind charging a hefty price. Being a node locked license means I cannot easily migrate to a different computer, plus I almost have no use of usbip software out of this particular scenario. The closest I could find is open source driver that requires one to build and self-sign to use on Windows in Test Mode. Currently I am going through this route. If I finally decide to migrate everything to HA platform (I am currently on Hubitat and have 15+ Zwave, 10+ Zigbee, 15+ Wifi devices and handful of Lutron Pico remotes) I might spend extra $50 for VirtualHere solution. But for now I am fine with the test mode driver.

@aceindy Does the netburner still works?
I just got the Sonoff Zigbee dongle. Firmware updated.
My setup is HA 2022.6.6 running HASSOS 8.2 in a hyper-v VM. Server OS is WS2019 where I have the dongle installed. Running Z2M locally on the WS2019 with NPM, it works using the COM port, so the dongle works.
But running either locally on the server or as addon in HA using the netburner adress, it fails.
From Log:

 2022-06-20T17:05:00.868Z zigbee-herdsman:adapter:zStack:znp:log Opening TCP socket with 192.168.0.250:5656
 2022-06-20T17:05:00.881Z zigbee-herdsman:adapter:zStack:znp:log Socket connected
 2022-06-20T17:05:00.881Z zigbee-herdsman:adapter:zStack:znp:log Socket ready
 2022-06-20T17:05:00.882Z zigbee-herdsman:adapter:zStack:znp:log Writing CC2530/CC2531 skip bootloader payload
 2022-06-20T17:05:00.882Z zigbee-herdsman:adapter:zStack:unpi:writer --> buffer [239]
 2022-06-20T17:05:01.884Z zigbee-herdsman:adapter:zStack:znp:log Skip bootloader for CC2652/CC1352
 2022-06-20T17:05:01.885Z zigbee-herdsman:adapter:zStack:znp:SREQ --> SYS - ping - {"capabilities":1}
 2022-06-20T17:05:01.886Z zigbee-herdsman:adapter:zStack:unpi:writer --> frame [254,0,33,1,32]
 2022-06-20T17:05:07.888Z zigbee-herdsman:adapter:zStack:znp:SREQ --> SYS - ping - {"capabilities":1}
 2022-06-20T17:05:07.889Z zigbee-herdsman:adapter:zStack:unpi:writer --> frame [254,0,33,1,32]
 2022-06-20T17:05:13.895Z zigbee-herdsman:adapter:zStack:znp:SREQ --> SYS - ping - {"capabilities":1}
 2022-06-20T17:05:13.896Z zigbee-herdsman:adapter:zStack:unpi:writer --> frame [254,0,33,1,32]
 Zigbee2MQTT:error 2022-06-20 19:05:19: Error while starting zigbee-herdsman
 Zigbee2MQTT:error 2022-06-20 19:05:19: Failed to start zigbee
 Zigbee2MQTT:error 2022-06-20 19:05:19: Check https://www.zigbee2mqtt.io/guide/installation/20_zigbee2mqtt-fails-to-start.html for possible solutions
 Zigbee2MQTT:error 2022-06-20 19:05:19: Exiting...
 Zigbee2MQTT:error 2022-06-20 19:05:19: Error: Failed to connect to the adapter (Error: SRSP - SYS - ping after 6000ms)
     at ZStackAdapter.start (/app/node_modules/zigbee-herdsman/src/adapter/z-stack/adapter/zStackAdapter.ts:102:27)
     at Controller.start (/app/node_modules/zigbee-herdsman/src/controller/controller.ts:123:29)
     at Zigbee.start (/app/lib/zigbee.ts:58:27)
     at Controller.start (/app/lib/controller.ts:101:27)
     at start (/app/index.js:109:5)

From a client i’m able to telnet to the IP of the the netburner comport.

Config:

 data_path: /config/zigbee2mqtt
 socat:
   enabled: false
   master: pty,raw,echo=0,link=/tmp/ttyZ2M,mode=777
   slave: tcp-listen:8485,keepalive,nodelay,reuseaddr,keepidle=1,keepintvl=1,keepcnt=5
   options: '-d -d'
   log: false
 mqtt:
   base_topic: zigbee2mqtt
   server: mqtt://homeassistant
   user: user
   password: password
 serial:
   port: tcp://192.168.0.250:5656
 zigbee_herdsman_debug: true

Also to add: i can see in netburner that there is an active connection.
Any idea?

Thanks

Not sure if it helps, but i just switched to a ConBeeII stick, and it does not support serial2tcp, so i abandoned HyperV and use VMware nowadays….