CC2530 low-power terminal keeps reconnecting to the network power consumption problem

In the past few days, I have been playing TI's CC2530 and testing the low-power mode of its ZIGBEE protocol stack. TI has indeed spent a lot of effort on this protocol stack and the operating system OSAL it supports, which is very easy to use. After a few simple configurations, you can enter the low-power mode, and data acquisition and communication are normal.

When I thought it was OK, I turned off the coordinator. After a while, I turned it on again and found that the terminal could not be connected. I measured the battery voltage of the terminal (CR1220, 40mA/H), and it was dead; the problem is The root cause is that the terminal finds that the coordinator is offline and keeps reconnecting to the network. It must be known that the reconnection process consumes a lot of power. How to solve? I found information on the Internet as follows:

/////////////////////////////////////////////////////////////////////////////////

I have researched this. If DEV_HOLD is not configured, the device will be connected to the network until there is a network. If you want the device to reconnect to the network after a period of time, you can refer to the following method (it should be noted that I have only verified that the device will be connected to the network according to the set time, which does not mean that the power consumption is reduced).
#define NWK_INIT_fAIL_MAX 5
UINT16 ZDApp_event_loop( uint8 task_id, UINT16 events )
{
    ...
  if ( events & ZDO_NETWORK_INIT )
  {
    static uint8 initFailCounter = 0;        
    // Initialize apps and start the network
    devState = DEV_INIT;
    osal_set_event( ZDAppTaskID, ZDO_STATE_CHANGE_EVT )
        ; by asura 20140901
        if(initFailCounter++ >= NWK_INIT_fAIL_MAX )
    {
          osal_start_timerEx( ZDAppTaskID, ZDO_NETWORK_INIT, 60000 );
          initFailCounter = 0;
          return(events ^ ZDO_NETWORK_INIT);
        }     ZDO_StartDevice( (uint8)ZDO_Config_Node_Descriptor.LogicalType, devStartMode,                      DEFAULT_BEACON_ORDER, DEFAULT_SUPERFRAME_ORDER );     // Return unprocessed events     return (events ^ ZDO_NETWORK_INIT);   } ...... } After this change, the device will first try to add the network 5 times when it is powered on. If it fails, then it will get up and screen every 1 minute. In addition, since the second parameter of osal_start_timerEx() is of type uint16, which limits the size of the delay time, I would like to ask, how to set a delay of 5 minutes or longer?
        










//////////////////////////////////////////////////////

Another netizen replied: The time parameter of the osal_start_timerEx function in the latest protocol stack is already 32 bits, and a longer timer can be defined.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325544901&siteId=291194637