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.

CC2530: How the ZC in Zigbee set-up a network and how ZR or ZED connect the the network?

Part Number: CC2530
Other Parts Discussed in Thread: Z-STACK

Hello,

First of all, I'm new to Z-stack. Plz forgive me if my question is clumsy.

I read all examples in "Z-Stack 3.0.0\Projects\zstack\HomeAutomation" but I can't figure out how the ZC establishes a network and how ZR or ZED connectsthe the network?

I just wondered if ZC just set-up as Coodinator in building and then it starts, it automatically set-up a network, and ZR or ZED just connects the the ZC with same PAN ID automatically as well?

I read the Development Guide, It said we need to call "bdb_StartCommissioning" ( section 15-  Commissioning) to set up a network but  I just saw it handle callback function

Example: static void zclSampleDoorLock_ProcessCommissioningStatus(bdbCommissioningModeMsg_t* bdbCommissioningModeMsg)

Could anyone help me?

Thanks

  • bdb_StartCommissioning is called from uiActionStartComissioning.
  • It' correct on ZC but you should call bdb_StartCommissioning( BDB_COMMISSIONING_MODE_NWK_STEERING) to make ZR/ZED to join Zigbee network.
  • Thank YiKai,

    I have a question about "security keys for Centralized networks (default key or Install Code)".
    As I know Install Code is used for commissioning. I wonder if the install code must be the same at ZC and ZR/ZED? Or we just leave it default?
    "2. The BDB state machine will try to perform association and authentication in the suitable networks discovered using the security keys for Centralized networks (default key or Install Code) or Distributed networks as defined in section 10. For Centralized networks it will also perform the TCLK exchange."

  • If you change install code, the install code must be the same at ZC and ZR/ZED. If not, you can just leave it as default.
  • I read the Development Guide, as I understand, to connect "Sample Light" & "Sample Switch", the sequence as below:
    1. ZC: Forming a network, call Steering to wait for other device to connect
    ZED: Call steering to connect to network
    2. Then it call Finding & Binding base on the On/Off cluster. Then the Switch can use zclGeneral_SendOnOff_ to control the Light

    Is the above sequence correct? I do not have real device for testing so it hard to understand correctly :(

  • Yes, the sequence is correct.
  • Dear YiKai

    Could you explain the detail of the FIND_BINDING sequence? I know it will depend on their cluster to determine target enpoint, but the Z-stack example quite complicated For example: I want to bind SampleLight & SampleSwitch.


    I mean which parameters should we set-up before calling "bdb_StartCommissioning(BDB_COMMISSIONING_MODE_FINDING_BINDING)" for On/Off cluster, what should match in SampleLight & sampleSwitch?

  • 1. If two devices are to bind with each other, is it necessary for one of them to have a cluster ID defined as an output cluster and for the other to have the same cluster ID defined as an input cluster?

    Regarding SampleLight & SampleSwitch

    ***********LIGHT*****************************
    const cId_t zclSampleLight_InClusterList[] =
    {
    ZCL_CLUSTER_ID_GEN_BASIC,
    ZCL_CLUSTER_ID_GEN_IDENTIFY,
    ZCL_CLUSTER_ID_GEN_GROUPS,
    ZCL_CLUSTER_ID_GEN_SCENES,
    ZCL_CLUSTER_ID_GEN_ON_OFF
    #ifdef ZCL_LEVEL_CTRL
    , ZCL_CLUSTER_ID_GEN_LEVEL_CONTROL
    #endif
    };

    ***********SWITCH*****************************
    const cId_t zclSampleSw_InClusterList[] =
    {
    ZCL_CLUSTER_ID_GEN_BASIC,
    ZCL_CLUSTER_ID_GEN_IDENTIFY,
    ZCL_CLUSTER_ID_GEN_ON_OFF_SWITCH_CONFIG
    };

    #define ZCLSAMPLESW_MAX_INCLUSTERS ( sizeof( zclSampleSw_InClusterList ) / sizeof( zclSampleSw_InClusterList[0] ))

    const cId_t zclSampleSw_OutClusterList[] =
    {
    ZCL_CLUSTER_ID_GEN_IDENTIFY,
    ZCL_CLUSTER_ID_GEN_ON_OFF,
    ZCL_CLUSTER_ID_GEN_GROUPS,
    };



    2. The "ZCL_CLUSTER_ID_GEN_ON_OFF" is in the Input of Light and the output of Switch. But I saw other cluster like "Basic, Identify, group".
    So are they necessary for binding? What is their roles?

    3. And when finding & binding happen, if two endpoints have many clusters in input and output, which cluster is used for matching?

    Thanks

  • 1. Yes
    2. Basic, identity,... clusters are not needed for binding. You can read ZCL spec to know exactly what they are used.
    3. You have to specify clusters you want to bind when you do finding and binding process.
  • Thank YiKai

    Could you give more details about "3. You have to specify clusters you want to bind when you do finding and binding process."?
    I couldn't find out where they define specific clusters using for binding? Just a list of Input and output cluster
  • You can refer to 15.7.2 Finding and binding procedure for an initiator endpoint in Z-Stack 3.0 Developer's Guide.
  • I've read this chapter, but I'm still confused.
    "3. Upon the reception of a simple descriptor response, the local device will search for opposite matching application clusters with the endpoint in the local device that is performing the Finding and Binding procedure. For each matching cluster the local device will create a bind for the local device endpoint-cluster with the remote device from which it received the simple descriptor response. Refer to ZigBee ZCL specification for the definition of application clusters."

    For example:

    const cId_t zclSAMPLE_OutClusterList[] =
    {
    ZCL_CLUSTER_ID_GEN_IDENTIFY,
    ZCL_CLUSTER_ID_GEN_ON_OFF,
    ZCL_CLUSTER_ID_MS_TEMPERATURE_MEASUREMENT,
    ZCL_CLUSTER_ID_GEN_GROUPS,
    };

    So when i tries to find and bind by call: bdb_StartCommissioning(FINDING_BINDING). it will search for all endpoints that have a INPUT CLUSTER matches one of SAMPLE clusters? ( Maybe SAMPLE will bind with two different endpoints, one withON_OFF cluster and the other with TEMPERATURE_MEASUREMENT, Is that right?
  • Yes, that's right.
  • Thank YiKai for your help :)
  • You are welcome.
  • Hi. I read 15.7- Finding& Binding and I'm really confused.

    1. The Book said "The application must specify with which endpoint it wants to perform the finding and binding procedure by calling bdb_SetIdentifyActiveEndpoint()." but I couldn't find it in any example ( Light & Switch)? So when I need this function?

    2. Another question, when Binding, I wonder whether just Initiator call bdb_StartCommissioning(FINDING_BINDING) or both Initiator & target need to call this function at the same time?

    Thanks
  • 1. I have no idea why it says "The application must specify with which endpoint it wants to perform the finding and binding procedure by calling bdb_SetIdentifyActiveEndpoint().". If trace the source code for initiator , it follows the flow chart in Figure 20: Finding and binding procedure for an initiator endpoint and it doesn't call bdb_SetIdentifyActiveEndpoint.
    2. Both Initiator & target need to call bdb_StartCommissioning but don't have to call at the same time. bdb_StartCommissioning will setup a timeout so it can be called in sequential before timeout.
  • Hi YiKai ,
    I am learning z-stack3.0 bind , I read Z-Stack 3.0 Developer’s Guide 15.7- Finding& Binding . But I don't find where use bdb_SetIdentifyActiveEndpoint. May need ZDP_EndDeviceBindReq ? how bind in z-stack 3.0.
    thank you!