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.

Binding in a network with multiple nodes with same cluster ID



I am having problem with binding and targeting a specific node among multiple similar nodes.

1. In EZ-mode binding, as far as I understand, both of the devices that are to be bound, have to be interacted with by a key press, or some other way. But I need to make a binding entry between two nodes/endpoints where one of the nodes can not be interacted with, it can be accessed only OTA(over the air). How can it be done?


2. If I have multiple devices of the same type, say, 4 lights and I need to control the lights individually a single controller end point/node, how can I do it?

  • 1. You can use ZDP_BindReq

    2. Do you have multiple buttons on your controller. If yes, you can use different endpoint for different button and bind to different light.

  • Thanks a lot, YiKai Chen.

  • Thank you a lot for providing all the answers.As little as I know now about ZigBee, all thanks to you. I have a few more problems though-

    1. As far as I understand, in EZ_mode binding message exchanges can be bidirectional. In ZDP_BindReq, is the transfer unidirectional, from the 'SourceAddrs' to the 'DestinationAddrs' passed as the argument when ZDP_BindReq is called?

    2. In Home Automation Demo examples, for CC2530EB target, push button 1 is used as "shift" key. If I want to use just the push button interrupt with the code-

    if( keys & HAL_KEY_SW_6)

    {

    ............................

    in the 'zclSampleLight_HandleKeys()' function, it doesn't seem to work. What is the problem ?

    3. How can I create a 100us timer triggered event?

  • 1. ZDP_BindReq is unidirectional. if you want to send message from A node to B node after ZDP_BindReq, you should put A as source and B as destination.

    2. Would you specify what port and pin do you use as GPI of push button? If you know it, you can refer to hal_key.c to see how it works on SW6.

    3. The minimum duration of event is 1 milli-second. 

  • Thank you for your response. In the hal_key.c-

    /* CPU port interrupt */
    #define HAL_KEY_CPU_PORT_0_IF P0IF
    #define HAL_KEY_CPU_PORT_2_IF P2IF

    /* SW_6 is at P0.1 */
    #define HAL_KEY_SW_6_PORT   P0
    #define HAL_KEY_SW_6_BIT    BV(1)
    #define HAL_KEY_SW_6_SEL    P0SEL
    #define HAL_KEY_SW_6_DIR    P0DIR

    /* edge interrupt */
    #define HAL_KEY_SW_6_EDGEBIT  BV(0)
    #define HAL_KEY_SW_6_EDGE     HAL_KEY_FALLING_EDGE


    /* SW_6 interrupts */
    #define HAL_KEY_SW_6_IEN      IEN1  /* CPU interrupt mask register */
    #define HAL_KEY_SW_6_IENBIT   BV(5) /* Mask bit for all of Port_0 */
    #define HAL_KEY_SW_6_ICTL     P0IEN /* Port Interrupt Control register */
    #define HAL_KEY_SW_6_ICTLBIT  BV(1) /* P0IEN - P0.1 enable/disable bit */
    #define HAL_KEY_SW_6_PXIFG    P0IFG /* Interrupt flag at source */

    /* Joy stick move at P2.0 */
    #define HAL_KEY_JOY_MOVE_PORT   P2
    #define HAL_KEY_JOY_MOVE_BIT    BV(0)
    #define HAL_KEY_JOY_MOVE_SEL    P2SEL
    #define HAL_KEY_JOY_MOVE_DIR    P2DIR

    /* edge interrupt */
    #define HAL_KEY_JOY_MOVE_EDGEBIT  BV(3)
    #define HAL_KEY_JOY_MOVE_EDGE     HAL_KEY_FALLING_EDGE

    /* Joy move interrupts */
    #define HAL_KEY_JOY_MOVE_IEN      IEN2  /* CPU interrupt mask register */
    #define HAL_KEY_JOY_MOVE_IENBIT   BV(1) /* Mask bit for all of Port_2 */
    #define HAL_KEY_JOY_MOVE_ICTL     P2IEN /* Port Interrupt Control register */
    #define HAL_KEY_JOY_MOVE_ICTLBIT  BV(0) /* P2IENL - P2.0<->P2.3 enable/disable bit */
    #define HAL_KEY_JOY_MOVE_PXIFG    P2IFG /* Interrupt flag at source */



    HAL_ISR_FUNCTION( halKeyPort0Isr, P0INT_VECTOR )
    {
      HAL_ENTER_ISR();

      if (HAL_KEY_SW_6_PXIFG & HAL_KEY_SW_6_BIT)
      {
        halProcessKeyInterrupt();
      }

      /*
        Clear the CPU interrupt flag for Port_0
        PxIFG has to be cleared before PxIF
      */
      HAL_KEY_SW_6_PXIFG = 0;
      HAL_KEY_CPU_PORT_0_IF = 0;
     
      CLEAR_SLEEP_MODE();
      HAL_EXIT_ISR();
    }

    uint8 HalKeyExitSleep ( void )
    {
      /* Wake up and read keys */
      return ( HalKeyRead () );
    }

    uint8 HalKeyRead ( void )
    {
      uint8 keys = 0;

      if (HAL_PUSH_BUTTON1())
      {
        keys |= HAL_KEY_SW_6;
      }

      if ((HAL_KEY_JOY_MOVE_PORT & HAL_KEY_JOY_MOVE_BIT))  /* Key is active low */
      {
        keys |= halGetJoyKeyInput();
      }

      return keys;
    }

    What I have gathered from this code is that,  if(keys & HAL_KEY_SW_6) in handle keys function should work, but it doesn't. http://e2e.ti.com/support/wireless_connectivity/f/158/p/213740/755346.aspx#755346 - this post says that due to compiler optimization, it doesn't work. But I don get how to implement the break point and where? Please do help as you always do. Thanks a lot again.

  • Try to refer to post at http://e2e.ti.com/support/wireless_connectivity/f/158/t/216165.aspx

  • It's working fine now. Thanks a lot.

  • Sorry to bother you again. I have implemented timer and H/W interrupt according to your suggestions. A lot many thanks to you for those. However, now I am trying to use ZDP_BindReq() as per your suggestion. I have couple of questions though-

    1. Let, I have a Coordinator, two routers and an end device in my network. Can I use ZDP_BindReq() to bind "a router to an end device" or two routers?

    2. As far as I understand, in the ZDP_BindReq(), dstAddr and SourceAddr will always be of the same node/End point. Am I wrong?
    Assuming I got it right- Let, I want to send messages from End Device 'ED' to a router 'R', so the SourceAddr will be the ED and the dstAddr will also be the ED. But can I call ZDP_BindReq() in the code for the ED?

    3. In ZDP_BindReq(), dstAddr is of the type zAddrType_t. Therefore, can any addrMode-shortAddr/extAddr can be used? For the case in question 2, let, the router,R,  is the parent node of the ED.

    zAddrType_t dstAddr;

    dstAddr.addrMode=afAddr16Bit;

    dstAddr.addr.shortAddr=NLME_GetShortAddr;

    ZDP_BindReq(&dstAddr, NLME_GetExtAddr(), Source_ENDPOINT, TARGET_CLUSTER_ID, NLME_GetCoordExtAddr(), DEST_ENDPOINT, 0);

    The code doesn't compile. There is a type mismatch with the red marked argument I guess. How can I resolve it?

    4. If I already know the 64 bit IEEE address of either the SourceAddr or the DestinationAddr, how do I use that in the argument of ZDP_BindReq?

  • Fortunately I have solved the issues. Thanks.

  • It's good to know you solve the problem. Would you describe how you solve the issue to benefit other have the same issue.

  • Sorry for the late.

    3. All address arguments of ZDP_BindReq() is of type zAddrType_t. However, 'addrMode' is different. dstAddr is of Addr16Bit mode, SourceAddr & DestinationAddr is of Addr64Bit mode.

    1, 2 & 4. I used two nodes, so one had to be a coordinator, but I guess ZED to ZED or ZR to ZED should work.I knew the 64bit IEEE address of the ZC. However, to send messages from the End Device (ZED) to the Coordinator (ZC), I used ZDP_Bind request with

    dstAddr : ZED (zAddrType_t with addrMode=Addr16Bit, shortAddr=NLME_GetShortAddr())

    SourceAddr: ZED (zAddrType_t with AddrMode=Addr64Bit), NLME_GetExtAddr() can be used directly.

    DestinationAddr:

    zAddrType_t DstAddr;

    dstAddr.addrMode=Addr64Bit;

    uint8 ZC_IEEE_Addr[8]={0x00, 0x12, 0x4B,.........}

    for(i=7;i>=0;i--){

    dstAddr.addr.extAddr[i]=ZC_IEEE_Addr[7-i];

    }

    Now, ZDP_BindReq() can be called in the ZED code.

  • Hi M,

    Thanks for sharing.