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 + ZED rejoin in EZ Mode

Other Parts Discussed in Thread: CC2531

hello TI

I have CC2531 connected to RPi( Z-STACK-LINUX-GATEWAY:) and work as a ZC

Once Network formed and ZED(which has SampleLight app running) connected to ZC, I remove the ZED.

Now in leave callback at ZED side(ZDO_LeaveInd) I am invoking EZ mode so that my ZED can rejoin the network.

But it go back to reset  after invoking following code in zcl_InvokeEZMode

 if(zclEZModeState != EZMODE_STATE_READY)
  {
 
    
    zcl_SetEZModeError ( EZMODE_ERR_CANCELLED );
    zcl_SetEZModeState ( EZMODE_STATE_FINISH );  // needed to shut down timers, turn off joining, etc...
  
    return;
  }

I check the state of EZ Mode. It is in EZMODE_STATE_IDENTIFYING               

Now please help me to make my ZED to rejoin the ZC in EZ mode.

Regards

SS

  • Hi SS,

    EZ-mode is not for rejoining. If the device is not in the network, EZ-mode does network steering followed by finding and binding. If the device is already in the network, EZ mode will start with finding and binding.

    If what you want is to enable your device to rejoin the network without resetting itself when it is requested to leave with rejoin=1 option, please try the following code. (Add the lines starting with '+' to your code.)

    void ZDApp_LeaveReset( uint8 ra )
    {
      ZDApp_LeaveCtrlSet( ra );
    
    +  APSME_HoldDataRequests( LEAVE_RESET_DELAY);
    +  if ( ZSTACK_ROUTER_BUILD )
    +  {
    +    osal_stop_timerEx( NWK_TaskID, NWK_LINK_STATUS_EVT );
    +    osal_clear_event( NWK_TaskID, NWK_LINK_STATUS_EVT );
    +  }
    +
    +  if ( ra == TRUE )
    +  {
    +    devState = DEV_NWK_DISC;
    +    devStartMode = MODE_REJOIN;
    +    _tmpRejoinState = true;
    +
    +    if (ZG_DEVICE_ENDDEVICE_TYPE)
    +    {
    +      zgPollRate = POLL_RATE;
    +      ZDApp_SavedPollRate = zgPollRate;
    +      NLME_SetPollRate(0);
    +    }
    +
    +    // For rejoin, specify the extended PANID to look for
    +    osal_cpyExtAddr( ZDO_UseExtendedPANID, _NIB.extendedPANID );
    +
    +    _NIB.nwkState = NWK_DISC;
    +
    +    zdoDiscCounter = 3;
    +    NLME_NwkDiscTerm();
    +
    +    ZDApp_NetworkInit((uint16)(NWK_START_DELAY + ((uint16) (osal_rand() & EXTENDED_JOINING_RANDOM_MASK ))));
    +  }
    +  else
    +  {
        ZDApp_ResetTimerStart( LEAVE_RESET_DELAY );
    +  }
    }
    

    void ZDApp_ProcessNetworkJoin( void )
    {
    
      ...
    
      else if ( devState == DEV_NWK_ORPHAN || devState == DEV_NWK_REJOIN )
      {
        // results of an orphaning attempt by this device
        if (nwkStatus == ZSuccess)
        {
    +      if ( ZSTACK_END_DEVICE_BUILD )
    +      {
    +        NLME_SetPollRate( ZDApp_SavedPollRate );
    +      }
          
          // Verify NWK key is available before sending Device_annce
          if ( ZG_SECURE_ENABLED && ( ZDApp_RestoreNwkKey() == false ) )
          {
    
      ...
    
    }

    - Cetri