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.

How to detect a new joined device?

Other Parts Discussed in Thread: Z-STACK

Hello!

Does anybody know how to install a callback on the coordinator, that will be entered each time a new device is joining the network? I think ZDO_JoinIndicationCB can be used for this functionality, but how to tell the application? Is there a way without doing changes in the stack? Can there be registered a ZDO message or whatever in the application?

Regards,

Rooney

  • Hello Rooney,

     

    Try using ZDO_RegisterForZDOMsg(<taskID>, <ZDAppMessage>) function with appropriate message. I hope this helps.

     

    Best regards,

    Ivan.

  • Thanks for your suggestion, but it does not work.

    Unfortunately none of the following registered ZDAppMessage is working.

    ZDO_RegisterForZDOMsg( sapi_TaskID, NWK_addr_rsp );
    ZDO_RegisterForZDOMsg( sapi_TaskID, Match_Desc_rsp );
    ZDO_RegisterForZDOMsg( sapi_TaskID, IEEE_addr_rsp );
    ZDO_RegisterForZDOMsg( sapi_TaskID, Node_Desc_rsp );
    ZDO_RegisterForZDOMsg( sapi_TaskID, Power_Desc_rsp );
    ZDO_RegisterForZDOMsg( sapi_TaskID, Simple_Desc_rsp );
    ZDO_RegisterForZDOMsg( sapi_TaskID, Active_EP_rsp );
    ZDO_RegisterForZDOMsg( sapi_TaskID, Mgmt_Rtg_rsp ); 
    ZDO_RegisterForZDOMsg( sapi_TaskID, Mgmt_Rtg_req ); 
    ZDO_RegisterForZDOMsg( sapi_TaskID, Mgmt_Direct_Join_req ); 
    ZDO_RegisterForZDOMsg( sapi_TaskID, Mgmt_Permit_Join_req ); 
    ZDO_RegisterForZDOMsg( sapi_TaskID, Mgmt_Direct_Join_rsp ); 
    ZDO_RegisterForZDOMsg( sapi_TaskID, Mgmt_Permit_Join_rsp ); 
    ZDO_RegisterForZDOMsg( sapi_TaskID, NWK_addr_req ); 
    ZDO_RegisterForZDOMsg( sapi_TaskID, IEEE_addr_req ); 
    ZDO_RegisterForZDOMsg( sapi_TaskID, Node_Desc_req ); 
    ZDO_RegisterForZDOMsg( sapi_TaskID, Simple_Desc_req ); 
    ZDO_RegisterForZDOMsg( sapi_TaskID, Match_Desc_req ); 

     

    It's strange that no message is generated when joining the network. I'm certain that at least NWK_addr_rsp should be generated. What is going wrong?

  • Hello Rooney,

     

    Without knowing more about your application I can suggest following:

    1) Check if the macAssociationPermit is set to TRUE (the name of the this parameter is according to ZigBee spec, I am not sure about the name in TI SW, maybe some of the TI support guys can answer this, or you can check it on your own)

    2) Check for the device configurations (coordinator, end device) on all devices

    3) Be sure that device is not restoring data from NVM

    4) Check if the packets are sent between devices

    From my experience, the solution with these kind of problems is always simple. :)

    Which Z-Stack version are you using and which application?

    Best regards,

    Ivan.

  • Hello!

     

    I got the answer from TI .

     

    Change the related source code in MT_ZdoDirectCB to:

    if ( (MT_ZdoHandleExceptions( pData, inMsg )) || ((pData->clusterId & ZDO_RESPONSE_BIT) == 0) )
    {
    // Handled somewhere else or not needed
    return;
    }



    Register Device_annce in the task initialization of your application...

    ZDO_RegisterForZDOMsg( sapi_TaskID, Device_annce )


    ...and process the message in xxx_ProcessZDOMsgs

  • Hi,

    This portion of the code seems to be part of Test and Monitoring. What if I am not using MT_ZDO_CB_FUNC compile option.

    What other method can be used to achieve the same effect

    Thanks

     

  • Hi at all...

    I would know the IEEE address of new end-device join my network.. I register the following ZDO_Register in my Init app:

    • ZDO_RegisterForZDOMsg( EmptyApp_TaskID, End_Device_Bind_rsp );
    • ZDO_RegisterForZDOMsg( EmptyApp_TaskID, Match_Desc_rsp );
    • ZDO_RegisterForZDOMsg( EmptyApp_TaskID, Device_annce  ); 
    • ZDO_RegisterForZDOMsg( EmptyApp_TaskID, IEEE_addr_req );
    • ZDO_RegisterForZDOMsg( EmptyApp_TaskID, NWK_addr_req  );
    • ZDO_RegisterForZDOMsg( EmptyApp_TaskID, Active_EP_rsp );
    • ZDO_RegisterForZDOMsg( EmptyApp_TaskID, Simple_Desc_rsp );

    but I intercept ONLY ZDO_RegisterForZDOMsg( EmptyApp_TaskID, Device_annce  ).

    Anybody know why??

     

    Please help me..

  • when you intercept at ZDO_RegisterForZDOMsg( EmptyApp_TaskID, Device_annce ).
    you need to know what you want to do next?
    ex:
    if you want to know the endpiont info of this device , you need to send a Active_EP_req ,
    just using ZDP_ActiveEPReq() function

    BR