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.

CC2538: Sleep mode and reports

Part Number: CC2538
Other Parts Discussed in Thread: Z-STACK,

Hello,

I have been working on an application code base on the sampleLight example from Z-Stack Home 1.2.2a.44539. At first I tried putting my ZED to sleep by enabling the POWER SAVING flag in the compiler option but that never seemed to put the device to sleep. So I decided to do it on my own. I set an event to make the device sleep every 30 seconds for 1 minute (the durations used are for testing purposes) and the code is like this. My problem is that the reports to the router are often not send and I am not sure why. The reports are set to fire up every 60 seconds. What could be the issue for it ? Am I omitting something ?

if(events & MEAZON_MISC_WATER_SLEEP_TIMEOUT_EVT)
    {
      if ( MAC_PwrOffReq(MAC_PWR_SLEEP_DEEP) == MAC_SUCCESS )
      {    
        ui32Val = SleepModeTimerCountGet();
        SleepModeTimerCompareSet(ui32Val + 274285);
        
        HAL_TURN_OFF_NWK_LED();
        
        SysCtrlDeepSleep();

        /* Update the osal timers and clock with the sleep time */
        osalAdjustTimer(60000);
        
        MAC_PwrOnReq();
        
      }
      
      osal_start_timerEx( meazonMiscTaskID, MEAZON_MISC_WATER_SLEEP_TIMEOUT_EVT, 30000 );
      
      return ( events ^ MEAZON_MISC_WATER_SLEEP_TIMEOUT_EVT );
}

Thank you for your time 

Nomikos Panagiotis