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.

The sequence in which the channel used by the ZED is changed.

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

Hi, 

I've  Zigbee end devices ( CC2650) developed  based on Z Stack 1.2.2HA  which communicate with coordinator CC2538 .

I am investigating a Z-stack program when the ZED fails during the reconnect sequence.
(ZDApp.c, ZDApp_ProcessNetworkJoin function with nwkStatus ! = ZSuccess)
If prevDevState is DEV_NWK_SEC_REJOIN_ALL_CHANNEL,
runtimeChannel = (uint32) (1L << _NIB.nwkLogicalChannel);
The above program appears to change the channel used by the ZED. Am I correct in my understanding?

Also, am I correct in assuming that 3 failures during the reconnection sequence are required for this code to execute?

Any help would be appreciated .

Best regards, 
Yuya Murata

  • 1. When device does rejoin, it will first try with previous joined channel which is _NIB.nwkLogicalChannel/

    2. What do you mean "3 failures during the reconnection sequence are required for this code to execute?"

  • Thank you for your reply.

    1. When device does rejoin, it will first try with previous joined channel which is _NIB.nwkLogicalChannel/

    I understand that ZED use the same channel to rejoin at first try.
    and when the second or third rejoin fails, the channel appears to be changed.
    (Please see the underlined portion of the code below).

    Best regards,

    ZDApp.c, ZDApp_ProcessNetworkJoin(), 

    if (nwkStatus == ZSuccess)
    ~~~
    ~~~
    }
    else
    {
    if ( devStartMode == MODE_RESUME )
    {
      if ( ++retryCnt <= MAX_RESUME_RETRY )
      {
        if ( _NIB.nwkPanId == 0xFFFF )
           devStartMode = MODE_JOIN;
        else
        {
           devStartMode = MODE_REJOIN;
           _tmpRejoinState = true;
           prevDevState = DEV_NWK_SEC_REJOIN_CURR_CHANNEL;
         }
       }
       // Do a normal join to the network after certain times of rejoin retries
       else if( AIB_apsUseInsecureJoin == true )
       {
         devStartMode = MODE_JOIN;
        }
      }

    else if(devStartMode == MODE_REJOIN)
    {
      if ( ZSTACK_END_DEVICE_BUILD )
      {
       devStartMode = MODE_REJOIN;
       _tmpRejoinState = true;
       _NIB.nwkState = NWK_INIT;

       if( prevDevState == DEV_NWK_SEC_REJOIN_CURR_CHANNEL )
       {
         runtimeChannel = MAX_CHANNELS_24GHZ;
         prevDevState = DEV_NWK_SEC_REJOIN_ALL_CHANNEL ;
       }
      else if ( prevDevState == DEV_NWK_SEC_REJOIN_ALL_CHANNEL)
      {
        // Set the flag that will ask the device to do trust center network layer rejoin.
        _NIB.nwkKeyLoaded = FALSE;
        ZDApp_ResetNwkKey(); // Clear up the old network key.
        runtimeChannel = (uint32) (1L << _NIB.nwkLogicalChannel);
        prevDevState = DEV_NWK_TC_REJOIN_CURR_CHANNEL ;
       }
       else if ( prevDevState == DEV_NWK_TC_REJOIN_CURR_CHANNEL )
       {
        runtimeChannel = MAX_CHANNELS_24GHZ;
        prevDevState= DEV_NWK_TC_REJOIN_ALL_CHANNEL ;
       }

     }
    }

    f8wConfig.cfg

    /* Default channel is Channel 11 - 0x0B */
    // Channels are defined in the following:
    // 0 : 868 MHz 0x00000001
    // 1 - 10 : 915 MHz 0x000007FE
    // 11 - 26 : 2.4 GHz 0x07FFF800
    //
    //-DMAX_CHANNELS_868MHZ 0x00000001
    //-DMAX_CHANNELS_915MHZ 0x000007FE
    //-DMAX_CHANNELS_24GHZ 0x07FFF800
    //-DDEFAULT_CHANLIST=0x04000000 // 26 - 0x1A
    //-DDEFAULT_CHANLIST=0x02000000 // 25 - 0x19
    //-DDEFAULT_CHANLIST=0x01000000 // 24 - 0x18
    //-DDEFAULT_CHANLIST=0x00800000 // 23 - 0x17
    //-DDEFAULT_CHANLIST=0x00400000 // 22 - 0x16
    //-DDEFAULT_CHANLIST=0x00200000 // 21 - 0x15
    //-DDEFAULT_CHANLIST=0x00100000 // 20 - 0x14
    //-DDEFAULT_CHANLIST=0x00080000 // 19 - 0x13
    //-DDEFAULT_CHANLIST=0x00040000 // 18 - 0x12
    //-DDEFAULT_CHANLIST=0x00020000 // 17 - 0x11
    //-DDEFAULT_CHANLIST=0x00010000 // 16 - 0x10
    //-DDEFAULT_CHANLIST=0x00008000 // 15 - 0x0F
    //-DDEFAULT_CHANLIST=0x00004000 // 14 - 0x0E
    //-DDEFAULT_CHANLIST=0x00002000 // 13 - 0x0D
    -DDEFAULT_CHANLIST=0x00001000 // 12 - 0x0C
    //-DDEFAULT_CHANLIST=0x00000800 // 11 - 0x0B

  • The device would try original channel in the beginning and try other channels if it cannot rejoin on original channel.

  • If I don't want to change the channel, can I just comment out the underlined portion of the code?

  • I suppose you should always use runtimeChannel = (uint32) (1L << _NIB.nwkLogicalChannel); if you don't want to change channel.

  • Thanks a lot.
    I will try to your advise.