Setting up OpenThread with the SLZB-MR01 key

Hello,

I am trying to enable Matter with the SLZB-MR01 key but there are things I don’t understand.

To begin, here’s what I did:

The Thread Border Router is not recommended with PoE:
https://www.reddit.com/r/MatterProtocol/comments/1hl34i0/comment/m3js1kf/

I therefore don’t want to use the Thread Border Router with the SLZB-MR01 and depend on an Apple TV or another device that I don’t control.
For this I want to use OpenThread.
The SLZB-MR01 will be used only for the Thread radio.

For installing OpenThread on a VM that has its network configured in IPv4 and IPv6:

Installing OpenThread with Docker following this tutorial:

For the part about enabling IP forwarding:
I recommend downloading the file and modifying the interface name (By default wlan0) to the interface that is used, in my case ens18, and running the command « bash setup-host »

The OpenThread image does not work with TCP but a fork was made to be compatible with the TCP protocol since we connect the SLZB-MR01 over the network:
https://www.reddit.com/r/homeassistant/comments/1p73d9k/openthreadborderrouter_truenas_scale_docker/

Here is the docker-compose.yml file I created:

services:
  otbr:
    image: bnutzer/otbr-tcp
    network_mode: host
    restart: unless-stopped
    privileged: true
    cap_drop:
      - NET_ADMIN   # Should prevent iptables/ipset updates
      - NET_RAW     # No raw network access
    devices:
      - /dev/net/tun
    environment:
      - RCP_HOST=IP_DU_SLZB-MR01
      - OTBR_THREAD_IF=wpan0
      - OTBR_BACKBONE_IF=ens18
      - OTBR_WEB_ENABLE=1
      - OTBR_REST_LISTEN_ADDRESS=127.0.0.1
    volumes:
      - ./otbr-data:/var/lib/thread

Then I was able to connect to the OpenThread web interface on port 8080.
And this is where I don’t really understand anymore :sweat_smile:
When I go to Join, I have several Thread networks available:

image

I don’t know what these 3 networks correspond to, unfortunately.
I couldn’t link them to the SLZB-MR01 key because I can’t find a hardware address on the key’s web interface and nothing matches on the key’s label.

Can you help me clarify this please? :slight_smile:

Hi @prohand,

Nice work on your investigation :slight_smile:

I’m not an expert on the subject, I’ve never tested OpenThread so you’re further along than I am on this.

In my opinion, the 3 Thread networks you see in the « Join » interface are probably existing Thread networks detected in your environment (neighbors, other Thread devices, etc.).

You don’t need to « join » an existing network, you want to create your own Thread network. Instead go to the « Form » tab to create a new Thread network.

Do you see anything in the logs?

I don’t see much in the logs :frowning:
Actually I wouldn’t want the key SLZB-MR01 to already have a network created but maybe that’s not important ^^
I’ll try to look into the issue again early next week
In the meantime, if we have people who know the subject a bit I’d appreciate some help :slight_smile:
Thanks in advance

1 Like

I tried to get OpenThread to work with the key without success so far.

I have the impression that OpenThread is not communicating properly with the key or there’s something I don’t understand :sweat_smile:

I created an issue on docker-otbr-tcp: GitHub · Where software is built

1 Like

For the Docker part on OpenThread I had to run the following commands in the container to resolve issues with ipset:

ipset create otbr-ingress-deny-src-swap hash:net family inet6
ipset create otbr-ingress-allow-dst-swap hash:net family inet6
ipset create otbr-ingress-deny-src hash:net family inet6
ipset create otbr-ingress-allow-dst hash:net family inet6

After discussions with ChatGPT :blush:, it turns out you need to use chip-tool:

image

On the host machine I did a snap install chip-tool and then I ran the following command:

chip-tool pairing code 1 "code_sur_appareil_a_ajouter" --trace_decode 1

I’ll test the pairing tonight since I’m remote at the moment

1 Like

Well, this looks more complicated than I thought :sweat_smile:

I haven’t been able to pair my Thread hardware on OpenThread.
I tried with chip-tool but I feel like I’m missing information/understanding.
I tried with the Matter server of HAOS but there too I couldn’t get the pairing to work.

I managed to get something working by installing HAOS and the whole Matter and OpenThread stack directly in HAOS by scanning the QR code via the Home Assistant app.

I can’t reproduce the behavior of the Home Assistant app, whether it’s with chip-tool or directly with my phone.

If anyone comes across this and can help, I’d appreciate it :slight_smile:

In the meantime I’m looking into integrating it directly via the Apple Home Thread network and having it show up in Gladys, knowing that my Apple network is not on the same VLAN as Gladys :slight_smile:

Edit: I think I’ve understood something :sweat_smile:
I’ll test tonight and let you know :blush:

1 Like

Actually, pairing on the Thread network must be done with a device that has Bluetooth and with an application that allows joining the Thread network and entering the dataset and the payload.

On iOS there is no application that allows doing this except with the Home Assistant integration, but it is not possible to use it in our case because it is dedicated to Home Assistant.

So you need to have a dongle or a Bluetooth card connected to the machine where you run chip-tools.

On my side it is a virtual machine under Proxmox, so I forwarded the Bluetooth card directly to the VM.

So I did the following:

snap install chip-tools
apt install bluez

Then retrieve the dataset from your OpenThread docker with the following command:

sudo docker exec -it openthread-otbr-1 sh -c \"sudo ot-ctl dataset active -x\"

Then retrieve the payload by scanning the label of your end device with a QR code app.
For me it was in the form: MT:XXXXXXXXXXX-XXXXXXX

On the machine where you installed chip-tools run the following command:

chip-tool pairing code-thread  \u003cnode-id\u003e \u003coperationalDataset\u003e \u003cpayload\u003e

Which gives:

chip-tool pairing code-thread 1 \u003cPayload\u003e \u003cMT:XXXXXXXXXXX-XXXXXXX\u003e

You will see the pairing start.
Unfortunately I’m still encountering a problem with the message below:

[1768945401.918] [26575:26599] [-] Unable to find PAA, err: src/credentials/attestation_verifier/DeviceAttestationVerifier.h:252: CHIP Error 0x0000004A: CA certificate not found, PAI's AKID: 40:97:46:A4:3D:7E:F1:51:B6:CD:D8:A0:9E:A4:76:FA:9B:DF:75:63
[1768945401.918] [26575:26599] [CTL] Error on commissioning step 'AttestationVerification': 'src/controller/CHIPDeviceController.cpp:1338: CHIP Error 0x00000020: Failed Device Attestation'
[1768945401.918] [26575:26599] [CTL] Failed verifying attestation information. Now checking DAC chain revoked status.

I’m currently looking into how to resolve this issue :wink:
I’ll keep you posted, hopefully soon :grinning_face:

I can reach the next step with the command:

chip-tool pairing code-thread \u003cPayload\u003e \u003cMT:XXXXXXXXXXX-XXXXXXX\u003e --bypass-attestation-verifier true --only-allow-trusted-cd-keys false

But I get the following errors:

[1768947207.598] [30741:30765] [CTL] Error on commissioning step 'ThreadNetworkSetup': 'src/controller/CHIPDeviceController.cpp:2995: CHIP Error 0x000000AC: Internal error'
[1768947207.719] [30741:30741] [TOO] Run command failure: src/controller/CHIPDeviceController.cpp:2995: CHIP Error 0x000000AC: Internal error

Solution found:

It was necessary to add hex: before the payload:

chip-tool pairing code-thread hex:\u003cPayload\u003e \u003cMT:XXXXXXXXXXX-XXXXXXX\u003e --bypass-attestation-verifier true --only-allow-trusted-cd-keys false

I now have my device on my OTBR :grinning_face: :

image

Now I just need to see how to add it to Gladys :smiling_face_with_three_hearts:

1 Like

Thank you very much for all your investigation @prohand, if we ever develop the OpenThread border router integration in Gladys at some point it will help us a lot!

2 Likes

Unfortunately I haven’t found how to integrate the device when it is connected to OTBR.

I think another component (matter-server) is needed if you want to fully simulate a HomePod mini or an Apple TV 4K, for example.
This includes all the integration work I did before with chip-tool and a Matter server which should probably allow me to integrate with Gladys Assistant.

I chose to use matterjs-server, which will succeed python-matter-server (It’s still in alpha/beta), but it’s the solution that will be used in the long run in Home Assistant:

There is just a bug with Bluetooth that I reported and which should be resolved within the week:

Any project can apparently use it, but you have to obtain Matter certification if you implement it eventually in Gladys Assistant:

I’ll keep you informed when I can test it once the bug is fixed on their side, hopefully within the week :slight_smile:

If you think I’m on the wrong track, feel free to tell me :slight_smile:

Edit:

I went with the Docker solution for myself, but we’ll have to see if it works and how to implement it in Gladys since it is not officially supported:

https://github.com/matter-js/matterjs-server/blob/main/docs/docker.md

Maybe like this directly in Gladys’ Docker:

1 Like

Hi @prohand!

Matter-js-server is based on Matter.js, it’s already the building block we use in Gladys :slight_smile:

So everything that matter-js-server does, Gladys can do! :smiley:

Can you describe how you plan to use matter-js-server?

I plan to use the commissioning mode with Bluetooth via that option in the matterjs-server interface:

image

I don’t know if you need any more info

Ok, it’s possible in Matter.js indeed but for now I haven’t developed that part :slight_smile:

Which device exactly would you be connecting?

So you’re still going to use OTBR? I’m having trouble understanding how the connection to an external Thread server works?

If you can, could you describe the complete process for me!

Basically when you start the commissioning process from the button I showed (Commission new Thread device), it will ask for the code printed on the end device and it will ask for the Thread network payload.

The Thread network payload can be found with this command on the OTBR:

sudo docker exec -it openthread-otbr-1 sh -c "sudo ot-ctl dataset active -x"

Then it will establish a connection to the Thread device over Bluetooth and link it with the OTBR

I’m not sure if that’s any clearer.

But I think the best thing is, once they’ve fixed the bug, I’ll show you the complete process with screenshots :slight_smile:

Ok, I’m interested in the complete process, yes!

I bought the famous Ikea Matter sensors, so today I tried to set up an OpenThread Border Router (OTBR) with the Thread network of my SLZB-MR01 dongle.

For now the OpenThread Border Router is active and connected to my SLZB-MR01 dongle.

I ran tests with python-matter-server and a bit with matterjs
Honestly it’s not simple…

I think that in the future there should be an OTBR in

1 Like

Thanks for your reply and I can confirm that it really isn’t easy :smiling_face_with_tear:
For now I haven’t made much progress for personal reasons, but within a week I should be able to give an update on my side :wink:

Anyway I’m giving up for today because after several hours and still no devices added… :sleepy_face: long live Matter!
for now I’m absolutely not impressed by this technology!!!

With an Apple TV or a HomePod it’s rather simple because everything is already integrated.

Here the difficulty is wanting to integrate and manage everything yourself without using proprietary equipment.

But we’ll get there, let’s not lose hope :sweat_smile:

1 Like