AnsweredAssumed Answered

Network reliablity issues with KW41Z Thread example code

Question asked by Aaron DeMarre on Dec 3, 2018
Latest reply on Dec 5, 2018 by Estephania Martinez

I am having issues keeping a small Thread network running reliably. I have one evaluation board running the REED example from the 2.2.0 SDK, and several boards running the Low Power End Device (Sleepy End Device / SED) example.

 

My goal is to get the sleepy end devices to report their temperature when they wake up from the deep sleep timer, then go back to sleep. This runs reliably for a while, then after a random amount of time, an end device will stop reporting. The end device stops sending COAP messages, but the sniffer shows it is still polling on the IEEE 802.15.4 layer. The more sleepy end devices I have, the quicker the network will fail.

 

The changes I have made are small, I have added a case to APP_HandleLowPowerOnIdle() that queues the APP_ReportTemp() function on the Thread message queue to fire it on wakeup without a key press. This works as expected and reports every 3 seconds for awhile, but the end devices start to drop out and stop reporting.

 

static void APP_HandleLowPowerOnIdle(void)
{
    if( PWR_CheckIfDeviceCanGoToSleep() )
    {
        PWRLib_WakeupReason_t wakeupReason;
        wakeupReason = PWR_EnterLowPower();
        if( wakeupReason.Bits.FromKeyBoard )
        {
            /* Protection to the LLWD pin enabled on both edges */
            static bool_t wakeUpFlag = FALSE;
            if(TRUE == wakeUpFlag)
            {
                wakeUpFlag = FALSE;
                App_SedWakeUpFromKeyBoard();
            }
            else
            {
                wakeUpFlag = TRUE;
            }
            PWR_AllowDeviceToSleep();
        }
        else if ( wakeupReason.AllBits != 0 )
        {
             App_SedWakeUpFromSleep();
        }
    }
}

 

void App_SedWakeUpFromSleep
(
    void
)
{
     (void)NWKU_SendMsg(APP_ReportTemp, NULL, mpAppThreadMsgQueue);
}

 

Is my approach wrong? I see that the REED code is limited to 5 COAP sessions, and I need to change this to go beyond 5 SEDs, but end devices start dropping out very quickly with more than 5 SEDs.

Outcomes