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

[zephyr] Fix Network Commissioning after switching to new API #14891

Merged
merged 1 commit into from
Feb 8, 2022

Conversation

Damian-Nordic
Copy link
Contributor

Problem

New Network Commissioning cluster code using the generic Thread driver requires that kThreadConnectivityChange event
be generated when the device is attached to a Thread network, and that was only implemented for LWIP and Linux platforms.

Change overview

Fill the gap for Zephyr.
Also, allow to use operational dataset without the network name as that is not necessary to attach to a network.

Testing

Tested that commissioning works again on nRF Connect platform.

New Network Commissioning cluster code using the generic
Thread driver requires that kThreadConnectivityChange event
be generated when the device is attached to a Thread
network and that was only implemented for LWIP and Linux
platforms. Fill the gap for Zephyr.

Also, allow to use operational dataset without the network
name as that is not neccessary to attach to a network.

Signed-off-by: Damian Krolik <[email protected]>
@msandstedt
Copy link
Contributor

Do we know when Thread commissioning broke?

CC @samadDotDev , @kianooshkarami

@github-actions
Copy link

github-actions bot commented Feb 8, 2022

PR #14891: Size comparison from 092e707 to 13b5cd3

Increases (10 builds for nrfconnect, telink)
platform target config section 092e707 13b5cd3 change % change
nrfconnect lighting-app nrf52840dk_nrf52840 (read/write) 1005423 1005691 268 0.0
bss 121344 121352 8 0.0
rodata 118268 118312 44 0.0
text 686928 687028 100 0.0
nrf52840dk_nrf52840+rpc (read/write) 974379 974535 156 0.0
bss 118532 118540 8 0.0
rodata 109656 109700 44 0.0
text 666540 666644 104 0.0
nrf52840dongle_nrf52840 (read/write) 1022227 1022383 156 0.0
bss 122708 122716 8 0.0
rodata 117156 117200 44 0.0
text 692496 692600 104 0.0
nrf5340dk_nrf5340_cpuapp (read/write) 912146 912306 160 0.0
bss 117904 117912 8 0.0
rodata 111524 111572 48 0.0
text 601952 602056 104 0.0
lock-app nrf52840dk_nrf52840 (read/write) 937663 937947 284 0.0
bss 119680 119688 8 0.0
rodata 106668 106712 44 0.0
text 632844 632948 104 0.0
nrf5340dk_nrf5340_cpuapp (read/write) 845234 845378 144 0.0
bss 116276 116284 8 0.0
rodata 99836 99884 48 0.0
text 548644 548744 100 0.0
pump-app nrf52840dk_nrf52840 (read/write) 940035 940179 144 0.0
bss 119432 119440 8 0.0
rodata 106848 106896 48 0.0
text 635088 635192 104 0.0
pump-controller-app nrf52840dk_nrf52840 (read/write) 935375 935519 144 0.0
bss 119436 119444 8 0.0
rodata 106140 106188 48 0.0
text 631124 631224 100 0.0
shell nrf52840dk_nrf52840 (read/write) 803719 803911 192 0.0
bss 111296 111304 8 0.0
rodata 78668 78716 48 0.1
text 536128 536272 144 0.0
telink lighting-app tlsr9518adk80d (read/write) 869974 870150 176 0.0
bss 88672 88680 8 0.0
text 611380 611492 112 0.0
Decreases (20 builds for cyw30739, efr32, k32w, linux, qpg)
platform target config section 092e707 13b5cd3 change % change
cyw30739 light cyw930739m2evb_01 (read/write) 595378 595362 -16 -0.0
.app_xip_area 500912 500896 -16 -0.0
lock cyw930739m2evb_01 (read/write) 553262 553254 -8 -0.0
.app_xip_area 460356 460348 -8 -0.0
ota-requestor cyw930739m2evb_01 (read/write) 577294 577278 -16 -0.0
.app_xip_area 475068 475052 -16 -0.0
efr32 lighting-app BRD4161A (read only) 866356 866340 -16 -0.0
.text 866348 866332 -16 -0.0
BRD4161A+rpc (read only) 853804 853788 -16 -0.0
.text 853796 853780 -16 -0.0
window-app BRD4161A (read only) 838560 838544 -16 -0.0
.text 838552 838536 -16 -0.0
k32w light k32w061+release (read/write) 679180 679164 -16 -0.0
.text 594864 594848 -16 -0.0
linux all-clusters-app debug (read only) 2334841 2334809 -32 -0.0
.text 1966370 1966338 -32 -0.0
bridge-app debug+rpc (read only) 1705909 1705893 -16 -0.0
.text 1449029 1449013 -16 -0.0
chip-tool debug (read only) 7489461 7489429 -32 -0.0
.text 6670565 6670533 -32 -0.0
chip-tool-ipv6only arm64 (read only) 7408124 7408092 -32 -0.0
.text 6369204 6369172 -32 -0.0
door-lock-app debug (read only) 1910377 1910361 -16 -0.0
.text 1588850 1588834 -16 -0.0
lighting-app debug+rpc (read only) 2005177 2005161 -16 -0.0
.text 1687474 1687458 -16 -0.0
ota-provider-app debug (read only) 1714505 1714489 -16 -0.0
.text 1443890 1443874 -16 -0.0
ota-requestor-app debug (read only) 1703161 1703145 -16 -0.0
.text 1441218 1441202 -16 -0.0
shell debug (read only) 2308313 2308281 -32 -0.0
.text 1944898 1944866 -32 -0.0
thermostat-no-ble arm64 (read only) 2134876 2134844 -32 -0.0
.text 1784400 1784368 -32 -0.0
tv-app debug (read only) 2549929 2549913 -16 -0.0
.text 2178850 2178834 -16 -0.0
qpg lighting-app qpg6105+debug (read only) 586368 586352 -16 -0.0
.text 581048 581032 -16 -0.0
lock-app qpg6105+debug (read only) 532420 532412 -8 -0.0
.text 527100 527092 -8 -0.0
Full report (43 builds for cyw30739, efr32, esp32, k32w, linux, mbed, nrfconnect, p6, qpg, telink)
platform target config section 092e707 13b5cd3 change % change
cyw30739 light cyw930739m2evb_01 (read/write) 595378 595362 -16 -0.0
.app_xip_area 500912 500896 -16 -0.0
.bss 77188 77188 0 0.0
.data 624 624 0 0.0
.rodata 0 0 0 0.0
.text 0 0 0 0.0
lock cyw930739m2evb_01 (read/write) 553262 553254 -8 -0.0
.app_xip_area 460356 460348 -8 -0.0
.bss 75660 75660 0 0.0
.data 588 588 0 0.0
.rodata 0 0 0 0.0
.text 0 0 0 0.0
ota-requestor cyw930739m2evb_01 (read/write) 577294 577278 -16 -0.0
.app_xip_area 475068 475052 -16 -0.0
.bss 84652 84652 0 0.0
.data 532 532 0 0.0
.rodata 0 0 0 0.0
.text 112 112 0 0.0
efr32 lighting-app BRD4161A (read only) 866356 866340 -16 -0.0
(read/write) 126684 126684 0 0.0
.bss 124760 124760 0 0.0
.data 1924 1924 0 0.0
.text 866348 866332 -16 -0.0
BRD4161A+rpc (read only) 853804 853788 -16 -0.0
(read/write) 143344 143344 0 0.0
.bss 141320 141320 0 0.0
.data 2024 2024 0 0.0
.text 853796 853780 -16 -0.0
window-app BRD4161A (read only) 838560 838544 -16 -0.0
(read/write) 125328 125328 0 0.0
.bss 123448 123448 0 0.0
.data 1880 1880 0 0.0
.text 838552 838536 -16 -0.0
esp32 all-clusters-app c3devkit (read only) 938950 938950 0 0.0
(read/write) 1402434 1402434 0 0.0
.dram0.bss 70040 70040 0 0.0
.dram0.data 14276 14276 0 0.0
.flash.rodata 199208 199208 0 0.0
.flash.text 938950 938950 0 0.0
.iram0.text 62056 62056 0 0.0
m5stack (read only) 987139 987139 0 0.0
(read/write) 467444 467444 0 0.0
.dram0.bss 75176 75176 0 0.0
.dram0.data 34040 34040 0 0.0
.flash.rodata 226100 226100 0 0.0
.flash.text 981755 981755 0 0.0
.iram0.text 123399 123399 0 0.0
k32w light k32w061+release (read/write) 679180 679164 -16 -0.0
.bss 76632 76632 0 0.0
.data 1884 1884 0 0.0
.text 594864 594848 -16 -0.0
lock k32w061+release (read/write) 681080 681080 0 0.0
.bss 76960 76960 0 0.0
.data 1924 1924 0 0.0
.text 596396 596396 0 0.0
linux all-clusters-app debug (read only) 2334841 2334809 -32 -0.0
(read/write) 140704 140704 0 0.0
.bss 55232 55232 0 0.0
.data 1200 1200 0 0.0
.data.rel.ro 78600 78600 0 0.0
.dynamic 592 592 0 0.0
.got 4136 4136 0 0.0
.init 27 27 0 0.0
.init_array 920 920 0 0.0
.rodata 206053 206053 0 0.0
.text 1966370 1966338 -32 -0.0
bridge-app debug+rpc (read only) 1705909 1705893 -16 -0.0
(read/write) 84328 84328 0 0.0
.bss 39088 39088 0 0.0
.data 1970 1970 0 0.0
.data.rel.ro 38120 38120 0 0.0
.dynamic 592 592 0 0.0
.got 3976 3976 0 0.0
.init 27 27 0 0.0
.init_array 560 560 0 0.0
.rodata 140332 140332 0 0.0
.text 1449029 1449013 -16 -0.0
chip-tool debug (read only) 7489461 7489429 -32 -0.0
(read/write) 197976 197976 0 0.0
.bss 32360 32360 0 0.0
.data 1152 1152 0 0.0
.data.rel.ro 158424 158424 0 0.0
.dynamic 608 608 0 0.0
.got 4784 4784 0 0.0
.init 27 27 0 0.0
.init_array 616 616 0 0.0
.rodata 416757 416757 0 0.0
.text 6670565 6670533 -32 -0.0
chip-tool-ipv6only arm64 (read only) 7408124 7408092 -32 -0.0
(read/write) 302321 302321 0 0.0
.bss 50641 50641 0 0.0
.data 1176 1176 0 0.0
.data.rel.ro 200120 200120 0 0.0
.dynamic 560 560 0 0.0
.got 46584 46584 0 0.0
.init 24 24 0 0.0
.init_array 192 192 0 0.0
.rodata 399364 399364 0 0.0
.text 6369204 6369172 -32 -0.0
door-lock-app debug (read only) 1910377 1910361 -16 -0.0
(read/write) 110584 110584 0 0.0
.bss 42096 42096 0 0.0
.data 946 946 0 0.0
.data.rel.ro 62128 62128 0 0.0
.dynamic 592 592 0 0.0
.got 4112 4112 0 0.0
.init 27 27 0 0.0
.init_array 672 672 0 0.0
.rodata 173010 173010 0 0.0
.text 1588850 1588834 -16 -0.0
lighting-app debug+rpc (read only) 2005177 2005161 -16 -0.0
(read/write) 115632 115632 0 0.0
.bss 43104 43104 0 0.0
.data 1368 1368 0 0.0
.data.rel.ro 65672 65672 0 0.0
.dynamic 608 608 0 0.0
.got 4144 4144 0 0.0
.init 27 27 0 0.0
.init_array 712 712 0 0.0
.rodata 163057 163057 0 0.0
.text 1687474 1687458 -16 -0.0
ota-provider-app debug (read only) 1714505 1714489 -16 -0.0
(read/write) 81368 81368 0 0.0
.bss 41120 41120 0 0.0
.data 1160 1160 0 0.0
.data.rel.ro 33560 33560 0 0.0
.dynamic 608 608 0 0.0
.got 4240 4240 0 0.0
.init 27 27 0 0.0
.init_array 624 624 0 0.0
.rodata 151910 151910 0 0.0
.text 1443890 1443874 -16 -0.0
ota-requestor-app debug (read only) 1703161 1703145 -16 -0.0
(read/write) 83320 83320 0 0.0
.bss 42272 42272 0 0.0
.data 1128 1128 0 0.0
.data.rel.ro 34616 34616 0 0.0
.dynamic 592 592 0 0.0
.got 4040 4040 0 0.0
.init 27 27 0 0.0
.init_array 624 624 0 0.0
.rodata 145047 145047 0 0.0
.text 1441218 1441202 -16 -0.0
shell debug (read only) 2308313 2308281 -32 -0.0
(read/write) 142288 142288 0 0.0
.bss 62624 62624 0 0.0
.data 800 800 0 0.0
.data.rel.ro 73168 73168 0 0.0
.dynamic 592 592 0 0.0
.got 4168 4168 0 0.0
.init 27 27 0 0.0
.init_array 904 904 0 0.0
.rodata 206802 206802 0 0.0
.text 1944898 1944866 -32 -0.0
thermostat-no-ble arm64 (read only) 2134876 2134844 -32 -0.0
(read/write) 141009 141009 0 0.0
.bss 57953 57953 0 0.0
.data 984 984 0 0.0
.data.rel.ro 74952 74952 0 0.0
.dynamic 560 560 0 0.0
.got 4152 4152 0 0.0
.init 24 24 0 0.0
.init_array 336 336 0 0.0
.rodata 132316 132316 0 0.0
.text 1784400 1784368 -32 -0.0
tv-app debug (read only) 2549929 2549913 -16 -0.0
(read/write) 140376 140376 0 0.0
.bss 57568 57568 0 0.0
.data 3168 3168 0 0.0
.data.rel.ro 73608 73608 0 0.0
.dynamic 592 592 0 0.0
.got 4528 4528 0 0.0
.init 27 27 0 0.0
.init_array 880 880 0 0.0
.rodata 196940 196940 0 0.0
.text 2178850 2178834 -16 -0.0
mbed all-clusters-app CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 2391184 2391184 0 0.0
.bss 188948 188948 0 0.0
.data 5304 5304 0 0.0
.text 1353784 1353784 0 0.0
lighting-app CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 2349448 2349448 0 0.0
.bss 181000 181000 0 0.0
.data 5600 5600 0 0.0
.text 1312048 1312048 0 0.0
lock-app CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 2313368 2313368 0 0.0
.bss 180888 180888 0 0.0
.data 5584 5584 0 0.0
.text 1275968 1275968 0 0.0
pigweed-app CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 1139648 1139648 0 0.0
.bss 11756 11756 0 0.0
.data 4368 4368 0 0.0
.text 103032 103032 0 0.0
shell CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 2303340 2303340 0 0.0
.bss 178164 178164 0 0.0
.data 5400 5400 0 0.0
.text 1265912 1265912 0 0.0
nrfconnect lighting-app nrf52840dk_nrf52840 (read/write) 1005423 1005691 268 0.0
bss 121344 121352 8 0.0
rodata 118268 118312 44 0.0
text 686928 687028 100 0.0
nrf52840dk_nrf52840+rpc (read/write) 974379 974535 156 0.0
bss 118532 118540 8 0.0
rodata 109656 109700 44 0.0
text 666540 666644 104 0.0
nrf52840dongle_nrf52840 (read/write) 1022227 1022383 156 0.0
bss 122708 122716 8 0.0
rodata 117156 117200 44 0.0
text 692496 692600 104 0.0
nrf5340dk_nrf5340_cpuapp (read/write) 912146 912306 160 0.0
bss 117904 117912 8 0.0
rodata 111524 111572 48 0.0
text 601952 602056 104 0.0
lock-app nrf52840dk_nrf52840 (read/write) 937663 937947 284 0.0
bss 119680 119688 8 0.0
rodata 106668 106712 44 0.0
text 632844 632948 104 0.0
nrf5340dk_nrf5340_cpuapp (read/write) 845234 845378 144 0.0
bss 116276 116284 8 0.0
rodata 99836 99884 48 0.0
text 548644 548744 100 0.0
pigweed-app nrf52840dk_nrf52840 (read/write) 527595 527595 0 0.0
bss 53632 53632 0 0.0
rodata 49976 49976 0 0.0
text 361016 361016 0 0.0
pump-app nrf52840dk_nrf52840 (read/write) 940035 940179 144 0.0
bss 119432 119440 8 0.0
rodata 106848 106896 48 0.0
text 635088 635192 104 0.0
pump-controller-app nrf52840dk_nrf52840 (read/write) 935375 935519 144 0.0
bss 119436 119444 8 0.0
rodata 106140 106188 48 0.0
text 631124 631224 100 0.0
shell nrf52840dk_nrf52840 (read/write) 803719 803911 192 0.0
bss 111296 111304 8 0.0
rodata 78668 78716 48 0.1
text 536128 536272 144 0.0
p6 all-clusters-app default (read/write) 2465624 2465624 0 0.0
.bss 118560 118560 0 0.0
.data 2584 2584 0 0.0
.text 1423888 1423888 0 0.0
light-app default (read/write) 2367760 2367760 0 0.0
.bss 107664 107664 0 0.0
.data 2432 2432 0 0.0
.text 1326024 1326024 0 0.0
lock-app default (read/write) 2332960 2332960 0 0.0
.bss 107368 107368 0 0.0
.data 2392 2392 0 0.0
.text 1291224 1291224 0 0.0
qpg lighting-app qpg6105+debug (read only) 586368 586352 -16 -0.0
(read/write) 146936 146936 0 0.0
.bss 88920 88920 0 0.0
.data 1084 1084 0 0.0
.text 581048 581032 -16 -0.0
lock-app qpg6105+debug (read only) 532420 532412 -8 -0.0
(read/write) 146940 146940 0 0.0
.bss 88368 88368 0 0.0
.data 1024 1024 0 0.0
.text 527100 527092 -8 -0.0
persistent-storage-app qpg6105+debug (read only) 99520 99520 0 0.0
(read/write) 146940 146940 0 0.0
.bss 24004 24004 0 0.0
.data 176 176 0 0.0
.text 94200 94200 0 0.0
telink lighting-app tlsr9518adk80d (read/write) 869974 870150 176 0.0
bss 88672 88680 8 0.0
noinit 37160 37160 0 0.0
text 611380 611492 112 0.0

@andy31415
Copy link
Contributor

Do we know when Thread commissioning broke?

CC @samadDotDev , @kianooshkarami

Likely when we started checking feature maps to determine which network type support exists. This was also parallel with requiring the "new" network commissioning cluster to be implemented (i.e. one that supports scanning and other spec-compliant functionality).

To fix, we implemented a generic "new" thread network commissioning and this PR starts fixing that implementation.

@andy31415 andy31415 merged commit 8d0fd6b into project-chip:master Feb 8, 2022
@Damian-Nordic Damian-Nordic deleted the thread-connectivity branch February 9, 2022 08:01
@Damian-Nordic
Copy link
Contributor Author

Yes, Andy is right. Basically, the new network commissioning API waits for the network attachment before sending a response to ConnectNetwork command and an event used to announce the network attachment was unimplemented in Zephyr.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants