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

Add network retry and case failsafe timer to AutoCommissioner #23209

Merged
merged 5 commits into from
Nov 22, 2022

Conversation

chrisdecenzo
Copy link
Contributor

Fixes #23208

  1. There is no simple way to reset the failsafe timer during commissioning
  • When user input is needed during commissioning (ex: to select a network, to respond to attestation issues), the failsafe timer must be set to a high value.
  • During this time, it would be useful to have a command to reset the failsafe timer.
  • Prior to CASE (operational discovery), it would be useful to be able to reset the failsafe timer to a smaller value.

This PR adds a command to CHIPDeviceController to reset the failsafe timer. It also adds an optional CASE Failsafe Timer configuration to CommissioningParameters. When set, this will cause the failsafe to be reset to this value prior to operational discovery.

  1. There is no simple way to retry a different network config when the first attempt fails
  • Since its an error, the CHIPDeviceController automatically cleans itself up (cancels commissioning.
  • It would be useful to be able to allow the UX to decide whether to cancel commissioning or to retry with different a network config.

This PR returns the AutoCommissioner back to the kNeedsNetworkCreds stage when either the network config or network enable commands fail, in order to allow the caller to try with a different network. This behavior is only enabled when ScanNetworks is enabled since the kNeedsNetworkCreds stage is only supported when ScanNetworks is enabled.

@github-actions
Copy link

github-actions bot commented Oct 16, 2022

PR #23209: Size comparison from 9f08fc1 to 570dd4c

Increases (1 build for esp32)
platform target config section 9f08fc1 570dd4c change % change
esp32 all-clusters-app m5stack (read/write) 564204 564212 8 0.0
.flash.rodata 314928 314936 8 0.0
Decreases (1 build for esp32)
platform target config section 9f08fc1 570dd4c change % change
esp32 all-clusters-app c3devkit (read only) 1223340 1223338 -2 -0.0
(read/write) 1788302 1788294 -8 -0.0
.flash.rodata 257872 257864 -8 -0.0
.flash.text 1223340 1223338 -2 -0.0
Full report (5 builds for esp32, mbed, nrfconnect)
platform target config section 9f08fc1 570dd4c change % change
esp32 all-clusters-app c3devkit (read only) 1223340 1223338 -2 -0.0
(read/write) 1788302 1788294 -8 -0.0
.dram0.bss 76944 76944 0 0.0
.dram0.data 13840 13840 0 0.0
.flash.rodata 257872 257864 -8 -0.0
.flash.text 1223340 1223338 -2 -0.0
.iram0.text 65204 65204 0 0.0
m5stack (read only) 1233415 1233415 0 0.0
(read/write) 564204 564212 8 0.0
.dram0.bss 82312 82312 0 0.0
.dram0.data 34296 34296 0 0.0
.flash.rodata 314928 314936 8 0.0
.flash.text 1228031 1228031 0 0.0
.iram0.text 123939 123939 0 0.0
mbed lock-app CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 2452168 2452168 0 0.0
.bss 215028 215028 0 0.0
.data 5872 5872 0 0.0
.text 1414812 1414812 0 0.0
nrfconnect all-clusters-app nrf52840dk_nrf52840 (read/write) 1183451 1183451 0 0.0
bss 144441 144441 0 0.0
rodata 144396 144396 0 0.0
text 815708 815708 0 0.0
all-clusters-minimal-app nrf52840dk_nrf52840 (read/write) 1162119 1162119 0 0.0
bss 143668 143668 0 0.0
rodata 135968 135968 0 0.0
text 803600 803600 0 0.0

Copy link
Contributor

@bzbarsky-apple bzbarsky-apple left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This would be a lot clearer as two separate PRs, addressing the two separate issues. It's quite hard to tell which parts here are needed for the fail-safe bits and which parts are needed for the network fallback bits.

@github-actions
Copy link

github-actions bot commented Nov 15, 2022

PR #23209: Size comparison from 6519b91 to 4b15dec

Increases (2 builds for esp32, linux)
platform target config section 6519b91 4b15dec change % change
esp32 all-clusters-app m5stack (read/write) 564412 564420 8 0.0
.flash.rodata 315128 315136 8 0.0
linux chip-tool-ipv6only arm64 (read only) 10433596 10435532 1936 0.0
.rodata 518220 518364 144 0.0
.text 8260020 8261812 1792 0.0
Decreases (6 builds for bl602, bl702, cyw30739, esp32, psoc6)
platform target config section 6519b91 4b15dec change % change
bl602 lighting-app bl602+rpc .text 1090680 1090678 -2 -0.0
bl702 lighting-app bl702 .debug_info 39161306 39161305 -1 -0.0
.text 955516 955514 -2 -0.0
cyw30739 ota-requestor-no-progress-logging cyw930739m2evb_01 (read/write) 543714 543706 -8 -0.0
.app_xip_area 425444 425436 -8 -0.0
esp32 all-clusters-app c3devkit (read only) 1224292 1224290 -2 -0.0
.flash.text 1224292 1224290 -2 -0.0
psoc6 all-clusters-minimal cy8ckit_062s2_43012 .debug_info 26760523 26760522 -1 -0.0
light cy8ckit_062s2_43012 .debug_info 22225724 22225722 -2 -0.0
Full report (20 builds for bl602, bl702, cyw30739, esp32, linux, mbed, nrfconnect, psoc6, qpg)
platform target config section 6519b91 4b15dec change % change
bl602 lighting-app bl602 (read/write) 1375258 1375258 0 0.0
.bss 90041 90041 0 0.0
.data 9984 9984 0 0.0
.text 1059186 1059186 0 0.0
bl602+rpc (read/write) 1421074 1421074 0 0.0
.bss 98081 98081 0 0.0
.data 10376 10376 0 0.0
.text 1090680 1090678 -2 -0.0
bl702 lighting-app bl702 (read only) 3262 3262 0 0.0
(read/write) 1195127 1195127 0 0.0
.bleromro 6296 6296 0 0.0
.bleromrw 124 124 0 0.0
.boot2 688 688 0 0.0
.bss 67166 67166 0 0.0
.bss_psram 30048 30048 0 0.0
.comment 48 48 0 0.0
.data 4048 4048 0 0.0
.debug_abbrev 1523919 1523919 0 0.0
.debug_aranges 132304 132304 0 0.0
.debug_frame 485212 485212 0 0.0
.debug_info 39161306 39161305 -1 -0.0
.debug_line 5271709 5271709 0 0.0
.debug_loc 3367110 3367110 0 0.0
.debug_ranges 360272 360272 0 0.0
.debug_str 3462160 3462160 0 0.0
.hbn 509 509 0 0.0
.hbn_noinit 260 260 0 0.0
.init 342 342 0 0.0
.init_array 144 144 0 0.0
.psram 0 0 0 0.0
.riscv.attributes 47 47 0 0.0
.rodata 116488 116488 0 0.0
.rsvd 3188 3188 0 0.0
.shstrtab 293 293 0 0.0
.stack 2048 2048 0 0.0
.strtab 566531 566531 0 0.0
.symtab 171808 171808 0 0.0
.tcm_data 36 36 0 0.0
.tcmcode 3262 3262 0 0.0
.text 0 0 0 0.0
955516 955514 -2 -0.0
bl702+rpc (read only) 3262 3262 0 0.0
(read/write) 1283267 1283267 0 0.0
.bleromro 6296 6296 0 0.0
.bleromrw 124 124 0 0.0
.boot2 688 688 0 0.0
.bss 75214 75214 0 0.0
.bss_psram 30320 30320 0 0.0
.comment 48 48 0 0.0
.data 4576 4576 0 0.0
.debug_abbrev 1667931 1667931 0 0.0
.debug_aranges 140368 140368 0 0.0
.debug_frame 512416 512416 0 0.0
.debug_info 43430527 43430527 0 0.0
.debug_line 5667078 5667078 0 0.0
.debug_loc 3561346 3561346 0 0.0
.debug_ranges 383296 383296 0 0.0
.debug_str 3859469 3859469 0 0.0
.hbn 509 509 0 0.0
.hbn_noinit 260 260 0 0.0
.init 342 342 0 0.0
.init_array 160 160 0 0.0
.psram 0 0 0 0.0
.riscv.attributes 47 47 0 0.0
.rodata 130120 130120 0 0.0
.rsvd 3188 3188 0 0.0
.shstrtab 293 293 0 0.0
.stack 2048 2048 0 0.0
.strtab 626746 626746 0 0.0
.symtab 189920 189920 0 0.0
.tcm_data 36 36 0 0.0
.tcmcode 3262 3262 0 0.0
.text 0 0 0 0.0
1029212 1029212 0 0.0
cyw30739 light cyw930739m2evb_01 (read/write) 587230 587230 0 0.0
.app_xip_area 463440 463440 0 0.0
.bss 66208 66208 0 0.0
.data 728 728 0 0.0
.rodata 0 0 0 0.0
.text 112 112 0 0.0
lock cyw930739m2evb_01 (read/write) 591338 591338 0 0.0
.app_xip_area 462252 462252 0 0.0
.bss 71496 71496 0 0.0
.data 736 736 0 0.0
.rodata 0 0 0 0.0
.text 112 112 0 0.0
ota-requestor-no-progress-logging cyw930739m2evb_01 (read/write) 543714 543706 -8 -0.0
.app_xip_area 425444 425436 -8 -0.0
.bss 60736 60736 0 0.0
.data 684 684 0 0.0
.rodata 0 0 0 0.0
.text 112 112 0 0.0
esp32 all-clusters-app c3devkit (read only) 1224292 1224290 -2 -0.0
(read/write) 1788614 1788614 0 0.0
.dram0.bss 76944 76944 0 0.0
.dram0.data 13840 13840 0 0.0
.flash.rodata 258184 258184 0 0.0
.flash.text 1224292 1224290 -2 -0.0
.iram0.text 65204 65204 0 0.0
m5stack (read only) 1234187 1234187 0 0.0
(read/write) 564412 564420 8 0.0
.dram0.bss 82320 82320 0 0.0
.dram0.data 34296 34296 0 0.0
.flash.rodata 315128 315136 8 0.0
.flash.text 1228803 1228803 0 0.0
.iram0.text 123939 123939 0 0.0
linux chip-tool-ipv6only arm64 (read only) 10433596 10435532 1936 0.0
(read/write) 706353 706353 0 0.0
.bss 33905 33905 0 0.0
.data 2768 2768 0 0.0
.data.rel.ro 650672 650672 0 0.0
.dynamic 560 560 0 0.0
.got 13912 13912 0 0.0
.init 24 24 0 0.0
.init_array 208 208 0 0.0
.rodata 518220 518364 144 0.0
.text 8260020 8261812 1792 0.0
thermostat-no-ble arm64 (read only) 2392812 2392812 0 0.0
(read/write) 143489 143489 0 0.0
.bss 55329 55329 0 0.0
.data 1816 1816 0 0.0
.data.rel.ro 77096 77096 0 0.0
.dynamic 560 560 0 0.0
.got 5176 5176 0 0.0
.init 24 24 0 0.0
.init_array 440 440 0 0.0
.rodata 144788 144788 0 0.0
.text 2004560 2004560 0 0.0
mbed lock-app CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 2452336 2452336 0 0.0
.bss 215012 215012 0 0.0
.data 5872 5872 0 0.0
.text 1414980 1414980 0 0.0
nrfconnect all-clusters-app nrf52840dk_nrf52840 (read/write) 1187855 1187855 0 0.0
bss 145285 145285 0 0.0
rodata 144516 144516 0 0.0
text 816982 816982 0 0.0
all-clusters-minimal-app nrf52840dk_nrf52840 (read/write) 1167283 1167283 0 0.0
bss 144512 144512 0 0.0
rodata 136304 136304 0 0.0
text 805532 805532 0 0.0
psoc6 all-clusters cy8ckit_062s2_43012 (read only) 841968 841968 0 0.0
(read/write) 1746244 1746244 0 0.0
.ARM.attributes 46 46 0 0.0
.ARM.exidx 8 8 0 0.0
.bss 188712 188712 0 0.0
.comment 204 204 0 0.0
.copy.table 24 24 0 0.0
.cy_m0p_image 6216 6216 0 0.0
.cy_sharedmem 8 8 0 0.0
.data 2664 2664 0 0.0
.debug_abbrev 1235716 1235716 0 0.0
.debug_aranges 110704 110704 0 0.0
.debug_frame 371284 371284 0 0.0
.debug_info 27023893 27023893 0 0.0
.debug_line 3685941 3685941 0 0.0
.debug_loc 3603774 3603774 0 0.0
.debug_ranges 339544 339544 0 0.0
.debug_str 3431051 3431051 0 0.0
.heap 841968 841968 0 0.0
.noinit 148 148 0 0.0
.ramVectors 736 736 0 0.0
.shstrtab 288 288 0 0.0
.stab 156 156 0 0.0
.stabstr 335 335 0 0.0
.stack_dummy 4096 4096 0 0.0
.strtab 570257 570257 0 0.0
.symtab 421440 421440 0 0.0
.text 1546480 1546480 0 0.0
.zero.table 8 8 0 0.0
text 0 0 0 0.0
all-clusters-minimal cy8ckit_062s2_43012 (read only) 842704 842704 0 0.0
(read/write) 1688780 1688780 0 0.0
.ARM.attributes 46 46 0 0.0
.ARM.exidx 8 8 0 0.0
.bss 187976 187976 0 0.0
.comment 204 204 0 0.0
.copy.table 24 24 0 0.0
.cy_m0p_image 6216 6216 0 0.0
.cy_sharedmem 8 8 0 0.0
.data 2664 2664 0 0.0
.debug_abbrev 1227559 1227559 0 0.0
.debug_aranges 110176 110176 0 0.0
.debug_frame 374364 374364 0 0.0
.debug_info 26760523 26760522 -1 -0.0
.debug_line 3706925 3706925 0 0.0
.debug_loc 3591380 3591380 0 0.0
.debug_ranges 338160 338160 0 0.0
.debug_str 3420071 3420071 0 0.0
.heap 842704 842704 0 0.0
.noinit 148 148 0 0.0
.ramVectors 736 736 0 0.0
.shstrtab 288 288 0 0.0
.stab 156 156 0 0.0
.stabstr 335 335 0 0.0
.stack_dummy 4096 4096 0 0.0
.strtab 534346 534346 0 0.0
.symtab 407872 407872 0 0.0
.text 1489752 1489752 0 0.0
.zero.table 0 0 0 0.0
8 8 0 0.0
light cy8ckit_062s2_43012 (read only) 850888 850888 0 0.0
(read/write) 1606956 1606956 0 0.0
.ARM.attributes 46 46 0 0.0
.ARM.exidx 8 8 0 0.0
.bss 180000 180000 0 0.0
.comment 204 204 0 0.0
.copy.table 24 24 0 0.0
.cy_m0p_image 6216 6216 0 0.0
.cy_sharedmem 8 8 0 0.0
.data 2456 2456 0 0.0
.debug_abbrev 1062020 1062020 0 0.0
.debug_aranges 102376 102376 0 0.0
.debug_frame 344676 344676 0 0.0
.debug_info 22225724 22225722 -2 -0.0
.debug_line 3276050 3276050 0 0.0
.debug_loc 3288865 3288865 0 0.0
.debug_ranges 303440 303440 0 0.0
.debug_str 3225606 3225606 0 0.0
.heap 850888 850888 0 0.0
.noinit 148 148 0 0.0
.ramVectors 736 736 0 0.0
.shstrtab 288 288 0 0.0
.stab 156 156 0 0.0
.stabstr 335 335 0 0.0
.stack_dummy 4096 4096 0 0.0
.strtab 470671 470671 0 0.0
.symtab 376240 376240 0 0.0
.text 1416112 1416112 0 0.0
.zero.table 0 0 0 0.0
8 8 0 0.0
lock cy8ckit_062s2_43012 (read only) 845896 845896 0 0.0
(read/write) 1640964 1640964 0 0.0
.ARM.attributes 46 46 0 0.0
.ARM.exidx 8 8 0 0.0
.bss 184976 184976 0 0.0
.comment 204 204 0 0.0
.copy.table 24 24 0 0.0
.cy_m0p_image 6216 6216 0 0.0
.cy_sharedmem 8 8 0 0.0
.data 2472 2472 0 0.0
.debug_abbrev 1063995 1063995 0 0.0
.debug_aranges 102776 102776 0 0.0
.debug_frame 346552 346552 0 0.0
.debug_info 22459348 22459348 0 0.0
.debug_line 3273170 3273170 0 0.0
.debug_loc 3316718 3316718 0 0.0
.debug_ranges 305400 305400 0 0.0
.debug_str 3244977 3244977 0 0.0
.heap 845896 845896 0 0.0
.noinit 148 148 0 0.0
.ramVectors 736 736 0 0.0
.shstrtab 288 288 0 0.0
.stab 156 156 0 0.0
.stabstr 335 335 0 0.0
.stack_dummy 4096 4096 0 0.0
.strtab 473074 473074 0 0.0
.symtab 377936 377936 0 0.0
.text 1445128 1445128 0 0.0
.zero.table 0 0 0 0.0
8 8 0 0.0
qpg lighting-app qpg6105+debug (read/write) 1149312 1149312 0 0.0
.bss 109860 109860 0 0.0
.data 848 848 0 0.0
.text 596412 596412 0 0.0
lock-app qpg6105+debug (read/write) 1115060 1115060 0 0.0
.bss 106332 106332 0 0.0
.data 836 836 0 0.0
.text 562156 562156 0 0.0

chrisdecenzo and others added 2 commits November 21, 2022 21:01
…ssioner (#23516)

* Restyled by whitespace

* Restyled by google-java-format

Co-authored-by: Restyled.io <commits@restyled.io>
@chrisdecenzo chrisdecenzo changed the title Draft: Add network retry and case failsafe timer to AutoCommissioner Add network retry and case failsafe timer to AutoCommissioner Nov 22, 2022
@chrisdecenzo chrisdecenzo merged commit 620ef8f into master Nov 22, 2022
@chrisdecenzo chrisdecenzo deleted the tvapps-android29 branch November 22, 2022 17:10
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.

[Platform] AutoCommissioner gaps (reset failsafe, retry net config)
4 participants