From 57623244d7f14988d88de29435400def30f34dda Mon Sep 17 00:00:00 2001 From: Alexei Chetroi Date: Thu, 6 Feb 2025 21:40:12 -0500 Subject: [PATCH 1/4] Adjust number of rejoin-attempts to 128 --- MLight/MLight.slcp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/MLight/MLight.slcp b/MLight/MLight.slcp index 02e532a..36bdd3f 100644 --- a/MLight/MLight.slcp +++ b/MLight/MLight.slcp @@ -134,7 +134,11 @@ configuration: condition: - zigbee_end_device_support - name: EMBER_AF_PLUGIN_END_DEVICE_SUPPORT_WAKE_TIMEOUT_SECONDS - value: 1.5f + value: 3 + condition: + - zigbee_end_device_support + - name: EMBER_AF_REJOIN_ATTEMPTS_MAX + value: 128 condition: - zigbee_end_device_support - name: SL_IOSTREAM_USART_VCOM_RESTRICT_ENERGY_MODE_TO_ALLOW_RECEPTION From f0599622f9162a6cc37cb023c0c6cc65b279380c Mon Sep 17 00:00:00 2001 From: Alexei Chetroi Date: Thu, 6 Feb 2025 22:07:46 -0500 Subject: [PATCH 2/4] If parent is lost, rely on end-device-support to rejoin --- MLight/mods/device-nwk-join-control.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/MLight/mods/device-nwk-join-control.c b/MLight/mods/device-nwk-join-control.c index 45d79b9..1b4b602 100644 --- a/MLight/mods/device-nwk-join-control.c +++ b/MLight/mods/device-nwk-join-control.c @@ -115,9 +115,9 @@ void emberAfStackStatusCallback(EmberStatus status) EmberNetworkStatus nwkState = emberAfNetworkState(); sl_zigbee_app_debug_println("%d (dnjc) Stack status=0x%X, nwkState=%d", TIMESTAMP_MS, status, nwkState); + bool is_moving; switch (nwkState) { case EMBER_NO_NETWORK: - case EMBER_JOINED_NETWORK_NO_PARENT: // Keep trying finding the network sl_zigbee_event_set_inactive( &dnjcState.dnjcEvent ); dnjcState.smPostTransition = _event_state_indicate_startup_nwk; @@ -125,6 +125,12 @@ void emberAfStackStatusCallback(EmberStatus status) dnjcState.leavingNwk = false; // leave has completed. stopIdentifying(); break; + + case EMBER_JOINED_NETWORK_NO_PARENT: + is_moving = emberAfMoveInProgressCallback(); + sl_zigbee_app_debug_println("EMBER_JOINED_NETWORK_NO_PARENT, is_moving=%d", is_moving); + break; + default: break; } From 90fa61ba822355709327de1b2dbdc798f3852b3e Mon Sep 17 00:00:00 2001 From: Alexei Chetroi Date: Fri, 7 Feb 2025 19:35:29 -0500 Subject: [PATCH 3/4] No access to isMoving --- MLight/mods/device-nwk-join-control.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/MLight/mods/device-nwk-join-control.c b/MLight/mods/device-nwk-join-control.c index 1b4b602..8723aa1 100644 --- a/MLight/mods/device-nwk-join-control.c +++ b/MLight/mods/device-nwk-join-control.c @@ -115,7 +115,6 @@ void emberAfStackStatusCallback(EmberStatus status) EmberNetworkStatus nwkState = emberAfNetworkState(); sl_zigbee_app_debug_println("%d (dnjc) Stack status=0x%X, nwkState=%d", TIMESTAMP_MS, status, nwkState); - bool is_moving; switch (nwkState) { case EMBER_NO_NETWORK: // Keep trying finding the network @@ -127,8 +126,7 @@ void emberAfStackStatusCallback(EmberStatus status) break; case EMBER_JOINED_NETWORK_NO_PARENT: - is_moving = emberAfMoveInProgressCallback(); - sl_zigbee_app_debug_println("EMBER_JOINED_NETWORK_NO_PARENT, is_moving=%d", is_moving); + sl_zigbee_app_debug_println("EMBER_JOINED_NETWORK_NO_PARENT"); break; default: From 00481cf257f36f886475fafdd357403a5208916c Mon Sep 17 00:00:00 2001 From: Alexei Chetroi Date: Fri, 7 Feb 2025 20:19:31 -0500 Subject: [PATCH 4/4] Postpone Network indicaiton to 5s after a reboot --- MLight/mods/device-nwk-join-control.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MLight/mods/device-nwk-join-control.h b/MLight/mods/device-nwk-join-control.h index 4e88bfd..61df887 100644 --- a/MLight/mods/device-nwk-join-control.h +++ b/MLight/mods/device-nwk-join-control.h @@ -2,7 +2,7 @@ #define _DEVICE_NWK_JOIN_CONTROL_H_ #ifndef DNJC_STARTUP_STATUS_DELAY_MS -#define DNJC_STARTUP_STATUS_DELAY_MS 3000 +#define DNJC_STARTUP_STATUS_DELAY_MS 5000 #endif #include