Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to perform commissioning of Controller (CON-1281) #1031

Closed
Shivi-6 opened this issue Jul 30, 2024 · 11 comments
Closed

How to perform commissioning of Controller (CON-1281) #1031

Shivi-6 opened this issue Jul 30, 2024 · 11 comments

Comments

@Shivi-6
Copy link

Shivi-6 commented Jul 30, 2024

Describe the question/query that you have
After flashing and monitoring the controller example onto my esp32-wrover-e kit, I am trying to commission the controller and connect it to Alexa but the procedure in https://docs.espressif.com/projects/esp-matter/en/latest/esp32/developing.html#matter-controller is not clear. How do I commission the controller and the end devices?

Additional context
I tried the following :

matter esp controller pairing onnetwork 0x7283 20202021

but this is the response I get :
Done
> E (263002) chip[DIS]: Timeout waiting for mDNS resolution.

@github-actions github-actions bot changed the title How to perform commissioning of Controller How to perform commissioning of Controller (CON-1281) Jul 30, 2024
@jonsmirl
Copy link
Contributor

In general you don't commission controllers, you commission devices. You are trying to hook two controllers together. Controllers send commands, devices receive them. It would make more sense if your controller commissioned a light bulb, and Alexa commissioned the same light bulb and then you both controlled it.

@Shivi-6
Copy link
Author

Shivi-6 commented Aug 6, 2024

Thanks for this clarification. But in the rainmaker matter controller example, the readme says "The commissioning flow for Matter Controller would be the same as other Matter devices. The controller will get node NOC (Node Operational Certificate) during Matter commissioning process."
Based on this, I tried commissioning the matter controller after removing amazon echo dot so that only one controller is added and not two.

@dhrishi
Copy link
Collaborator

dhrishi commented Aug 6, 2024

@Shivi-6 The controller example in esp-matter is primarily a commissioner, like chip-tool and uses the test certificates. It is not a standalone controller that is tied to some fabric and also not a Matter end device.

The commissioning flow for Matter Controller would be the same as other Matter devices. The controller will get node NOC (Node Operational Certificate) during Matter commissioning process.

This is, if the controller is a Matter end device too.

Now, a controller can be controller only or a Matter end device + controller. The esp-rainmaker example demonstrates the latter. Did you try commissioning that example with Alexa? If yes, please upload (and not paste) the commissioning logs from bootup. Note that, once you commission, it will act as a standard Matter end device. But, for the controller functionality, it should be commissioned with your own fabric (for e.g. - ESP RainMaker - that understands it is a controller and grants the access privileges accordingly)

@Shivi-6
Copy link
Author

Shivi-6 commented Aug 8, 2024

@dhrishi This makes things a bit clear.
I needed a controller so I tried it with rainmaker and I was able to commission it and I could also add end devices from Rainmaker app and then control them from the app as well as the console.
I also understood that the controller example in esp-matter is similar to chip-tool and can be used to commission end devices from the console. But the process of commissioning the end devices from the console is not clear. I am trying to commission a matter enabled TP-link smart plug using the manual pairing code but I am not able to do so. Can you please help me with that?

@shubhamdp
Copy link
Contributor

@Shivi-6 can you please share the logs from the esp-matter controller?

@Shivi-6
Copy link
Author

Shivi-6 commented Aug 9, 2024

Hi @shubhamdp , logs of when the controller connects to Rainmaker?
I have three logs,

  1. The controller is commissioned but cannot be connected to Rainmaker due to some timeout (this is sporadic)
    Controller_Fail.pdf

  2. The controller is commissioned and connected successfully to Rainmaker but not able to retrieve end device information
    Controller_Success.pdf

  3. The controller cannot retrieve node list but is able to control the nodes (two end devices - smart plug and dimmer)
    Device_Control.pdf

@shubhamdp
Copy link
Contributor

@Shivi-6, in Device_Control.pdf I only see you are trying invoke command, to commission the end device from there you will have to use the pairing command. Few examples are listed in our programming guide, PTAL: https://docs.espressif.com/projects/esp-matter/en/latest/esp32/developing.html#pairing-commands

PS: You will have to connect the commissioner to the WiFi before starting the process and that can be done using matter esp wifi connect <ssid> <password> command

@dhrishi
Copy link
Collaborator

dhrishi commented Aug 27, 2024

@Shivi-6 Following the above comment should help you commission the end device successfully. Please give it a try and close the issue if it works

@Shivi-6
Copy link
Author

Shivi-6 commented Aug 29, 2024

I tried commissioning the end device but it shows "Timeout waiting for mDNS resolution."

[1724922684.284315][1865989:1865989] CHIP:TOO: Command: pairing onnetwork 0x1234 20202021 
[1724922684.302672][1865989:1865991] CHIP:CTL: Setting attestation nonce to random value
[1724922684.302732][1865989:1865991] CHIP:CTL: Setting CSR nonce to random value
[1724922684.314490][1865989:1865991] CHIP:CTL: Generating NOC
[1724922684.342115][1865989:1865991] CHIP:FP: Validating NOC chain
[1724922684.342586][1865989:1865991] CHIP:FP: NOC chain validation successful
[1724922684.342680][1865989:1865991] CHIP:FP: Updated fabric at index: 0x1, Node ID: 0x000000000001B669
[1724922684.342687][1865989:1865991] CHIP:TS: Last Known Good Time: 2023-10-14T01:16:48
[1724922684.342709][1865989:1865991] CHIP:TS: New proposed Last Known Good Time: 2021-01-01T00:00:00
[1724922684.342713][1865989:1865991] CHIP:TS: Retaining current Last Known Good Time
[1724922684.343646][1865989:1865991] CHIP:FP: Metadata for Fabric 0x1 persisted to storage.
[1724922684.344196][1865989:1865991] CHIP:TS: Committing Last Known Good Time to storage: 2023-10-14T01:16:48
[1724922684.344772][1865989:1865991] CHIP:CTL: Joined the fabric at index 1. Fabric ID is 0x0000000000000001 (Compressed Fabric ID: 765ADAD98A0FB07A)
[1724922684.344781][1865989:1865991] CHIP:DIS: Updating services using commissioning mode 0
[1724922684.345136][1865989:1865991] CHIP:DIS: CHIP minimal mDNS started advertising.
[1724922684.345737][1865989:1865991] CHIP:DL: Using WiFi MAC for hostname
[1724922684.345761][1865989:1865991] CHIP:DIS: Advertise operational node 765ADAD98A0FB07A-000000000001B669
[1724922684.345790][1865989:1865991] CHIP:DIS: Responding with _matter._tcp.local
[1724922684.345815][1865989:1865991] CHIP:DIS: Responding with 765ADAD98A0FB07A-000000000001B669._matter._tcp.local
[1724922684.345821][1865989:1865991] CHIP:DIS: Responding with 765ADAD98A0FB07A-000000000001B669._matter._tcp.local
[1724922684.345843][1865989:1865991] CHIP:DIS: Responding with 1866DA4686A50000.local
[1724922684.345865][1865989:1865991] CHIP:DIS: Responding with 1866DA4686A50000.local
[1724922684.345872][1865989:1865991] CHIP:DIS: Responding with _I765ADAD98A0FB07A._sub._matter._tcp.local
[1724922684.345895][1865989:1865991] CHIP:DIS: CHIP minimal mDNS configured as 'Operational device'; instance name: 765ADAD98A0FB07A-000000000001B669.
[1724922684.346365][1865989:1865991] CHIP:DIS: mDNS service published: _matter._tcp
[1724922715.388353][1865989:1865991] CHIP:DIS: Timeout waiting for mDNS resolution.

@shubhamdp
Copy link
Contributor

shubhamdp commented Dec 10, 2024

@Shivi-6 are you still seeing the commissioning failure? If yes, can you please share the complete logs.

Edit: If its working, can you please close the issue.

@dhrishi
Copy link
Collaborator

dhrishi commented Jan 13, 2025

Closing this now

@dhrishi dhrishi closed this as completed Jan 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants