Matter-over-thread commissioning issue with GL.iNet S200

Hello everyone

I am very new to Matter/Thread, but excited to try it all out, so I bought an Eve Energy smart plug and a GL.iNet S200 Thread Border Router (TBR).

I added the TBR to a fresh installation of HA OS (2024.2.3) on a RP4, and it was directly recognized. I also got the thread credentials from HA onto the companion app on my android phone.

With this installation, the following things work:

  • add matter/wifi devices
  • ping4/6 from phone to HA and reverse
  • ping6 from phone to the OMR address of the TBR
  • ping6 from HA to the OMR address of the TBR

With all this working, I am assuming that all the network prerequisites are met.

Yet, when I want to add the Eve Energy using the companion app, this happens:

  • I get “Searching for device…”
  • I get “Connecting to device…”
  • I get “Generating Matter credentials…”
  • I get “Checking network connectivity…”, where it finally fails with “Can’t reach device”.

I do not know how to debug from here. The S200 is based on OpenWRT and I have webUI, luci, and SSH access, so if necessary, I can get more information.

I already posted the issue on the GL.iNet forum, where it was suggested that HA is not fully 3rd-party TBR compliant. Hence, this post here.

Any help is greatly appreciated. Thanks!

2 Likes

The network requirements also include having the phone, HA and the matter server on the same network, so if you are using VLANs or have split your network up in any way, then you might need to flatten it.

Regarding the thread credentials, then it is important to try to import them a second time to see if it again says it has copied the credentials or if it says that HA and thread is using the same credentials.
The last one is the successful one and the first one means you will have to clear your Google Play Services cached data.

Thank you for you reply.

I am using a flat single-vlan structure. That should not be an issue.

The second part seems more interesting. Whatever I do, I always get “Sync Thread credentials [green checkmark] Updated network from Home Assistant on this device” when I try to sync the credentials on the phone via Settings>Companion App>Troublshooting>Sync Thread credentials.

Also, if I use “import credentials” in Devices&Services>Thread>configure, I always get “You don’t have any credentials to import.”.

The above does not change if I do any of the below:

  • clear the cache of Google Play Services
  • use “Used for Android + iOS credentials” in Devices&Services>Thread>configure>3-dots settings
  • both of the above

I tried all of the above also with Google Home installed (which is normally not the case, and I want to avoid this if possible), but most of my testing was done without Google Home being installed.

EDIT: reading helps
Maybe for my understanding, what is the difference between syncing the credentials using Troubleshooting and using the Thread service settings? Also, what does “Used for Android + iOS credentials” actually do?

Thank you!

WallyR, thanks for the link. I still didn’t get the credential-sync to work on my phone (I’m investigating what the issue is), but using my wife’s phone, I got the right message after syncing the thread credentials the second time. However, I am still getting the same issue when trying to commission the thread device, where it fails at the step “Checking network connectivity…”.

EDIT: I actually also got my phone to correctly get the thread credentials from HA, but I had to delete all data of Google Play Services and not just the cache. Still the same issue though.

I had a fight at that point too and I only got it to work by disabling my DHCP-PD IPv6 network and only run with auto-generated fe80 addresses on all devices.
HA seems poorly lacking in IPv6 configuration and performance setups.

1 Like

Hello, I had similar issues when trying to add devices with companion app.

I had a whole topic connectivity issues.

It turns out it fails because of Multicast dns wich is required to run any Eve devices.

In short : use apple eco system and it will work at first try :slight_smile: .

I am not an apple user so i found a solution, but it requires you to buy a 2€ bluetooth module somwhere and follow this guide :

To summerize the guide to as follow :

1: Copy the string contained in ‘Active dataset TLVs’

(Settings → devices & services → Thread → Configure → little i)

2: In network tab of HA, find it’s IPV4 adress and modify the following code with your dataset and ip adress:

Résumé
var socket = new WebSocket("ws://192.168.2.130:5580/ws");
socket.addEventListener("message", (event) => {
    console.log("Message from server ", event.data);
});

socket.addEventListener("open", (event) => {
    console.log("WebSocket is open");
    var message = {
        "message_id": "1",
        "command": "set_thread_dataset",
        "args": {
            "dataset": "0e080000000000010000000300000b35060004001fffe0020823890fd24ab1fb3d0708fd32b595bafdd8d30510d4b788583c85b27e2463f14f248fe94b030e686f6d652d617373697374616e74010263e30410bbe3fea1a3a4db87a91b276b3aba21ca0c0402a0f7f8"
        }
    };
    socket.send(JSON.stringify(message));
});

3: Using F12 (in chrome) , run the command while being on HA (any page) on the console tab

4: Wait for the message “Message from server, message_id=i, result = null”

5: Get your code on the matter qr code and modify the below code with it (and dataset and IP) :

Résumé
var socket = new WebSocket("ws://192.168.2.130:5580/ws");
socket.addEventListener("message", (event) => {
    console.log("Message from server ", event.data);
});

socket.addEventListener("open", (event) => {
    console.log("WebSocket is open");
    var message = {
        "message_id": "2",
        "command": "commission_with_code",
        "args": {
            "code": "33976113343"
        }
    };
    socket.send(JSON.stringify(message));
});

6: Send the command, and wait for the server to add the device, it should return the device credentials.

Apologies for the late reply @WallyR @Pierre84000. Thank you both for your answers. I looked into both methods, and I will comment on each method below.

@WallyR It took a while to test your suggestion, because network-tinkering with even the shortest offline time is typically met by strong opposition from several family members, so I needed to find an appropriate time slot.
Your method lead to a success. I was able to add the Eve Energy to the thread network and matter using HA and the S200. It was actually even a smooth experience, and also the current/voltage/power/energy readings worked out-of-the-box.
However, I managed to do this only by completely disabling the native IPv6 which I get from my ISP. While this worked, it is not a permanent solution for me, as this impacts the operation of other services on my home server too much. I got all this to work on HA and the matter-server running in docker containers on my Arch Linux server. I am happy that this is working, as I want everything to run on my one server, instead of having multiple RP4s floating around in the house for all kinds of services. That is why I did not even try this on the test installation on the RP4 I mentioned earlier.
In any case, before I got started with HA/matter/thread, I read about the network prerequisites, in particular with respect to IPv6, and tried to meet all of them. In fact, I think everything IPv6 is set up correctly, but the “solution” was to disable IPv6, so, I was somewhat disappointed.
@WallyR this is by no means a complaint to you, on the contrary, I am happy you lead me to a “solution”, so thank you again. This is rather a confirmation of what you said in your last message about IPv6+HA.
If there is any way to get this to work while IPv6 is enabled, I would greatly appreciate any input and I can help by providing logs, etc.

@Pierre84000 Thank you too for you message. I tested this, too, but things failed very early. I actually tested this first (because it does not require network interruptions), and I tried this one on the HASS OS test server on the RP4 (all up-to-date).
As it turns out, I cannot connect to HA OS on ws://IP:5580/ws. I suspect that the current version of the HA OS on the RP4 does not allow access on that port outside of localhost? I guess I can allow this via iptables, but as the other solution worked, I did not investigate any further. Also, I only used the RP4 (with bluetooth) for testing, my goal is to use HA on my home server (without bluetooth).

HA seems to lack quite a lot in the IPv6 support, so it becomes a road block for the IPv6 transition.
I have been thinking about making a feature request for a “Year of the IPv6”.

3 Likes

I would second that.