Network reliablity issues with KW41Z Thread example code

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Network reliablity issues with KW41Z Thread example code

1,007 Views
ademarre
Contributor I

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.

Labels (3)
0 Kudos
3 Replies

787 Views
jc_pacheco
NXP Employee
NXP Employee

Have you confirmed that the issue is that you are unable to open a new CoAP session?

Are you sending the CoAP packet as a multicast or unicast? Keep in mind that, if you are requesting an Ack response (ConPost, instead of NonPost) the CoAP session will remain open until an Ack packet is received, and you may or may not be receiving the ack responses depending on the poll behavior. I'd recommend you to send NonPost packets to make sure the CoAP session is closed right after the CoAP packet was sent and that you don't run out of available sessions. Also, don't forget to call "PWR_AllowDeviceToSleep();" after waking up... this function will not automatically send the device to sleep but will let the application to go to sleep during idle state and continue with the expected behavior.

0 Kudos

787 Views
ademarre
Contributor I

I believe we are sending multicast, using the 'in6addr_realmlocal_allrouters' from network_utils.h. I think we are sending this as a NonPost, but I will double check this.

0 Kudos

787 Views
estephania_mart
NXP TechSupport
NXP TechSupport

Hello, 

Which IDE are you working on ? Are those the only things you changed? 

Regards 

Estephania 

0 Kudos