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.

WEBENCH® Tools/CC2652R: Random ExtPANID

Part Number: CC2652R

Tool/software: WEBENCH® Design Tools

Random Ext PANID is very useful in zigbee network, remember that coordinator should create new random ExtPANID when every generating new network.

add this code when your task init.

  extern uint8_t zgExtendedPANID[];
  extern uint8_t aExtendedAddress[];
  uint8_t defExtPanid[] = ZDAPP_CONFIG_EPID;
  
  osal_nv_read( ZCD_NV_EXTENDED_PAN_ID, 0, Z_EXTADDR_LEN, zgExtendedPANID );
  if( ( 0 == memcmp( zgExtendedPANID, defExtPanid, Z_EXTADDR_LEN ) ) || ( 0 == memcmp( zgExtendedPANID, aExtendedAddress, Z_EXTADDR_LEN ) ) )
  {
    uint8_t  extAddr[8];
    uint16_t random = OsalPort_rand();
    memcpy( extAddr, aExtendedAddress, 8);
    //Create the key from the seed
    uint8_t i;
    for(i = 0; i < 8; i++)
    {
      extAddr[i] ^= (random & 0x000000FF);
      random >>= 1;
      zgExtendedPANID[i] ^= extAddr[i];
    }
    osal_cpyExtAddr( _NIB.extendedPANID, zgExtendedPANID );
    osal_nv_write( ZCD_NV_EXTENDED_PAN_ID, Z_EXTADDR_LEN, zgExtendedPANID );
  }

add this code when your coordinator program rebuild network.

    osal_nv_delete( ZCD_NV_EXTENDED_PAN_ID, Z_EXTADDR_LEN );
    Zstackapi_bdbResetLocalActionReq(cmdPktTaskId);

  • Random Ext-PANID could stop a old node rejoin into your current network when your coordinator has rebuild a new network which will delete all TC-link key of before network.

  • Thank you for sharing, Aries.  Typically the EPID is set as the device's unique extended address and does not change even when forming a new network but I see that  your solution is to address the issue of old nodes attempting to rejoin with outdated TC link keys instead of forgetting the previous network and trying a new join.  If possible to modify the firmware of the end nodes then you could have them factory reset after the rejoin process fails a certain number of times.  Or perhaps switch the active channel of your ZC that the end nodes will not scan.

    Regards,
    Ryan

  • Some times, coordinator will change NWK-Key and Active Channel. Joined Node can use unsecured-rejoin to get the new NWK-Key and new Active Channel, because coordinator send them new NWK-Key by TC-Link-Key. But if coordinator restart a new network, the TC-Link-Key will be deleted.