Closed flatsiedatsie closed 1 year ago
Well, I've seen this too and need to look into it, appears an issue in the python wrapper of the SDK. For me at least just always using the normal commissioning command just works, even for on network pairs.
Ah ok. Thanks. I thought perhaps I was mistaking the "discriminator" with the actual pairing code?
To commission the device, you can use either the setup PIN code or the setup PIN code and the discriminator [source](https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/matter/chip_tool_guide.html)
It seems the discriminator is a 4 digit code, and the pairing code is normally longer?
A Passcode SHALL be included as a 27-bit unsigned integer, which serves as proof of possession during commissioning. The 27-bit unsigned integer encodes an 8-digit decimal numeric value, and therefore shall be restricted to the values 0x0000001 to 0x5F5E0FE (00000001 to 99999998 in decimal), excluding the invalid Passcode values. [source](https://www.cookie-daily.life/src/matter/matter_html/Chapter%205.%20Commissioning.html)
And another hint that it should be eight digits here:
I: 254 [DL]Device Configuration:
I: 257 [DL] Serial Number: TEST_SN
I: 260 [DL] Vendor Id: 65521 (0xFFF1)
I: 263 [DL] Product Id: 32768 (0x8000)
I: 267 [DL] Hardware Version: 1
I: 270 [DL] Setup Pin Code: 20202021
I: 273 [DL] Setup Discriminator: 3840 (0xF00)
I: 278 [DL] Manufacturing Date: (not set)
I: 281 [DL] Device Type: 65535 (0xFFFF)
In above printout, the discriminator is 3840 (0xF00) and the setup PIN code is equal to 20202021.
If you run 2 versions of the Matter server, make sure they both have unique IDs and are not identifying as the same controller.
@flatsiedatsie you indeed only need the pin code, the discriminator can be used as filter if multiple devices are advertising as ready to pair but by default the sdk just tries them all so sending the pincode alone is enough.
I just tried again, making sure each Raspberry Pi was only running one Matter server. It still resulted in the same error.
@marcelveldt You make it sound as if I should have a choice between two codes? However, when I run the command this is the response I see:
2023-02-15 22:40:38.430 INFO : matter-adapter: client: on_message: {
2023-02-15 22:40:38.431 INFO : matter-adapter: "message_id": "open_commissioning_window",
2023-02-15 22:40:38.431 INFO : matter-adapter: "result": 3840,
2023-02-15 22:40:38.432 INFO : matter-adapter: "_type": "matter_server.common.models.message.SuccessResultMessage"
2023-02-15 22:40:38.432 INFO : matter-adapter: }
The result is just one number, which seems to be the discriminator (four numbers) and not the pairing code (eight numbers)?
I'll have a look, I did not actually do anything with this part of the SDK just that. So far our efforts have gone to commission devices into the server instead of the other way around :-)
The "open commission window" command to share an already commissioned device to another controller is broken in the current python wrapper implementation but fixed upstream. Revisit this one 1.1 is available and a new release of the SDK is out.
Interestingly this is working for me. I have added some Eve Devices (3 Energy, 3 Door & Window, 1 Motion) to Home assistant through a compatible USB Dongle and the Silicon Labs Multi Protocol Add On. Then I connected via Websocket to the Matter Server, issued the command, and successfully added the devices via the 8 digit code to Apple Home. (Took this route as I wanted to force the use of Home Assistant being the Border Router instead of my Apple TV, had some stability issues there.)
Yes we fixed this in the code but are still working on the UI within HA.
BTW: At this time its actually the other way around and Apple is the most stable border router. We are working hard on improving the DIY route (and even allow to form one big network) but for now its not our recommended route.
Closing here as the original issue has been resolved. @flatsiedatsie please re-open if you still run into issues with the command.
I'm trying to share a paired Matter device with a second controller. Both are running the Python Matter Server.
Perhaps my assumptions about this process are wrong, so here is what I'm doing now:
open commissioning window
. This returns a four digit code (which is always the same?). I show that code in the UI, and ask the user to enter that on the second controller.start network commissioning
.Is this the correct process?
In the output I see this:
The full log from Pi 1: