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.

ZNP and the use of bindings

Other Parts Discussed in Thread: CC2530, Z-STACK

Hi.

It looks like to me that there are problems using AF_Data_request with binding as it does not support dest_addr_type

So the address will alwasy be used as short_addess.

Can ZNP and AF-commands set be used with binding in any way?

BR

Ørjan

  • I have the same question. Can anyone help!

    Thanks

  • Hello Tuong Ngoc,

    You should be able to use the destination devices address from the binding table in AF Send data command, to do that you should have binding already done and the destination address while requesting AF send data should be 0xFFFE.

    Regards,

    Suyash Jain

  • Thanks Suyash so much!

    You  help me continue on that ZNP. I was waiting for an answer :(

    Best day  to you!

    Tuong

  • Hi Suyash,

    Have you verified that this works? When I investigated this I found that the ZB_SEND_DATA_REQUEST did have this option, but not the AF_DATA_REQUEST.

    The MT command only have 2 byte for address, while the internal procedure contains a "address type" + "address". The address type is one of the following: 

    -short address

    -IEEE address

    -Binding address.

    But for the ZNP->AF_DATA_REQUEST, the "address type" is hard-coded to short address. This means no IEEE addressing or binding can be used.

     

    BR

    Ørjan

  • Hello Orjan, Tuong Ngoc

    Thanks for pointing this out, you are correct using AF_DATA_REQUEST for ZNP we can only use the short address of the destination device, (see the ZNP Interface Specfication document for understanding the byte sequence of the AF_DATA_REQUEST. )

    Tuong Ngoc,

    If you are using binding, you need to use ZB_SEND_DATA_REQUEST command for ZNP, see ZNP Interface Specification document for understanding the byte sequence of this command. You can find this document in your Z-Stack Install at C:\Texas Instruments\ZStack-CC2530-2.5.0\Documents\CC2530

    Regards,

    Suyash Jain

  • Hi Suyash

    I appreciate your help.

    I still stuck on Binding. I can't do either ZDO_END_DEVICE_BIND_REQ or ZDO_BIND_REQ work . I always received status 0x84, 0x82. And not figure out yet.

    Maybe I should try more.

    Thank you so much!

    Tuong

  • Hi

    I confuse where to put coordinator's IEEE address in ZDO_END_DEVICE_BIND_REQ command

    (CC2530ZNP Interface Specification, page 65, ZDO_END_DEVICE_BIND_REQ)

    "SREQ" does not point it out. but Attributes table follow shows that there's an IEEE address in the command.

    Does that command need an IEEE address???

     

    Tuong

     

     

  • Hello Tuong,

    You are correct, the byte sequence in the specfication needs to be updated, you will need to include the IEEE address of the coordinator when you are sending the ZDO_END_DEVICE_BIND_REQ. as in attribute list. The IEEE address of the coodinator needs to be after the local-coordinator field (which is the end-device source address)  as in the attribute list.

    Let me know if this works for you.

    Regards,

    Suyash Jain

  • Hi,


    Thanks for your response!

    I found that in SampleLight project (ZAP-MSP430-2.5.0) They use ZDP_EndDeviceBindReq (zcl_samplelight.c, zap_zdo.c)
    but not include IEEE address.

    if ( keys & HAL_KEY_SW_2 )
      {
        // Initiate an End Device Bind Request, this bind request will
        // only use a cluster list that is important to binding.
        dstAddr.addrMode = afAddr16Bit;
        dstAddr.addr.shortAddr = 0;   // Coordinator makes the match
        ZDP_EndDeviceBindReq( &dstAddr, NLME_GetShortAddr(),
                               SAMPLELIGHT_ENDPOINT,
                               ZCL_HA_PROFILE_ID,
                               ZCLSAMPLELIGHT_BINDINGLIST, bindingInClusters,
                               0, NULL,   // No Outgoing clusters to bind
                               TRUE );
      }

    Is the ZNP for that project the same the ZNP in mini kit ?

    I experiment with one end device and one coordinator. I tested ZDO_END_DEVICE_BIND_REQ:

    LocalCoordinator=0x0000 -> SRSP Status = 0x02 -> don't receive CallBack

    LocalCoordinator=End Device Short Address -> SRSP Status = 0x00 -> CallBack said Timeout (0x85)

    I thought LocalCoordinator should be parent of End Device???

    I also added IEEE addr as you said but it did't work.

     

    Tuong

  • Hello Tuong,

    To understand the complete process of binding using ZDO_END_DEVICE_BIND_REQ command refer to Z-Stack Developers Guide Section 4.1.1.2. This document is included with Z-Stack Install at C:\Texas Instruments\ZStack-CC2530-2.5.0\Documents.

    I will recommend sending to the ZNP the following packet structure, I was able to see that the End Device Bind Request was sent over the air to the coordinator, the coordinator should recieve End Device bind request from another end device within the timeout as explained in the Z-Stack developers guide, which should have matching cluster ID (input should match to the output cluster ID), and Succesful bind operation was performed. Please try sending this packet structure to the ZNP and see if you can recieve the success status. Also, ensure that on both the end devices binding is allowed.

        znpBuf[0] = 21;
        znpBuf[1] = MSB(ZDO_END_DEVICE_BIND_REQ);
        znpBuf[2] = LSB(ZDO_END_DEVICE_BIND_REQ);  
        znpBuf[3] = 0x00;  //Dst addr = 00 always
        znpBuf[4] = 0x00;  //Dst addr = 00 always
        znpBuf[5] = LSB(Short Address of the device);
        znpBuf[6] = MSB(Short Address of the device);
        znpBuf[7] = 0xXX; //IEEE Address Coordinator
        znpBuf[8] = 0xXX;
        znpBuf[9] = 0xXX;
        znpBuf[10] =0xXX;
        znpBuf[11] =0xXX;
        znpBuf[12] =0xXX;
        znpBuf[13] =0xXX;
        znpBuf[14] =0xXX;  //End IEEE Address Coordinator
        znpBuf[15] = 0xXX; //endpoint
        znpBuf[16] = 0xXX; //LSB profile Id
        znpBuf[17] = 0xXX; //MSB profile Id
        znpBuf[18] = 1; //number of input clusters
        znpBuf[19] = 1;  //LSB(Cluster ID)
        znpBuf[20] = 0;  //MSB(Cluster ID)
        znpBuf[21] = 1;//number of output clusters
        znpBuf[22] = 1; //LSB(Cluster ID)
        znpBuf[23] = 0; //MSB(Cluster ID)

    Regards,

    Suyash Jain

  • Hi, Suyash

    You're right. It works!

    I finally can bind them together. Thanks for all instructions, Suyash.

     

    Tuong

  • Hi, I am trying to use the ZDO_BIND_REQ on the CC2530 as well. I am able to successfully bind this on a local device (by using the source address as an input), but when I try this on a remote device it no longer works.

    I am issuing a bind request from an end device 0x00124B00023A76C0 to coordinator 0x00124B00045F400 to bind srcEndpoint on 0x00124B00023A76C0 to dstEndpoint on 0x00124B00045F400.

    These are the following parameters:

    requestCommand = BIND command

    zmBuf[0] = ZDO_BIND_REQ_PAYLOAD_LEN;
    zmBuf[1] = MSB(requestCommand);
    zmBuf[2] = LSB(requestCommand);

    zmBuf[3] = LSB(dstAddr);
    zmBuf[4] = MSB(dstAddr);

    zmBuf[5]=0xC0;
    zmBuf[6]=0x76;
    zmBuf[7]=0x3A;
    zmBuf[8]=0x02;
    zmBuf[9]=0x00;
    zmBuf[10]=0x4B;
    zmBuf[11]=0x12;
    zmBuf[12]=0x00;

    zmBuf[13] = srcEndpoint;
    zmBuf[14] = LSB(clusterId);
    zmBuf[15] = MSB(clusterId);
    zmBuf[16] = dstAddressMode; //0x03 64-bit address mode

    // Destination (Coordinator) IEEE

    zmBuf[17]=0x00;
    zmBuf[18]=0xF4;
    zmBuf[19]=0x45;
    zmBuf[20]=0x02;
    zmBuf[21]=0x00;
    zmBuf[22]=0x4B;
    zmBuf[23]=0x12;
    zmBuf[24]=0x00;


    zmBuf[25] = dstEndpoint;

    Is this the correct way to issue a bind on a remote node?

    Also, what is the functional difference between the ZDO_END_DEVICE_BIND vs ZDO_BIND? Is the ZDO_BIND more for general purposes (including end devices)?

    Thank you!

  • Binding works now:

    When sending from end_device to be binded to coordinator, the dstAddr was set to the sender's address. Same when sending from the Coordinator.

    How would I send a message once the devices are bounded, using AF_DATA_REQUEST or AF_DATA_REQUEST_EXT methods? I think I saw a previous post, but it was only for ZB_SEND_DATA.

  • Ok, sending data works now.

    AF_DATA_REQUEST_EXT needs to be used, with DstAddrMode= 0x00 (ADDRESS_NOT_FOUND). The CC2530ZNP interface spec only indicates 2 modes for this under AF_DATA_REQUEST_EXT, but I guess it looks like it can handle the methods indicated in ZDO_BIND_REQUEST. If so, I'm also assuming that you can use this method to send messages to groups as well (will test to confirm).

  • Has anyone got grouping to work with the CC2530ZNP?

    It seems that I am successfully able to successfully execute a binding to a group, and send a message to a group. However, on the receiver I am not able to receive the message, yet the sender receives a AF_DATA_CONFIRM.

    Back to the example - I have tried several cases:

    1. From the end device, I send a bind request to the coordinator, to bind the coordinator's endpoint to a group

    destAddr = 0x00, srcendpoint=something, srcAddr=Coordinator's MAC address, destMode = Group, destAddr=groupname

    So I'm assuming the coordinator's endpoint is now bound to the group.

    I then send an AF_DATA_REQUEST_EXT from the end device with destMode = Group, and destAddr=groupname , hoping I would see the Coorinator respond to this. Although the end node receives the AF_DATA_CONFIRM, the Coordinator doesn't receive the  message (SRDY pin never goes down).

    2. I try the same, but instead I bind the end device to the group from the end device. I also bind the Coordinator to the group to itself. Both nodes, in this case sent a bind case to itself. I issue the same AF_DATA_REQUEST_EXT command as in 1. The results however are the same.

    Is there anything wrong with the procedure, or my logic? If the two nodes are bound to the same group, shouldn't a group message send be recognized by the coordinator? Or is group messaging simply not supported on the ZNP interface?