One coordinator allows only 8 ZEDs join zigbee network

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

One coordinator allows only 8 ZEDs join zigbee network

2,224 Views
panjun
Contributor III

I use JN-AN-1216-Zigbee-3-0-IoT-ControlBridge as coordinator , the coordinator permits a ZED join zigbee network by authentication,one coordinator allows only 8 ZEDs join zigbee network.

To meet the needs mentioned above,i have some questions as below:

1.Do i need to  change ZNC_MAX_TCLK_DEVICES to 8? If not,what should i do ?

2.If 8 ZEDs have been join to one coordinator, how can my coordinator application code get the MAC addresses of these 8 ZEDs and their link KEYs(this link KEY is that ZED get thought ZPS_eAplZdoRequestKeyReq) by the stack API? 

3.  ZPS_eAplZdoAddReplaceLinkKey( u64DeviceAddress, au8Key,   ZPS_APS_UNIQUE_LINK_KEY);
     if(bCredPresent)
     {
      DBG_vPrintf(TRACE_APP, "\nu64Addr:0x%llx has been in the net before",u64DeviceAddress);
      asTclkStruct[u16Location].u16TclkRetries = 0xFFFF;  What does this 0xFFFF mean?Pleas explain it in detail.
     }   

4.About bool_t zps_bGetFlashCredential(uint64 u64IeeeAddr,AESSW_Block_u* puKey,uint16 *pu16Index,bool_t ,bool_t bUpdate ) , please tell me means of the bTcCred and the bUpdate or  provide the menu documentation for this function. 

12 Replies

1,637 Views
mario_castaneda
NXP TechSupport
NXP TechSupport

Hi Pan Jun,

1. Do I need to change ZNC_MAX_TCLK_DEVICES to 8? If not, what should I do?

Yes, the Coordinator will reject the joining process for device number 9, in this case.

2. If 8 ZEDs have been joined to one coordinator, how can my coordinator application code get the MAC addresses of these 8 ZEDs and their link KEYs(this link KEY is that ZED gets thought ZPS_eAplZdoRequestKeyReq) by the stack API? 

We do not provide a specific API to get the MAC address, but You can get if you define

APPSRC += appZpsExtendedDebug.c in the makefile.

Then you can print the tables, for example vDisplayAddressMapTable. Look at the appZpsExtendedDebug.c file.

3.  ZPS_eAplZdoAddReplaceLinkKey( u64DeviceAddress, au8Key,   ZPS_APS_UNIQUE_LINK_KEY);
     if(bCredPresent)
     {
      DBG_vPrintf(TRACE_APP, "\nu64Addr:0x%llx has been in the net before",u64DeviceAddress);
      asTclkStruct[u16Location].u16TclkRetries = 0xFFFF;  What does this 0xFFFF mean?Pleas explain it in detail.
     }   

The code is checking if the credential is present roll back to confirm that key is used and not install code.

if(bCredPresent)
     {
      DBG_vPrintf(TRACE_APP, "\nu64Addr:0x%llx has been in the net before",u64DeviceAddress);
      asTclkStruct[u16Location].u16TclkRetries = 0xFFFF;  What does this 0xFFFF mean?Pleas explain it in detail.
     }  

 

4.About bool_t zps_bGetFlashCredential(uint64 u64IeeeAddr,AESSW_Block_u* puKey,uint16 *pu16Index,bool_t ,bool_t bUpdate ) , please tell me means of the bTcCred and the bUpdate or  provide the menu documentation for this function. 

 bTcCred Trust Center Credential and bUpdate update or not.

Mario

0 Kudos

1,637 Views
panjun
Contributor III
Hi,Mario Ignacio Castaneda Lopez,
Thank you very much for your reply!But there are still some unclear points as below Bold and italic characters:
2. If 8 ZEDs have been joined to one coordinator, how can my coordinator application code get the MAC addresses of these 8 ZEDs and their link KEYs(this link KEY is that ZED gets thought ZPS_eAplZdoRequestKeyReq) by the stack API?
We do not provide a specific API to get the MAC address, but You can get if you define
APPSRC += appZpsExtendedDebug.c in the makefile.
Then you can print the tables, for example vDisplayAddressMapTable. Look at the appZpsExtendedDebug.c file.
I use vDisplayAddressMapTable() in the appZpsExtendedDebug.c and app_zbp_utilities.c at the same time to get MAC address of only one ZED,print information is as below:
Address Map Size: 10
Short Addr: fffe, Ext Addr: 0000000000000000,
Short Addr: fffe, Ext Addr: 0000000000000000,
Short Addr: fffe, Ext Addr: 0000000000000000,
Short Addr: fffe, Ext Addr: 0000000000000000,
Short Addr: fffe, Ext Addr: 0000000000000000,
Short Addr: fffe, Ext Addr: 0000000000000000,
Short Addr: fffe, Ext Addr: 0000000000000000,
Short Addr: fffe, Ext Addr: 0000000000000000,
Short Addr: fffe, Ext Addr: 0000000000000000,
Short Addr: fffe, Ext Addr: 0000000000000000,
Address Map Size: 10
Short Addr: fffe, u16Lookup: 0, Ext Addr: 00158d0001154d9f,
Short Addr: fffe, u16Lookup: ffff, Ext Addr: 0000000000000000,
Short Addr: fffe, u16Lookup: ffff, Ext Addr: 0000000000000000,
Short Addr: fffe, u16Lookup: ffff, Ext Addr: 0000000000000000,
Short Addr: fffe, u16Lookup: ffff, Ext Addr: 0000000000000000,
Short Addr: fffe, u16Lookup: ffff, Ext Addr: 0000000000000000,
Short Addr: fffe, u16Lookup: ffff, Ext Addr: 0000000000000000,
Short Addr: fffe, u16Lookup: ffff, Ext Addr: 0000000000000000,
Short Addr: fffe, u16Lookup: ffff, Ext Addr: 0000000000000000,
Short Addr: fffe, u16Lookup: ffff, Ext Addr: 0000000000000000,
 vDisplayAddressMapTable() in the appZpsExtendedDebug.c does not print out MAC address of only one ZED, i list their source code below:

vDisplayAddressMapTable() in the appZpsExtendedDebug.c
PUBLIC void vDisplayAddressMapTable(void)
{
    ZPS_tsNwkNib * thisNib;
    thisNib = ZPS_psNwkNibGetHandle(ZPS_pvAplZdoGetNwkHandle());
    uint8 i = 0;
    DBG_vPrintf(TRACE_ZBP_UTILS,"\r\nAddress Map Size: %d", thisNib->sTblSize.u16AddrMap);
    for( i=0;i<thisNib->sTblSize.u16AddrMap;i++)
    {
        DBG_vPrintf(TRACE_ZBP_UTILS,"\nShort Addr: %04x, Ext Addr: %016llx,", thisNib->sTbl.pu16AddrMapNwk[i], ZPS_u64NwkNibGetMappedIeeeAddr(ZPS_pvAplZdoGetNwkHandle(),thisNib->sTbl.pu16AddrLookup[i]));
    }
}

vDisplayAddressMapTable() in the app_zbp_utilities.c
PUBLIC void vDisplayAddressMapTable_Ut(void)
{
 ZPS_tsNwkNib * thisNib;
 void * thisNet = ZPS_pvAplZdoGetNwkHandle();
 thisNib = ZPS_psNwkNibGetHandle(thisNet);
 uint8 i = 0;
 DBG_vPrintf(TRACE_ZBP_UTILS,"\r\nUT:Address Map Size: %d", thisNib->sTblSize.u16AddrMap);
 for( i=0;i<thisNib->sTblSize.u16AddrMap;i++)
  {
  DBG_vPrintf(TRACE_ZBP_UTILS,"\nShort Addr: %04x, u16Lookup: %x, Ext Addr: %016llx,", thisNib->sTbl.pu16AddrMapNwk[i], thisNib->sTbl.psNtActv[i].u16Lookup,ZPS_u64NwkNibGetMappedIeeeAddr(thisNet,thisNib->sTbl.psNtActv[i].u16Lookup));
 } 
}
vDisplayAddressMapTable() in the app_zbp_utilities.c print MAC address of  the ZEDs by u16Lookup of the neighbor table, it can not print the MAC addresses of all eight ZEDs if there some ZEDs of eight ZEDs join router in the mesh network , therefore there is still need vDisplayAddressMapTable() to get  the MAC addresses of all eight ZEDs in the appZpsExtendedDebug.c
      Would you please tell me why vDisplayAddressMapTable() can not print MAC address in the appZpsExtendedDebug.c ?
      One other question , i need get TC(trust center) link keys of all eight ZEDs which request to trust center thought ZPS_eAplZdoRequestKeyReq when they joined . It seems to get TC link keys of all eight ZEDs through "ZPS_TclkDescriptorEntry    asTclkStruct[ZNC_MAX_TCLK_DEVICES]" from the flash, but there is not a such function to ouput  TC link keys through "ZPS_TclkDescriptorEntry    asTclkStruct[ZNC_MAX_TCLK_DEVICES]" in the appZpsExtendedDebug.c.
      Would you please tell me how to get  TC link keys of all eight ZEDs through "ZPS_TclkDescriptorEntry    asTclkStruct[ZNC_MAX_TCLK_DEVICES]" from the flash?

3.  ZPS_eAplZdoAddReplaceLinkKey( u64DeviceAddress, au8Key,   ZPS_APS_UNIQUE_LINK_KEY);
     if(bCredPresent)
     {
      DBG_vPrintf(TRACE_APP, "\nu64Addr:0x%llx has been in the net before",u64DeviceAddress);
      asTclkStruct[u16Location].u16TclkRetries = 0xFFFF;  What does this 0xFFFF mean?Pleas explain it in detail.
     }   

 

The code is checking if the credential is present roll back to confirm that key is used and not install code.

 Is the above sentence an explanation for  asTclkStruct[u16Location].u16TclkRetries = 0xFFFF ?

4.About bool_t zps_bGetFlashCredential(uint64 u64IeeeAddr,AESSW_Block_u* puKey,uint16 *pu16Index,bool_t ,bool_t bUpdate ) , please tell me means of the bTcCred and the bUpdate or  provide the menu documentation for this function. 

 

 bTcCred Trust Center Credential and bUpdate update or not.

I still do not understand your explanation to  bTcCred and bUpdate, would you tell me more specific:

What does bTcCred=TRUE mean? How to process that function(zps_bGetFlashCredential) when bTcCred=TRUE?

What does bTcCred=FALSE mean?How to process that function(zps_bGetFlashCredential) when bTcCred=FALSE?

What does Trust Center Credential ?

What to be update when bUpdate=TRUE? Or how to process that function(zps_bGetFlashCredential)  when bUpdate=TRUE?

Would you tell me more specific for above all question(2,3,4)!

0 Kudos

1,637 Views
mario_castaneda
NXP TechSupport
NXP TechSupport

Hi Pan Jun,

Would you please tell me why vDisplayAddressMapTable() can not print MAC address in the appZpsExtendedDebug.c?
If you look into the appZpsExtendedDebug.c is printing a wrong value, the variable of the structure is wrong.
The parameter should be like this
ZPS_u64NwkNibGetMappedIeeeAddr((void*)ZPS_pvAplZdoGetNwkHandle(),thisNib->sTbl.psNtActv[i].u16Lookup));//thisNib->sTbl.pu16AddrLookup[i]));
      One other question, I need to get TC(trust center) link keys of all eight ZEDs which request to trust center thought ZPS_eAplZdoRequestKeyReq when they joined. It seems to get TC link keys of all eight ZEDs through "ZPS_TclkDescriptorEntry    asTclkStruct[ZNC_MAX_TCLK_DEVICES]" from the flash, but there is not such function to output  TC link keys through "ZPS_TclkDescriptorEntry    asTclkStruct[ZNC_MAX_TCLK_DEVICES]" in the appZpsExtendedDebug.c.
      Would you please tell me how to get  TC link keys of all eight ZEDs through "ZPS_TclkDescriptorEntry    asTclkStruct[ZNC_MAX_TCLK_DEVICES]" from the flash?
The vPrintAPSTable that is in the app_serial_command.c file shows the key for each joined device.
 Is the above sentence an explanation for  asTclkStruct[u16Location].u16TclkRetries = 0xFFFF ?
u16TclkRetries is the number of retries that were attempted to negotiate the link key between the Trust Centre and the node.
Regards,
Mario
0 Kudos

1,637 Views
panjun
Contributor III

Hi Mario:

      If  a ZED join a network by a router , how to get this ZED IeeeAddr on CIE, It should not to able to use

ZPS_u64NwkNibGetMappedIeeeAddr((void*)ZPS_pvAplZdoGetNwkHandle(),thisNib->sTbl.psNtActv[i].u16Lookup))

to get IeeeAddr,because this API use the neighber table to get IeeeAddr ,but this ZED is not in the  CIE neighber table.

The vPrintAPSTable that is in the app_serial_command.c file shows the key for each joined device.

There is not this file in the SDK or AN which i use!

Is the above sentence an explanation for  asTclkStruct[u16Location].u16TclkRetries = 0xFFFF ?
u16TclkRetries is the number of retries that were attempted to negotiate the link key between the Trust Centre and the node.

  What does 0xFFFF  mean?  Are the retries 0xFFFF times? It is impossible to retry so many times!

Regards,
pan
0 Kudos

1,637 Views
mario_castaneda
NXP TechSupport
NXP TechSupport

Hi Pan,

appZpsExtendedDebug.c could help you to find the devices that are joined to the CIE.

C:\NXP\bstudio_nxp\sdk\JN-SW-4170\Components\ZigbeeCommon\Source

What does 0xFFFF  mean?  Are the retries 0xFFFF times? It is impossible to retry so many times!

The code is defining the maximum value, that is because is not using an install code.

Regards,

Mario

0 Kudos

1,637 Views
panjun
Contributor III

Hi Mario:

            Thank you very much for your reply.  

 

If  a ZED join a network by a router , how to get this ZED IeeeAddr on CIE, It should not to able to use

ZPS_u64NwkNibGetMappedIeeeAddr((void*)ZPS_pvAplZdoGetNwkHandle(),thisNib->sTbl.psNtActv[i].u16Lookup))

to get IeeeAddr,because this API use the neighber table to get IeeeAddr ,but this ZED is not in the  CIE neighber table.

         In your reply  to the first question, you do not seem to understood what I mean. I mean,if  a ZED join a network by a router instead of directly by CIE, how to get the  IeeeAddr  of this ZED on CIE?(This ZED has been directly connected to router)

         

         

PUBLIC void vDisplayAddressMapTable(void)
{
    ZPS_tsNwkNib * thisNib;
    thisNib = ZPS_psNwkNibGetHandle(ZPS_pvAplZdoGetNwkHandle());
    uint8 i = 0;
    DBG_vPrintf(TRACE_ZBP_UTILS,"\r\nAddress Map Size: %d", thisNib->sTblSize.u16AddrMap);
    for( i=0;i<thisNib->sTblSize.u16AddrMap;i++)
    {
        DBG_vPrintf(TRACE_ZBP_UTILS,"\nShort Addr: %04x, Ext Addr: %016llx,", thisNib->sTbl.pu16AddrMapNwk[i], ZPS_u64NwkNibGetMappedIeeeAddr(ZPS_pvAplZdoGetNwkHandle(),thisNib->sTbl.psNtActv[i].u16Lookup));
    }
}
The above function in the appZpsExtendedDebug.c can only get the ZED device address directly connected to the CIE, but can not get the ZED address connected to the ROUTER, because there is no record of the ZED device connected to the ROUTER in the CIE neighbor table.

               

              

0 Kudos

1,637 Views
mario_castaneda
NXP TechSupport
NXP TechSupport

Hi  Pan Jun,

The above function in the appZpsExtendedDebug.c can only get the ZED device address directly connected to the CIE, but can not get the ZED address connected to the ROUTER, because there is no record of the ZED device connected to the ROUTER in the CIE neighbor table.

If you want to know what are the devices that the router has, send a Management LQI request to the router direction.

If the response message mentions that the router has more than two, send again the Mgmt LQI request, but increase the index and you will get the devices information.

Mario

1,637 Views
panjun
Contributor III

Hi Mario:

            Thank you very much for your reply!

0 Kudos

1,637 Views
mario_castaneda
NXP TechSupport
NXP TechSupport

Hi Pan Jun,

I'm sorry for the late update. I reproduce your issue and I am working on it.

Could you please confirm the SDK and the AN version that you are working on?

Regards,

Mario

0 Kudos

1,637 Views
panjun
Contributor III

Hi Mario:

      Sorry to see your reply until now , The SDK is JN-SW-4170(Build Number 1745) , The AN is JN-AN-1216-Zigbee-3-0-IoT-ControlBridge(Version is 1010).

       

Regards,
Pan
0 Kudos

1,637 Views
panjun
Contributor III

Would please NXP engineer  reply my question ,my project is very tight and I need answers urgently!

0 Kudos

1,637 Views
panjun
Contributor III

Through my question please Moderators ,my project is very tight and I need answers urgently.!

0 Kudos