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

Make in RAM NetworkCommissioning::Featuremap report kThreadDevice #14751

Merged

Conversation

andy31415
Copy link
Contributor

Problem

Thread devices fail to commission currently. #14713 is addressing that, however it may take a while to make all devices work.

Change overview

Switch the default to 2 (i.e. thread device) from previous values of 0 (invalid really) and 1 (wifi). Other wifi platforms are generally covered:

  • linux and esp32 have an actual driver returning kWifi and not using the zap inram storage
  • darwin has a CI workaround forcing everything to be 0 (and this will need fixing separately)

Testing

Commissioned a NRF device on thread using chip-tool pairing ble-thread, it went past the cretendial selection

Validated all needed things changed via:

fd 'zap$' | xargs rg 'Network Commissioning' | cut -f1 -d: | uniq | xargs -n1 jq '.endpointTypes[].clusters[] | select(.name == "Network Commissioning") | {name: .name, attr: .attributes[] | {name:.name, default:.defaultValue, file: input_filename}} | select(.attr.name == "FeatureMap" and .attr.default != "2")'

This makes the default in-ram setting claim 'I am a thread device'.
This is because most wifi devices already support a spec-compliant
network cluster:
  - linux reports as wifi
  - esp32 reports as wifi
  - darwin has an intentional 'report as 0' for unit tests which needs
    to be altered and ZAP defaults will not apply anyway.

Found files to be changed and validated via:

fd 'zap$' | xargs rg 'Network Commissioning' | cut -f1 -d: | uniq | xargs -n1 jq '.endpointTypes[].clusters[] | select(.name == "Network Commissioning") | {name: .name, attr: .attributes[] | {name:.name, default:.defaultValue, file: input_filename}} | select(.attr.name == "FeatureMap" and .attr.default != "2")'
@github-actions
Copy link

github-actions bot commented Feb 3, 2022

PR #14751: Size comparison from 1ee9366 to 56cb75b

Full report (34 builds for cyw30739, efr32, esp32, k32w, linux, mbed, nrfconnect, p6, qpg, telink)
platform target config section 1ee9366 56cb75b change % change
cyw30739 light cyw930739m2evb_01 (read/write) 586754 586754 0 0.0
.app_xip_area 493352 493352 0 0.0
.bss 76124 76124 0 0.0
.data 620 620 0 0.0
.rodata 0 0 0 0.0
.text 0 0 0 0.0
lock cyw930739m2evb_01 (read/write) 544578 544578 0 0.0
.app_xip_area 452744 452744 0 0.0
.bss 74596 74596 0 0.0
.data 584 584 0 0.0
.rodata 0 0 0 0.0
.text 0 0 0 0.0
ota-requestor cyw930739m2evb_01 (read/write) 569034 569034 0 0.0
.app_xip_area 467880 467880 0 0.0
.bss 83588 83588 0 0.0
.data 528 528 0 0.0
.rodata 0 0 0 0.0
.text 112 112 0 0.0
efr32 lighting-app BRD4161A (read only) 855944 855944 0 0.0
(read/write) 125888 125888 0 0.0
.bss 123968 123968 0 0.0
.data 1920 1920 0 0.0
.text 855936 855936 0 0.0
BRD4161A+rpc (read only) 843320 843320 0 0.0
(read/write) 142552 142552 0 0.0
.bss 140528 140528 0 0.0
.data 2020 2020 0 0.0
.text 843312 843312 0 0.0
window-app BRD4161A (read only) 828100 828100 0 0.0
(read/write) 124520 124520 0 0.0
.bss 122644 122644 0 0.0
.data 1876 1876 0 0.0
.text 828092 828092 0 0.0
esp32 all-clusters-app c3devkit (read only) 934622 934622 0 0.0
(read/write) 1401074 1401074 0 0.0
.dram0.bss 70056 70056 0 0.0
.dram0.data 14268 14268 0 0.0
.flash.rodata 197848 197848 0 0.0
.flash.text 934622 934622 0 0.0
.iram0.text 62056 62056 0 0.0
m5stack (read only) 982803 982803 0 0.0
(read/write) 465428 465428 0 0.0
.dram0.bss 74816 74816 0 0.0
.dram0.data 34024 34024 0 0.0
.flash.rodata 224460 224460 0 0.0
.flash.text 977419 977419 0 0.0
.iram0.text 123399 123399 0 0.0
k32w light k32w061+release (read/write) 671036 671036 0 0.0
.bss 75836 75836 0 0.0
.data 1880 1880 0 0.0
.text 587520 587520 0 0.0
lock k32w061+release (read/write) 672528 672528 0 0.0
.bss 76148 76148 0 0.0
.data 1920 1920 0 0.0
.text 588660 588660 0 0.0
linux chip-tool-ipv6only arm64 (read only) 7167204 7167204 0 0.0
(read/write) 284929 284929 0 0.0
.bss 47585 47585 0 0.0
.data 1128 1128 0 0.0
.data.rel.ro 187056 187056 0 0.0
.dynamic 560 560 0 0.0
.got 45376 45376 0 0.0
.init 24 24 0 0.0
.init_array 184 184 0 0.0
.rodata 391436 391436 0 0.0
.text 6173044 6173044 0 0.0
thermostat-no-ble arm64 (read only) 2121852 2121852 0 0.0
(read/write) 140737 140737 0 0.0
.bss 57761 57761 0 0.0
.data 952 952 0 0.0
.data.rel.ro 74904 74904 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 131084 131084 0 0.0
.text 1772768 1772768 0 0.0
mbed all-clusters-app CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 2386320 2386320 0 0.0
.bss 188964 188964 0 0.0
.data 5280 5280 0 0.0
.text 1348920 1348920 0 0.0
lighting-app CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 2347256 2347256 0 0.0
.bss 181080 181080 0 0.0
.data 5592 5592 0 0.0
.text 1309856 1309856 0 0.0
lock-app CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 2311112 2311112 0 0.0
.bss 180960 180960 0 0.0
.data 5576 5576 0 0.0
.text 1273712 1273712 0 0.0
pigweed-app CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 1139712 1139712 0 0.0
.bss 11756 11756 0 0.0
.data 4368 4368 0 0.0
.text 103096 103096 0 0.0
shell CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 2301492 2301492 0 0.0
.bss 178244 178244 0 0.0
.data 5392 5392 0 0.0
.text 1264064 1264064 0 0.0
nrfconnect lighting-app nrf52840dk_nrf52840 (read/write) 994435 994435 0 0.0
bss 120544 120544 0 0.0
rodata 117168 117168 0 0.0
text 677868 677868 0 0.0
nrf52840dk_nrf52840+rpc (read/write) 976311 976311 0 0.0
bss 116400 116400 0 0.0
rodata 108556 108556 0 0.0
text 672936 672936 0 0.0
nrf52840dongle_nrf52840 (read/write) 1011103 1011103 0 0.0
bss 121908 121908 0 0.0
rodata 116008 116008 0 0.0
text 683320 683320 0 0.0
nrf5340dk_nrf5340_cpuapp (read/write) 903874 903874 0 0.0
bss 117108 117108 0 0.0
rodata 110460 110460 0 0.0
text 595552 595552 0 0.0
lock-app nrf52840dk_nrf52840 (read/write) 926479 926479 0 0.0
bss 118880 118880 0 0.0
rodata 105444 105444 0 0.0
text 623688 623688 0 0.0
nrf5340dk_nrf5340_cpuapp (read/write) 836750 836750 0 0.0
bss 115472 115472 0 0.0
rodata 98648 98648 0 0.0
text 542148 542148 0 0.0
pigweed-app nrf52840dk_nrf52840 (read/write) 541779 541779 0 0.0
bss 52588 52588 0 0.0
rodata 50048 50048 0 0.0
text 376940 376940 0 0.0
pump-app nrf52840dk_nrf52840 (read/write) 929131 929131 0 0.0
bss 118636 118636 0 0.0
rodata 105960 105960 0 0.0
text 626024 626024 0 0.0
pump-controller-app nrf52840dk_nrf52840 (read/write) 924195 924195 0 0.0
bss 118644 118644 0 0.0
rodata 105064 105064 0 0.0
text 621964 621964 0 0.0
shell nrf52840dk_nrf52840 (read/write) 802571 802571 0 0.0
bss 110968 110968 0 0.0
rodata 78480 78480 0 0.0
text 535544 535544 0 0.0
p6 all-clusters-app default (read/write) 2447176 2447176 0 0.0
.bss 117124 117124 0 0.0
.data 2568 2568 0 0.0
.text 1405440 1405440 0 0.0
light-app default (read/write) 2352496 2352496 0 0.0
.bss 106268 106268 0 0.0
.data 2432 2432 0 0.0
.text 1310760 1310760 0 0.0
lock-app default (read/write) 2317608 2317608 0 0.0
.bss 105980 105980 0 0.0
.data 2392 2392 0 0.0
.text 1275872 1275872 0 0.0
qpg lighting-app qpg6105+debug (read only) 579316 579316 0 0.0
(read/write) 146936 146936 0 0.0
.bss 88120 88120 0 0.0
.data 1084 1084 0 0.0
.text 573996 573996 0 0.0
lock-app qpg6105+debug (read only) 525296 525296 0 0.0
(read/write) 146936 146936 0 0.0
.bss 87560 87560 0 0.0
.data 1020 1020 0 0.0
.text 519976 519976 0 0.0
persistent-storage-app qpg6105+debug (read only) 107140 107140 0 0.0
(read/write) 146940 146940 0 0.0
.bss 38504 38504 0 0.0
.data 288 288 0 0.0
.text 101820 101820 0 0.0
telink lighting-app tlsr9518adk80d (read/write) 857950 857950 0 0.0
bss 88480 88480 0 0.0
noinit 37160 37160 0 0.0
text 601174 601174 0 0.0

@github-actions
Copy link

github-actions bot commented Feb 3, 2022

PR #14751: Size comparison from 4267a9b to 9347931

Full report (43 builds for cyw30739, efr32, esp32, k32w, linux, mbed, nrfconnect, p6, qpg, telink)
platform target config section 4267a9b 9347931 change % change
cyw30739 light cyw930739m2evb_01 (read/write) 586702 586702 0 0.0
.app_xip_area 493300 493300 0 0.0
.bss 76124 76124 0 0.0
.data 620 620 0 0.0
.rodata 0 0 0 0.0
.text 0 0 0 0.0
lock cyw930739m2evb_01 (read/write) 544602 544602 0 0.0
.app_xip_area 452768 452768 0 0.0
.bss 74596 74596 0 0.0
.data 584 584 0 0.0
.rodata 0 0 0 0.0
.text 0 0 0 0.0
ota-requestor cyw930739m2evb_01 (read/write) 569014 569014 0 0.0
.app_xip_area 467860 467860 0 0.0
.bss 83588 83588 0 0.0
.data 528 528 0 0.0
.rodata 0 0 0 0.0
.text 112 112 0 0.0
efr32 lighting-app BRD4161A (read only) 855952 855952 0 0.0
(read/write) 125880 125880 0 0.0
.bss 123960 123960 0 0.0
.data 1920 1920 0 0.0
.text 855944 855944 0 0.0
BRD4161A+rpc (read only) 843320 843320 0 0.0
(read/write) 142544 142544 0 0.0
.bss 140520 140520 0 0.0
.data 2020 2020 0 0.0
.text 843312 843312 0 0.0
window-app BRD4161A (read only) 828180 828180 0 0.0
(read/write) 124520 124520 0 0.0
.bss 122644 122644 0 0.0
.data 1876 1876 0 0.0
.text 828172 828172 0 0.0
esp32 all-clusters-app c3devkit (read only) 934576 934576 0 0.0
(read/write) 1401026 1401026 0 0.0
.dram0.bss 70056 70056 0 0.0
.dram0.data 14268 14268 0 0.0
.flash.rodata 197800 197800 0 0.0
.flash.text 934576 934576 0 0.0
.iram0.text 62056 62056 0 0.0
m5stack (read only) 982767 982767 0 0.0
(read/write) 465388 465388 0 0.0
.dram0.bss 74816 74816 0 0.0
.dram0.data 34024 34024 0 0.0
.flash.rodata 224420 224420 0 0.0
.flash.text 977383 977383 0 0.0
.iram0.text 123399 123399 0 0.0
k32w light k32w061+release (read/write) 671016 671016 0 0.0
.bss 75828 75828 0 0.0
.data 1880 1880 0 0.0
.text 587508 587508 0 0.0
lock k32w061+release (read/write) 672560 672560 0 0.0
.bss 76148 76148 0 0.0
.data 1920 1920 0 0.0
.text 588692 588692 0 0.0
linux all-clusters-app debug (read only) 2310049 2310049 0 0.0
(read/write) 139872 139872 0 0.0
.bss 54592 54592 0 0.0
.data 1200 1200 0 0.0
.data.rel.ro 78392 78392 0 0.0
.dynamic 592 592 0 0.0
.got 4128 4128 0 0.0
.init 27 27 0 0.0
.init_array 920 920 0 0.0
.rodata 204005 204005 0 0.0
.text 1944114 1944114 0 0.0
bridge-app debug+rpc (read only) 1695565 1695565 0 0.0
(read/write) 84504 84504 0 0.0
.bss 39296 39296 0 0.0
.data 1986 1986 0 0.0
.data.rel.ro 38064 38064 0 0.0
.dynamic 592 592 0 0.0
.got 3968 3968 0 0.0
.init 27 27 0 0.0
.init_array 560 560 0 0.0
.rodata 139028 139028 0 0.0
.text 1440245 1440245 0 0.0
chip-tool debug (read only) 7215949 7215949 0 0.0
(read/write) 180424 180424 0 0.0
.bss 29192 29192 0 0.0
.data 1088 1088 0 0.0
.data.rel.ro 144168 144168 0 0.0
.dynamic 608 608 0 0.0
.got 4760 4760 0 0.0
.init 27 27 0 0.0
.init_array 600 600 0 0.0
.rodata 407573 407573 0 0.0
.text 6440645 6440645 0 0.0
chip-tool-ipv6only arm64 (read only) 7164708 7164708 0 0.0
(read/write) 283233 283233 0 0.0
.bss 47457 47457 0 0.0
.data 1128 1128 0 0.0
.data.rel.ro 185496 185496 0 0.0
.dynamic 560 560 0 0.0
.got 45376 45376 0 0.0
.init 24 24 0 0.0
.init_array 184 184 0 0.0
.rodata 390412 390412 0 0.0
.text 6173044 6173044 0 0.0
door-lock-app debug (read only) 1893137 1893137 0 0.0
(read/write) 110696 110696 0 0.0
.bss 42272 42272 0 0.0
.data 962 962 0 0.0
.data.rel.ro 62048 62048 0 0.0
.dynamic 592 592 0 0.0
.got 4104 4104 0 0.0
.init 27 27 0 0.0
.init_array 672 672 0 0.0
.rodata 171804 171804 0 0.0
.text 1573074 1573074 0 0.0
lighting-app debug+rpc (read only) 1995329 1995329 0 0.0
(read/write) 115784 115784 0 0.0
.bss 43224 43224 0 0.0
.data 1392 1392 0 0.0
.data.rel.ro 65664 65664 0 0.0
.dynamic 608 608 0 0.0
.got 4136 4136 0 0.0
.init 27 27 0 0.0
.init_array 712 712 0 0.0
.rodata 161745 161745 0 0.0
.text 1679042 1679042 0 0.0
ota-provider-app debug (read only) 1691233 1691233 0 0.0
(read/write) 80560 80560 0 0.0
.bss 41152 41152 0 0.0
.data 1096 1096 0 0.0
.data.rel.ro 32808 32808 0 0.0
.dynamic 608 608 0 0.0
.got 4240 4240 0 0.0
.init 27 27 0 0.0
.init_array 616 616 0 0.0
.rodata 149414 149414 0 0.0
.text 1423778 1423778 0 0.0
ota-requestor-app debug (read only) 1696529 1696529 0 0.0
(read/write) 83512 83512 0 0.0
.bss 42464 42464 0 0.0
.data 1128 1128 0 0.0
.data.rel.ro 34616 34616 0 0.0
.dynamic 592 592 0 0.0
.got 4032 4032 0 0.0
.init 27 27 0 0.0
.init_array 624 624 0 0.0
.rodata 144695 144695 0 0.0
.text 1435042 1435042 0 0.0
shell debug (read only) 2283249 2283249 0 0.0
(read/write) 141360 141360 0 0.0
.bss 62016 62016 0 0.0
.data 768 768 0 0.0
.data.rel.ro 72896 72896 0 0.0
.dynamic 592 592 0 0.0
.got 4160 4160 0 0.0
.init 27 27 0 0.0
.init_array 904 904 0 0.0
.rodata 204754 204754 0 0.0
.text 1922498 1922498 0 0.0
thermostat-no-ble arm64 (read only) 2121884 2121884 0 0.0
(read/write) 140705 140705 0 0.0
.bss 57745 57745 0 0.0
.data 952 952 0 0.0
.data.rel.ro 74880 74880 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 131068 131068 0 0.0
.text 1772864 1772864 0 0.0
tv-app debug (read only) 2512505 2512505 0 0.0
(read/write) 139512 139512 0 0.0
.bss 57248 57248 0 0.0
.data 3104 3104 0 0.0
.data.rel.ro 73144 73144 0 0.0
.dynamic 592 592 0 0.0
.got 4520 4520 0 0.0
.init 27 27 0 0.0
.init_array 880 880 0 0.0
.rodata 193132 193132 0 0.0
.text 2146498 2146498 0 0.0
mbed all-clusters-app CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 2386272 2386272 0 0.0
.bss 188964 188964 0 0.0
.data 5280 5280 0 0.0
.text 1348872 1348872 0 0.0
lighting-app CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 2347184 2347184 0 0.0
.bss 181072 181072 0 0.0
.data 5592 5592 0 0.0
.text 1309784 1309784 0 0.0
lock-app CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 2311176 2311176 0 0.0
.bss 180960 180960 0 0.0
.data 5576 5576 0 0.0
.text 1273776 1273776 0 0.0
pigweed-app CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 1139712 1139712 0 0.0
.bss 11756 11756 0 0.0
.data 4368 4368 0 0.0
.text 103096 103096 0 0.0
shell CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 2301508 2301508 0 0.0
.bss 178244 178244 0 0.0
.data 5392 5392 0 0.0
.text 1264080 1264080 0 0.0
nrfconnect lighting-app nrf52840dk_nrf52840 (read/write) 994391 994391 0 0.0
bss 120540 120540 0 0.0
rodata 117092 117092 0 0.0
text 677892 677892 0 0.0
nrf52840dk_nrf52840+rpc (read/write) 976267 976267 0 0.0
bss 116396 116396 0 0.0
rodata 108480 108480 0 0.0
text 672960 672960 0 0.0
nrf52840dongle_nrf52840 (read/write) 1011043 1011043 0 0.0
bss 121904 121904 0 0.0
rodata 115932 115932 0 0.0
text 683344 683344 0 0.0
nrf5340dk_nrf5340_cpuapp (read/write) 903830 903830 0 0.0
bss 117104 117104 0 0.0
rodata 110384 110384 0 0.0
text 595576 595576 0 0.0
lock-app nrf52840dk_nrf52840 (read/write) 926495 926495 0 0.0
bss 118880 118880 0 0.0
rodata 105444 105444 0 0.0
text 623712 623712 0 0.0
nrf5340dk_nrf5340_cpuapp (read/write) 836766 836766 0 0.0
bss 115472 115472 0 0.0
rodata 98648 98648 0 0.0
text 542172 542172 0 0.0
pigweed-app nrf52840dk_nrf52840 (read/write) 541779 541779 0 0.0
bss 52588 52588 0 0.0
rodata 50048 50048 0 0.0
text 376940 376940 0 0.0
pump-app nrf52840dk_nrf52840 (read/write) 929115 929115 0 0.0
bss 118632 118632 0 0.0
rodata 105912 105912 0 0.0
text 626048 626048 0 0.0
pump-controller-app nrf52840dk_nrf52840 (read/write) 924079 924079 0 0.0
bss 118632 118632 0 0.0
rodata 104916 104916 0 0.0
text 621988 621988 0 0.0
shell nrf52840dk_nrf52840 (read/write) 802571 802571 0 0.0
bss 110968 110968 0 0.0
rodata 78480 78480 0 0.0
text 535544 535544 0 0.0
p6 all-clusters-app default (read/write) 2447200 2447200 0 0.0
.bss 117124 117124 0 0.0
.data 2568 2568 0 0.0
.text 1405464 1405464 0 0.0
light-app default (read/write) 2352496 2352496 0 0.0
.bss 106268 106268 0 0.0
.data 2432 2432 0 0.0
.text 1310760 1310760 0 0.0
lock-app default (read/write) 2317688 2317688 0 0.0
.bss 105980 105980 0 0.0
.data 2392 2392 0 0.0
.text 1275952 1275952 0 0.0
qpg lighting-app qpg6105+debug (read only) 579272 579272 0 0.0
(read/write) 146936 146936 0 0.0
.bss 88120 88120 0 0.0
.data 1084 1084 0 0.0
.text 573952 573952 0 0.0
lock-app qpg6105+debug (read only) 525312 525312 0 0.0
(read/write) 146936 146936 0 0.0
.bss 87560 87560 0 0.0
.data 1020 1020 0 0.0
.text 519992 519992 0 0.0
persistent-storage-app qpg6105+debug (read only) 107140 107140 0 0.0
(read/write) 146940 146940 0 0.0
.bss 38504 38504 0 0.0
.data 288 288 0 0.0
.text 101820 101820 0 0.0
telink lighting-app tlsr9518adk80d (read/write) 857886 857886 0 0.0
bss 88476 88476 0 0.0
noinit 37160 37160 0 0.0
text 601180 601180 0 0.0

@mrjerryjohns
Copy link
Contributor

No matter which default you pick, you're going to be in the wrong. Might as well pick the default that does the most good...

Approved!

@yunhanw-google
Copy link
Contributor

yunhanw-google commented Feb 3, 2022

Looks like thread test fails in cirque with this change
[1643927284.211125][4351:4356] CHIP:IN: Sending encrypted msg 0x7ffff3b32180 with MessageCounter:7292873 to 0x0000000000000001 (1) at monotonic time: 1584815 msec
[1643927284.211165][4351:4356] CHIP:EM: Flushed pending ack for MessageCounter:2355066 on exchange 37324i
ERROR:NetworkCommissioning:InteractionModelError: Failure (0x1)
Traceback (most recent call last):
File "/home/runner/work/connectedhomeip/connectedhomeip/src/controller/python/test/test_scripts/network_commissioning.py", line 245, in run
await self.test_thread(endpoint)
File "/home/runner/work/connectedhomeip/connectedhomeip/src/controller/python/test/test_scripts/network_commissioning.py", line 166, in test_thread
res = await self._devCtrl.SendCommand(nodeid=self._nodeid, endpoint=endpointId, payload=req)
File "/usr/local/lib/python3.8/dist-packages/chip/ChipDeviceCtrl.py", line 540, in SendCommand
return await future
chip.interaction_model.InteractionModelError: InteractionModelError: Failure (0x1)

See the log from all-cluster-app

[1643927284.109888][68:68] CHIP:DMG: InvokeRequestMessage =
[1643927284.109978][68:68] CHIP:DMG: {
[1643927284.110000][68:68] CHIP:DMG: suppressResponse = false,
[1643927284.110009][68:68] CHIP:DMG: timedRequest = false,
[1643927284.110016][68:68] CHIP:DMG: InvokeRequests =
[1643927284.110027][68:68] CHIP:DMG: [
[1643927284.110035][68:68] CHIP:DMG: CommandDataIB =
[1643927284.110047][68:68] CHIP:DMG: {
[1643927284.110053][68:68] CHIP:DMG: CommandPathIB =
[1643927284.110062][68:68] CHIP:DMG: {
[1643927284.110066][68:68] CHIP:DMG: EndpointId = 0x1,
[1643927284.110080][68:68] CHIP:DMG: ClusterId = 0x31,
[1643927284.110087][68:68] CHIP:DMG: CommandId = 0x0,
[1643927284.110095][68:68] CHIP:DMG: },
[1643927284.110104][68:68] CHIP:DMG:
[1643927284.110111][68:68] CHIP:DMG: CommandData =
[1643927284.110118][68:68] CHIP:DMG: {
[1643927284.110127][68:68] CHIP:DMG: 0x0 = [
[1643927284.110134][68:68] CHIP:DMG:
[1643927284.110142][68:68] CHIP:DMG: ]
[1643927284.110149][68:68] CHIP:DMG: 0x1 = 0,
[1643927284.110171][68:68] CHIP:DMG: },
[1643927284.110177][68:68] CHIP:DMG: },
[1643927284.110187][68:68] CHIP:DMG:
[1643927284.110193][68:68] CHIP:DMG: ],
[1643927284.110203][68:68] CHIP:DMG:
[1643927284.110210][68:68] CHIP:DMG: InteractionModelRevision = 1
[1643927284.110216][68:68] CHIP:DMG: },
[1643927284.110237][68:68] CHIP:DMG: AccessControl: checking f=1 a=c s=0x000000000001B669 t= c=0x0000_0031 e=1 p=o
[1643927284.110251][68:68] CHIP:DMG: Received command for Endpoint=1 Cluster=0x0000_0031 Command=0x0000_0000
[1643927284.110268][68:68] CHIP:DMG: ICR moving to [AddingComm]
[1643927284.110295][68:68] CHIP:DMG: ICR moving to [AddedComma]
[1643927284.110304][68:68] CHIP:ZCL: Failed to dispatch command, TLVError=../../zzz_generated/app-common/app-common/zap-generated/cluster-objects.cpp:7555: Success
[1643927284.110313][68:68] CHIP:DMG: Decreasing reference count for CommandHandler, remaining 0
[1643927284.110322][68:68] CHIP:EM: Piggybacking Ack for MessageCounter:7292872 on exchange: 37324r

it seems it fails to scan thread network...

@yunhanw-google
Copy link
Contributor

yunhanw-google commented Feb 3, 2022

When test code do
res = await self._devCtrl.ReadAttribute(nodeid=self._nodeid, attributes=[
(endpointId,
Clusters.NetworkCommissioning.Attributes.ConnectMaxTimeSeconds),
(endpointId,
Clusters.NetworkCommissioning.Attributes.ScanMaxTimeSeconds),
(endpointId, Clusters.NetworkCommissioning.Attributes.MaxNetworks),
(endpointId, Clusters.NetworkCommissioning.Attributes.FeatureMap)],
returnClusterObject=True)

with this PR, it returns
INFO:NetworkCommissioning:The interface supports 0 networks.
INFO:NetworkCommissioning:ScanNetworks should take no more than 0 seconds.
INFO:NetworkCommissioning:ConnectNetwork should take no more than 0 seconds.
INFO:NetworkCommissioning:The feature map of this endpoint is 2.
INFO:NetworkCommissioning:Finished getting basic information of the endpoint

It seems thread scan network don't work. #14713 mentioned thread scan has not yet been implemented....
It seem before this change, Clusters.NetworkCommissioning.Attributes.MaxNetworks is 1, after this change, Clusters.NetworkCommissioning.Attributes.MaxNetworks becomes 0 in all-cluster-app

@yunhanw-google
Copy link
Contributor

yunhanw-google commented Feb 4, 2022

In current master branch, cirque thread test is using Endpoint0 for thread commissioning test
with this change, it seems endpoint 1 is also configured with THREAD_NETWORK_FEATURE_MAP, but this endpoint1 has not yet been configured right in all-cluster-app with right thread support.
In master,
the good log is
INFO:NetworkCommissioning:{0: {<class 'chip.clusters.Objects.NetworkCommissioning'>: NetworkCommissioning(maxNetworks=None, networks=None, scanMaxTimeSeconds=None, connectMaxTimeSeconds=None, interfaceEnabled=None, lastNetworkingStatus=None, lastNetworkID=None, lastConnectErrorValue=None, serverGeneratedCommandList=None, clientGeneratedCommandList=None, attributeList=None, featureMap=2, clusterRevision=None)}, 1: {<class 'chip.clusters.Objects.NetworkCommissioning'>: NetworkCommissioning(maxNetworks=None, networks=None, scanMaxTimeSeconds=None, connectMaxTimeSeconds=None, interfaceEnabled=None, lastNetworkingStatus=None, lastNetworkID=None, lastConnectErrorValue=None, serverGeneratedCommandList=None, clientGeneratedCommandList=None, attributeList=None, featureMap=0, clusterRevision=None)}}
INFO:NetworkCommissioning:Endpoint 0 is configured as Thread network, run Thread commissioning test.
...
INFO:NetworkCommissioning:Got response: NetworkCommissioning.Commands.ConnectNetworkResponse(networkingStatus=<NetworkCommissioningStatus.kSuccess: 0>, debugText='', errorValue=0)
INFO:NetworkCommissioning:Device connected to a network.
INFO:NetworkCommissioning:Skip endpoint 1 with featureMap 0

the bad log is
[1643938870.807715][4351:4356] CHIP:EM: Flushed pending ack for MessageCounter:10438479 on exchange 58048i
INFO:NetworkCommissioning:{0: {<class 'chip.clusters.Objects.NetworkCommissioning'>: NetworkCommissioning(maxNetworks=None, networks=None, scanMaxTimeSeconds=None, connectMaxTimeSeconds=None, interfaceEnabled=None, lastNetworkingStatus=None, lastNetworkID=None, lastConnectErrorValue=None, serverGeneratedCommandList=None, clientGeneratedCommandList=None, attributeList=None, featureMap=2, clusterRevision=None)}, 1: {<class 'chip.clusters.Objects.NetworkCommissioning'>: NetworkCommissioning(maxNetworks=None, networks=None, scanMaxTimeSeconds=None, connectMaxTimeSeconds=None, interfaceEnabled=None, lastNetworkingStatus=None, lastNetworkID=None, lastConnectErrorValue=None, serverGeneratedCommandList=None, clientGeneratedCommandList=None, attributeList=None, featureMap=2, clusterRevision=None)}}
...
INFO:NetworkCommissioning:Endpoint 0 is configured as Thread network, run Thread commissioning test.
...
INFO:NetworkCommissioning:Got response: NetworkCommissioning.Commands.ConnectNetworkResponse(networkingStatus=<NetworkCommissioningStatus.kSuccess: 0>, debugText='', errorValue=0)
INFO:NetworkCommissioning:Device connected to a network.
INFO:NetworkCommissioning:Endpoint 1 is configured as Thread network, run Thread commissioning test.

the code is here
async def run(self):
try:
endpoints = await self._devCtrl.ReadAttribute(nodeid=self._nodeid, attributes=[(Clusters.NetworkCommissioning.Attributes.FeatureMap)], returnClusterObject=True)
logger.info(endpoints)
for endpoint, obj in endpoints.items():
clus = obj[Clusters.NetworkCommissioning]
if clus.featureMap == WIFI_NETWORK_FEATURE_MAP:
logger.info(
f"Endpoint {endpoint} is configured as WiFi network, run WiFi commissioning test.")
await self.test_wifi(endpoint)
elif clus.featureMap == THREAD_NETWORK_FEATURE_MAP:
logger.info(
f"Endpoint {endpoint} is configured as Thread network, run Thread commissioning test.")
await self.test_thread(endpoint)
else:
logger.info(
f"Skip endpoint {endpoint} with featureMap {clus.featureMap}")

So do we allow network commissioning cluster's thread feature is enabled in two endpoints? From the log, if the device has been commissioned with thread network, it looks like not right to commissioning the thread network using another endpoint in same devce.

So the workaround is that once one endpint's thread commisioning is complete, then skip the thread commissioning for another endpoint.

…y we have 2 of them, likely they do not work
@andy31415
Copy link
Contributor Author

Thank you @yunhanw-google - I did not realize there were 2 endpoints with network configuration. Not sure what that even means and it seems unlikely that that is supported. I will set the featuremap on that endpoint to 0 and see if cirque passes.

@andy31415 andy31415 merged commit a737608 into project-chip:master Feb 4, 2022
TE-N-ElvenWang added a commit to TE-N-ElvenWang/connectedhomeip that referenced this pull request Mar 15, 2022
For issue project-chip#15261 the Linux lighting app failed to be commission by
chip-tool pairing ble-wifi command.
Based on the message in project-chip#14751, the Linux platform intented to support
WiFi network by default instead Thread.

This patch add Network Commissioning cluster setup for WiFi device for
lighting-app.

Signed-off-by: Haoran Wang <[email protected]>
TE-N-ElvenWang added a commit to TE-N-ElvenWang/connectedhomeip that referenced this pull request Mar 15, 2022
For issue project-chip#15261 the Linux lighting app failed to be commission by
chip-tool pairing ble-wifi command.
Based on the message in project-chip#14751, the Linux platform intented to
support
WiFi network by default instead Thread.

This patch add Network Commissioning cluster setup for WiFi device for
thermostat-app.

Signed-off-by: Haoran Wang <[email protected]>
TE-N-ElvenWang added a commit to TE-N-ElvenWang/connectedhomeip that referenced this pull request Mar 15, 2022
For issue project-chip#15261 the Linux lighting app failed to be commission by
chip-tool pairing ble-wifi command.
Based on the message in project-chip#14751, the Linux platform intented to support
WiFi network by default instead Thread.

This patch add Network Commissioning cluster setup for WiFi device for
lighting-app.

Signed-off-by: Haoran Wang <[email protected]>
TE-N-ElvenWang added a commit to TE-N-ElvenWang/connectedhomeip that referenced this pull request Mar 15, 2022
For issue project-chip#15261 the Linux lighting app failed to be commission by
chip-tool pairing ble-wifi command.
Based on the message in project-chip#14751, the Linux platform intented to
support
WiFi network by default instead Thread.

This patch add Network Commissioning cluster setup for WiFi device for
thermostat-app.

Signed-off-by: Haoran Wang <[email protected]>
TE-N-ElvenWang added a commit to TE-N-ElvenWang/connectedhomeip that referenced this pull request Mar 17, 2022
For issue project-chip#15261 the Linux lighting app failed to be commission by
chip-tool pairing ble-wifi command.
Based on the message in project-chip#14751, the Linux platform intented to support
WiFi network by default instead Thread.

This patch add Network Commissioning cluster setup for WiFi device for
lighting-app.

Signed-off-by: Haoran Wang <[email protected]>
TE-N-ElvenWang added a commit to TE-N-ElvenWang/connectedhomeip that referenced this pull request Mar 17, 2022
For issue project-chip#15261 the Linux lighting app failed to be commission by
chip-tool pairing ble-wifi command.
Based on the message in project-chip#14751, the Linux platform intented to
support
WiFi network by default instead Thread.

This patch add Network Commissioning cluster setup for WiFi device for
thermostat-app.

Signed-off-by: Haoran Wang <[email protected]>
andy31415 pushed a commit that referenced this pull request Mar 21, 2022
* Add Network Commissioning cluster setup for lighting app Linux

For issue #15261 the Linux lighting app failed to be commission by
chip-tool pairing ble-wifi command.
Based on the message in #14751, the Linux platform intented to support
WiFi network by default instead Thread.

This patch add Network Commissioning cluster setup for WiFi device for
lighting-app.

Signed-off-by: Haoran Wang <[email protected]>

* Add Network Commissioning cluster setup for thermostat app Linux

For issue #15261 the Linux lighting app failed to be commission by
chip-tool pairing ble-wifi command.
Based on the message in #14751, the Linux platform intented to
support
WiFi network by default instead Thread.

This patch add Network Commissioning cluster setup for WiFi device for
thermostat-app.

Signed-off-by: Haoran Wang <[email protected]>
andrei-menzopol pushed a commit to andrei-menzopol/connectedhomeip that referenced this pull request Apr 14, 2022
…16222)

* Add Network Commissioning cluster setup for lighting app Linux

For issue project-chip#15261 the Linux lighting app failed to be commission by
chip-tool pairing ble-wifi command.
Based on the message in project-chip#14751, the Linux platform intented to support
WiFi network by default instead Thread.

This patch add Network Commissioning cluster setup for WiFi device for
lighting-app.

Signed-off-by: Haoran Wang <[email protected]>

* Add Network Commissioning cluster setup for thermostat app Linux

For issue project-chip#15261 the Linux lighting app failed to be commission by
chip-tool pairing ble-wifi command.
Based on the message in project-chip#14751, the Linux platform intented to
support
WiFi network by default instead Thread.

This patch add Network Commissioning cluster setup for WiFi device for
thermostat-app.

Signed-off-by: Haoran Wang <[email protected]>
@andy31415 andy31415 deleted the network-featuremap-default-thread branch June 14, 2023 12:25
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