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.

ZDO callbacks not working on ZNP

Other Parts Discussed in Thread: CC2591, CC2530, Z-STACK

Good day for everybody!

I require the help from You experts out there.

I developed a CC2530 + CC2591 board that connects via serial port to a PC using ZTOOL V2.0, and everything is working as expected, good range, and all devices forming the mesh network as expected. Still, I have problems with the ZDO commands which are not returning information.

The CC2530 chip is loaded with the Z-STACK 2.3.0, and compiled using the following compile options:

MT_UTIL_FUNC, MT_SYS_FUNC, MT_AF_FUNC, MT_SAPI_FUNC, MT_SAPI_CB_FUNC, MT_ZDO_CB_FUNC, MT_ZDO_FUNC, MT_ZDO_MGMT, MT_APP_FUNC

When I try to get the response from the ZDO_IEEE_ADDR_REQ (0x2501) command in the ZTOOL,  all I get is the ZDO_IEEE_ADDR_REQ_SRSP(0x6501) with success status.  It is supposed that I will also receive the ZDO_IEEE_ADDR_RSP(0x4581) that contains the response, but this response never arrives. I also verifyied with a port sniffer on the serial port and all I see is the ZDO_IEEE_ADDR_REQ  request and the ZDO_IEEE_ADDR_REQ_SRSP.

The documentation for the z-stack specify that it is necessary to subscribe to the callbacks in order to receive responses from certain commands.  I am not sure what is the correct way of doing that. I tryied to subscribe using the UTIL_CALLBACK_SUBSCRIBE command, with the 0xFFFF argument for the CommandID as stated in the "Z-Stack Monitor and Test API" document so all the subsystems will be subscribed for callbacks, including the ZDO ones. Also, I used the CommandID of the ZDO_IEEE_ADDR_RSP(0x4581) as the parameter for the UTIL_CALLBACK_SUBSCRIBE command, but still I cannot receive any callback for the  ZDO_IEEE_ADDR_REQ command. 

Does anyone know how to subscribe to the ZDO callbacks using ztool?

 

Best regards.

 

Sergio

 

 

  • You have to enable callbacks:

    Write a '1' to this config parameter:

    ZCD_NV_ZDO_DIRECT_CB
    Configuration ID: 0x008F; Size: 1byte; Default value: FALSE
    This configures the manner in which ZDO responses (hereby referred to as callbacks) are issued
    to the host processor. By default, this item is set to FALSE, which means that the host processor
    must use the ZDO_MSG_CB_REGISTER command to subscribe to a specific ZDO callback in
    order to receive it. The ZDO callback is then conveyed as part of the ZDO_MSG_CB_INCOMING
    command. If ZCD_NV_ZDO_DIRECT_CB is set TRUE, then the host processor will receive the
    “verbose” response. For example, the host processor would receive the ZDO_IEEE_ADDR_RSP
    command in response to ZDO_IEEE_ADDR_REQ. 

  • Derek,

     

    Your solution actually worked! 

    After setting the ZCD_NV_ZDO_DIRECT_CB to 1 it was necessary to force a reset so the stack applies the changes, and then the callbacks begun to fire.

    Thank you very much for taking the time to solve my problem. 

    Sergio.

  • Glad to help; that issue bit me in the ass too since it's not very clear.

     

    --Derek

  • Hi Derek,

    I have the same problem, but the thing is that I can not compile with no MT_ZDO_CB_FUNC flag or change the configuration in my Stack since I have bought the devices with the Z-Stack already installed and I can not access to the firmware. So, in this point, how could I do change the value of MT_ZDO_CB_FUNC so that I can receive ZDO Callback Messages? Can I send a message by air in order to enable ZDO CallBack messages?

    By the way, is there any other options to know the IEEE address from the devices associated to Zigbee Coordinator? Is there any message to do this?

    Thank you in advance

     

  • Turn on callbacks by setting the configurable parameter ZCD_NV_ZDO_DIRECT_CB to 1.

     

    To get the IEEE address of devices associated to a coordinator, I think you need to get associated children. I don't recall how.

     

    --Derek

  • Thank you for your answer.

    As I wrote here, I can not compile anything since I do not have access to the devices' firmware.

    I have tested with ZDO_NWK_ADDR_REQ and the only response is gotten when I send the Zigbee Coordinator's Serial ID (64 bits). If I try the same with the Serial ID of my Zigbee Temperature Sensor I do not get any response at all.

     

    Regards

  • David,

    MT_ZDO_CB_FUNC is already pre-compiled in to the pre-built .hex files. If you are only interested in getting the associated device list, I'd recommend using a combination of the UTIL_ASSOC_COUNT and UTIL_ASSOC_FIND_DEVICE functions.

    Regards,

    -- Double O

  • Double O, can you please explain how to use the UTIL_ASSOC_COUNT and UTIL_ASSOC_FIND_DEVICE functions to get the associated device list? The interface specification explains what they are but doesn't explain how to use them.

     

    Thanks,
    Derek

  • Hi Derek,

    First, you would use UTIL_ASSOC_COUNT with parameters 1 and 4, for startRelation and endRelation, respectively. This will return the count of all children associated to you (e.g. if you are a coordinator). UTIL_ASSOC_COUNT will return a value, say 3. Then use UTIL_ASSOC_FIND_DEVICE repeatedly, starting from the 0th entry all the way up to 2 for this example.

    -- Double O

  • Cool - thanks. It isn't clear in the spec that UTIL_ASSOC_FIND_DEVICE corresponds to UTIL_ASSOC_COUNT.

    --Derek

  • The prebuilt binary README file says

     

    "CC2530ZNP-Pro.hex - To be used with ZNP applications that do not use security. When using this image, the host processor
    must register for specific ZDO callbacks using the ZDO_MSG_CB_REGISTER API, and will be notified of the response via
    the ZDO_MSG_CB_INCOMING command. The included ZAP sample applications demonstrate this method of handling ZDO responses."

     

    Does this mean I am stuck with having to register for each function using  ZDO_MSG_CB_REGISTER

    or can I enable verbose callbacks by setting ZCD_NV_ZDO_DIRECT_CB to TRUE.

     

    i.e is setting ZCD_NV_ZDO_DIRECT_CB to TRUE allowed in the pre-built binary ?

     

    Madhu