HAOS on Xen: Workaround for Open Thread Border Router

Hi,

(No request for help, for documentation and cq. discussion)

Tried to get a Sonoff Zigbee 3.0 USB Dongle Plus V2 working as border device as described here.

One major difference with the guide (I assume) being that I run HAOS on Xen.

Changed various IPv6-related settings on Dom0 (net.ipv6.conf.all.forwarding = 1, net.ipv6.conf.all.accept_ra_rt_info_max_plen = 64, net.ipv6.conf.all.accept_ra = 2) and enabled IPv6 address on the bridge device.

Seemed to working fine at first, but I ran into issues when trying to add a device (Failed to send IPv6 UDP msg, Error decoding hdlc frame: Parse). Tried various tips from fora etc. etc
No success. My theory is that something in the combination of Xen and firewalld (and other network settings?) on Dom0 plus some HAOS-specifics prevent things from working.

As a workaround, I removed the OTBR add-on from HA and installed it in a docker on the Dom0 instead.

Got it working with the following steps (as far as I recall):

  • Keep the IPv6 settings mentioned above
  • When using firewalld, add the following to “your home zone” (for me the one with the NIC where the mobile for adding matter devices connects to)
<interface name="wpan0"/>
<service name="mdns"/>
<service name="dhcpv6"/>
<protocol value="ipv6-icmp"/>
<icmp-block name="packet-too-big"/>
<icmp-block name="neighbour-solicitation"/>
<icmp-block name="neighbour-advertisement"/>
<icmp-block name="router-advertisement"/>
<icmp-block name="router-solicitation"/>
<icmp-block-inversion/>
  • I am not sure about this one (). It’s needed for operating Thread devices, but somehow it was preventing new devices being added. Sounds strange and unexpected, I know. But as soon as it was removed, I could add more devices… Not bothering to further dive into this for now.

  • Found the following compose.yaml:

services:
  otbr:
    container_name: "otbr"
    image: "openthread/border-router:latest"

    network_mode: host
    restart: always

    privileged: true
    cap_add:
      - NET_ADMIN

    environment:
      - TZ=Europe/Amsterdam
      - OT_RCP_DEVICE=spinel+hdlc+uart:///dev/ttyACM0?uart-baudrate=460800
      - OT_INFRA_IF=xenbrX
      - OT_THREAD_IF=wpan0
      - OT_LOG_LEVEL=5
      - OT_REST_LISTEN_ADDR=0.0.0.0
      - OT_REST_LISTEN_PORT=9212

    volumes:
      - /home/docker/otbr:/data:rw

    devices:
      - /dev/serial/by-id/usb-ITEAD_SONOFF_Zigbee_3.0_USB_Dongle_Plus_V2_<ID>:/dev/ttyACM0
      - /dev/net/tun
  • Initialized the Thread network etc. (dataset init new etc.).
  • Connected HA with OTBR.

All devices added, works stable so far (few hours to be honest :)).

Hi there,
I saw you linked to my guide - you are more then welcome to post a comment there linking to this guide. I have no idea what Xen is, but hopefully it helps someone else.