espressif / esp-matter

Espressif's SDK for Matter
Apache License 2.0
692 stars 156 forks source link

Wifi switch can't reach the Thread light (CON-1117) #897

Closed Eliostrim closed 6 months ago

Eliostrim commented 7 months ago

Hello there, i'm trying to use a wifi switch to control a thread light with Matter, and I am facing some issues. Everything works fine from Wifi light switch to Wifi light (Using 2x ESP32-C3) or Thread light switch to Thread light (Using 2x ESP32-H2), so i suppose the "commissioning", "binding" and "accesscontrol" commands work fine for these setups.

When trying to do the same with Wi-Fi light switch and Thread light, it seems like the communication times out. Here is the configuration I am using:

(I am using my phone as the Wi-Fi hotspot between the light switch and the border router)

image

But when i'm trying Wifi to Thread, the switch answer a timeout and doesn't find the node:

I(1496772) app_driver: Toggle button pressed
I (1496972) chip[DIS]: Checking node lookup status after 200 ms
E (1527772) chip[DIS]: Timeout waiting for mDNS resolution.
I (1541772) chip[DIS]: Checking node lookup status after 45000 ms
E (1541772) chip[DIS]: OperationalSessionSetup[1:0000000000005164]: operational discovery failed: 32
E (1541782) chip[SVR]: Failed to establish connection to node 0x0000000000005164

But when i use some pings :

Environment

wqx6 commented 7 months ago

Looks like there are some issues on the delegated mDNS service corresponding to the SRP service registered by the Thread End device.

Could you run the command avahi-browse -rt _matter._tcp and capture the mDNS packets to confirm that the delegated mDNS service is advertised by the Thread BR? Please attach the packet capture file, thanks.

Eliostrim commented 7 months ago

Hello, thanks for your answer, i actually just found a way to make it work:

I retried the comissioning on the thread device, and it seems like the accesscontrol command did not work the first time (may be because I tried to use this command during the bluetooth comissioning ?)

When I retried a new accesscontrol commannd, it worked properly.

wqx6 commented 7 months ago

I noticed that in the log of OTBR, you started thread network before you connected otbr to Wi-Fi network. And the fist SRP service registration failed (But the following registration succeed). I am not sure whether this caused this issue. Could you try to start Thread network after connecting to Wi-Fi?

Eliostrim commented 7 months ago

Yes, you're right. Because of that fail, the thread device become hard to commission because it don't want to connect to the border router. This is that why the accesscontrol command didn't work.

So, when i connect the wifi before thread, it's work fine.

To not make this mistake anymore, i use the menuconfig from idf.py (command idf.py menuconfig), and i configure the border router to automaticaly connect to the wifi and thread.

(OpenThread Border Router Example -> Enable the automatic start mode in Thread Border Router. Example Connection Configuration -> Change Wifi SSID and Wifi password)

Now, all works properly even if I unplug and replug the power.

Thank you for your answer and your help ! (and sorry for my english)