-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Fix thread commissioning fail where there are many Thread Border Routers #23492
Fix thread commissioning fail where there are many Thread Border Routers #23492
Conversation
Matter Commissioner sometimes fails to commission Matter Thread Device where there are many Thread Border Routers. Specifically, in order to connect the Matter Thread Device to the Thread Border Router during the commissioning process, the Matter Commissioner sends Thread ScanNetworks command to the Matter Thread Device. However, no matter how many times Matter Commissioner requests ScanNetworks, there is no Thread Border Router it wants to connect to in the response, so the commissioning has failed. According to the message size requirements of the Matter specification document, the maximum length of a Service Data Unit is 1024 bytes. Since Thread ScanNetworks' responses have to be stored in it, network commissioing cluster only stores 15 of them. Therefore, Thread Device sends only 15 of the scan results in response to Thread ScanNetworks command, and the scan result list contains duplicate items and is used without sorting. There were about 50 items in scan result list on the problem situation, and they were sorted in ascending order by channel. And the channel of the Thread Border Router it wants to connect to is the largest number, so it is not always included in the response of Thread ScanNetworks command. Accordingly, the Matter Commissioner determined that the Matter Device did not discover the Thread Border Router it wants to connect to, and the commissioning failed. This commit changes the Thread Scan result list in two ways. First, it prevents the addition of duplicate items in the list. Next, sort the list in ascending order based on RSSI. The reason for using RSSI is that where there are many Thread Border Routers, it is reasonable to expect that users will start commissioning close to the Thread Border Routers they want Thread Devices to connect to. Signed-off-by: Youngho Yoon <[email protected]> Signed-off-by: Charles Kim <[email protected]> Signed-off-by: Hunsup <[email protected]> Signed-off-by: sanghyukko <[email protected]> Signed-off-by: Jaehoon You <[email protected]>
PR #23492: Size comparison from d066463 to b89d83e Increases above 0.2%:
Increases (46 builds for bl602, bl702, cc13x2_26x2, cyw30739, efr32, k32w, linux, mbed, nrfconnect, psoc6, qpg, telink)
Decreases (6 builds for cc13x2_26x2)
Full report (49 builds for bl602, bl702, cc13x2_26x2, cyw30739, efr32, k32w, linux, mbed, nrfconnect, psoc6, qpg, telink)
|
src/app/clusters/network-commissioning/network-commissioning.cpp
Outdated
Show resolved
Hide resolved
@yhoyoon please sign the CLA |
PR #23492: Size comparison from d066463 to 9adf020 Increases (29 builds for cc13x2_26x2, efr32, k32w, mbed, nrfconnect, psoc6, qpg, telink)
Decreases (13 builds for cc13x2_26x2, cyw30739, psoc6)
Full report (32 builds for cc13x2_26x2, cyw30739, efr32, k32w, mbed, nrfconnect, psoc6, qpg, telink)
|
src/app/clusters/network-commissioning/network-commissioning.cpp
Outdated
Show resolved
Hide resolved
src/app/clusters/network-commissioning/network-commissioning.cpp
Outdated
Show resolved
Hide resolved
Signed-off-by: Youngho Yoon <[email protected]>
@Damian-Nordic , @andy31415 I changed it to use |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Have some minor suggestions, but it's up to you if you want to apply them or not. Looks good to me :)
src/app/clusters/network-commissioning/network-commissioning.cpp
Outdated
Show resolved
Hide resolved
src/app/clusters/network-commissioning/network-commissioning.cpp
Outdated
Show resolved
Hide resolved
src/app/clusters/network-commissioning/network-commissioning.cpp
Outdated
Show resolved
Hide resolved
Signed-off-by: Youngho Yoon <[email protected]>
Note that you also need to fix build errors (casting from size_t to int). |
Signed-off-by: Youngho Yoon <[email protected]>
Signed-off-by: Youngho Yoon <[email protected]>
PR #23492: Size comparison from 3edba4a to 544bd2b Increases (44 builds for bl602, bl702, cc13x2_26x2, cyw30739, efr32, esp32, k32w, linux, mbed, nrfconnect, psoc6, qpg, telink)
Decreases (7 builds for cc13x2_26x2, esp32)
Full report (51 builds for bl602, bl702, cc13x2_26x2, cyw30739, efr32, esp32, k32w, linux, mbed, nrfconnect, psoc6, qpg, telink)
|
PR #23492: Size comparison from b568009 to 09aa8f4 Increases (44 builds for bl602, bl702, cc13x2_26x2, cyw30739, efr32, esp32, k32w, linux, mbed, nrfconnect, psoc6, qpg, telink)
Decreases (8 builds for cc13x2_26x2, esp32)
Full report (51 builds for bl602, bl702, cc13x2_26x2, cyw30739, efr32, esp32, k32w, linux, mbed, nrfconnect, psoc6, qpg, telink)
|
…ers (project-chip#23492) Matter Commissioner sometimes fails to commission Matter Thread Device where there are many Thread Border Routers. Specifically, in order to connect the Matter Thread Device to the Thread Border Router during the commissioning process, the Matter Commissioner sends Thread ScanNetworks command to the Matter Thread Device. However, no matter how many times Matter Commissioner requests ScanNetworks, there is no Thread Border Router it wants to connect to in the response, so the commissioning has failed. According to the message size requirements of the Matter specification document, the maximum length of a Service Data Unit is 1024 bytes. Since Thread ScanNetworks' responses have to be stored in it, network commissioing cluster only stores 15 of them. Therefore, Thread Device sends only 15 of the scan results in response to Thread ScanNetworks command, and the scan result list contains duplicate items and is used without sorting. There were about 50 items in scan result list on the problem situation, and they were sorted in ascending order by channel. And the channel of the Thread Border Router it wants to connect to is the largest number, so it is not always included in the response of Thread ScanNetworks command. Accordingly, the Matter Commissioner determined that the Matter Device did not discover the Thread Border Router it wants to connect to, and the commissioning failed. This commit changes the Thread Scan result list in two ways. First, it prevents the addition of duplicate items in the list. Next, sort the list in ascending order based on RSSI. The reason for using RSSI is that where there are many Thread Border Routers, it is reasonable to expect that users will start commissioning close to the Thread Border Routers they want Thread Devices to connect to. Signed-off-by: Youngho Yoon <[email protected]> Signed-off-by: Charles Kim <[email protected]> Signed-off-by: Hunsup <[email protected]> Signed-off-by: sanghyukko <[email protected]> Signed-off-by: Jaehoon You <[email protected]>
Problem
Matter Commissioner sometimes fails to commission Matter Thread Device where there are many Thread Border Routers. Specifically, in order to connect the Matter Thread Device to the Thread Border Router during the commissioning process, the Matter Commissioner sends Thread ScanNetworks command to the Matter Thread Device. However, no matter how many times Matter Commissioner requests ScanNetworks, there is no Thread Border Router it wants to connect to in the response, so the commissioning has failed.
Cause
According to the message size requirements of the Matter specification document, the maximum length of a Service Data Unit is 1024 bytes. Since Thread ScanNetworks' responses have to be stored in it, network commissioing cluster only stores 15 of them. Therefore, Thread Device sends only 15 of the scan results in response to Thread ScanNetworks command, and the scan result list contains duplicate items and is used without sorting. There were about 50 items in scan result list on the problem situation, and they were sorted in ascending order by channel. And the channel of the Thread Border Router it wants to connect to is the largest number, so it is not always included in the response of Thread ScanNetworks command. Accordingly, the Matter Commissioner determined that the Matter Device did not discover the Thread Border Router it wants to connect to, and the commissioning failed.
Solution
This PR changes the Thread Scan result list in two ways.
The reason for using RSSI is that where there are many Thread Border Routers, it is reasonable to expect that users will start commissioning close to the Thread Border Routers they want Thread Devices to connect to.