This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

cc2530 entering power saving mode before joining network

Other Parts Discussed in Thread: CC2530

Hi,

I am trying to find out how to make a CC2530 EndDevice enter power saving mode (timered) before it joins any network.

With ZStack 2.5.0 and the right compilation flags, I was able to have the device entering timer based sleep mode between polling after it joins a network.  However, prior to joining any network, the device stays at full power almost all the time, even when NWK_RETRY_DELAY is set to very long period of time (5 or 10 sec). 

Without modifying halSleep() or implmenting something my own, does ZStack support any "clean" way of putting the SoC to sleep between network discovery operations?

Thanks in advance,

LJ

  • Hi LJ, 

    This is an old problem, The users cases for the TI Zstack are not setup for devices that roam in and out of networks coverage. I had to add my own code to the ZDApp to handle this user scenario. 

    To solve your problem add the following code to "void ZDApp_Init( uint8 task_id )" function.

      //Set Power Usage type
    #if defined ( POWER_SAVING )
    osal_pwrmgr_device( PWRMGR_BATTERY );
    #else
    osal_pwrmgr_device( PWRMGR_ALWAYS_ON );
    #endif
    
    
    Darren
  • Hi Darren,

    Thank you very much for the answer.

    However, it did not do it for me.  Earlier I had also tried to set power manager to battery in my application's init function.  Not effective either. 

    For the 2.5.0 ZStack, what prevents the device from entering sleep before joining a network seems to be that in halSleep function MAC_PwrOffReq(MAC_PWR_SLEEP_DEEP) keeps returning unsuccessful.  And since this function is distributed as binary, I was not able to trace any deeper into the problem.

    What version of the ZStack did you successfully applied that trick?

    Actually I was not even trying to deal with roaming scenarios, just to prevent end devices from draining out their battery juice looking for their router after the the router malfunctions.

    LJ

     

  • Hi LJ,

    I have used this technique for Zstack 2.3.1 and Zstack 2.5.0.

    I think you will find with "osal_pwrmgr_device( PWRMGR_BATTERY );" set the device will be sleeping between network scans.  The problem is that it continuously scans the channels  for networks very fast. Faster that the normal data polling rate, therefor draining the batteries very fast.

    I have written by own code that will stop the network scanning process, allowing me to duty cycle the network scanning process. I run a duty cycle of 15sec scanning to 15 minutes idle(sleeping) when a device is not associated with a network.   

    Look at "ZDApp_StopJoiningCycle()" and "ZDApp_StartJoiningCycle" and possibly "ZDOInitDevice();" to come up with your own algorithm to save energy that meets your requirements.

    Darren

  • Darren,

    Yep. That is it. Got it working.  Thank you so much!

    LJ