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.

WEBENCH® Tools/cc2531: Mesh not work

Part Number: CC2531
Other Parts Discussed in Thread: CC2531, Z-STACK

Tool/software: WEBENCH® Design Tools

Hello.

I have my own development on cc2531. I'm trying to start a network from one coordinator and a router using examples in the directory Texas Instruments\Z-Stack 3.0.1\Projects\zstack\HomeAutomation. I have corrected the project and the devices are connected to each other (event ZDO_NEW_DEVICE received and process), but the data exchange does not happen when the function zclGeneral_SendOnOff_CmdToggle( SAMPLESW_ENDPOINT, &zclSampleSw_DstAddr, FALSE, 0 );  is called. There is a simple example where two devices communicate on a timer? Thanks.

  • Do you do binding to make the SampleSwitch knows destination to send zclGeneral_SendOnOff_CmdToggle.
  •  No, I do not. Can you tell me how do right binding?

  • It's use BDB to do finding and binding in Z-Stack 3.0.3. However it implements BDB using LCD as interface. You use CC2531 and I suppose you don't have LCD so I suggest you to refer to SampleLight and SampleSwitch example in Z-Stack Home 1.2.2a to know how SW2 trigger end device binding from both SampleLight and SampleSwitch to do binding.
  • Thanks for your answer, I'll try it.

  • Hello.

    I try to understand how SampleSwitch project work, but I can not find the place where the binding function is called.  I analyzed the SW2 button processing code and did not find an event binding. You can show the place in the code where it happens? Thanks.

  • You can look for the BDB_FINDING_BINDING_CAPABILITY_ENABLED macro to check the finding and binding process.
  • If you are studying SampleSwitch example in Z-Stack Home 1.2.2a as I suggested, you can refer to the following red lines in zclSampleSw_HandleKeys for end device bind.

    static void zclSampleSw_HandleKeys( byte shift, byte keys )
    {
      // toggle remote light
      if ( keys & HAL_KEY_SW_1 )
      {
        giSwScreenMode = SW_MAINMODE;   // remove help screen if there

        // Using this as the "Light Switch"
    #ifdef ZCL_ON_OFF
        zclGeneral_SendOnOff_CmdToggle( SAMPLESW_ENDPOINT, &zclSampleSw_DstAddr, FALSE, 0 );
    #endif
    #ifdef LCD_SUPPORTED
        HalLcdWriteString( (char *)sCmdSent, HAL_LCD_LINE_2 );

        // clear message on screen after 3 seconds
        osal_start_timerEx( zclSampleSw_TaskID, SAMPLESW_MAIN_SCREEN_EVT, 3000 );
    #endif
      }

      // invoke EZ-Mode
      if ( keys & HAL_KEY_SW_2 )
      {
        giSwScreenMode = SW_MAINMODE;   // remove help screen if there

    #ifdef ZCL_EZMODE
        {
          zclEZMode_InvokeData_t ezModeData;
          static uint16 clusterIDs[] = { ZCL_CLUSTER_ID_GEN_ON_OFF };   // only bind on the on/off cluster

          // Invoke EZ-Mode
          ezModeData.endpoint = SAMPLESW_ENDPOINT; // endpoint on which to invoke EZ-Mode
          if ( (zclSampleSw_NwkState == DEV_ZB_COORD) ||
                   (zclSampleSw_NwkState == DEV_ROUTER)   ||
                   (zclSampleSw_NwkState == DEV_END_DEVICE) )
          {
            ezModeData.onNetwork = TRUE;      // node is already on the network
          }
          else
          {
            ezModeData.onNetwork = FALSE;     // node is not yet on the network
          }
          ezModeData.initiator = TRUE;        // OnOffSwitch is an initiator
          ezModeData.numActiveOutClusters = 1;   // active output cluster
          ezModeData.pActiveOutClusterIDs = clusterIDs;
          ezModeData.numActiveInClusters = 0;  // no active input clusters
          ezModeData.pActiveInClusterIDs = NULL;
          zcl_InvokeEZMode( &ezModeData );

     #ifdef LCD_SUPPORTED
          HalLcdWriteString( "EZMode", HAL_LCD_LINE_2 );
     #endif
        }

    #else // NOT ZCL_EZMODE
        // bind to remote light
        zAddrType_t dstAddr;
        HalLedSet ( HAL_LED_4, HAL_LED_MODE_OFF );

        // 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(),
                               SAMPLESW_ENDPOINT,
                               ZCL_HA_PROFILE_ID,
                               0, NULL,   // No incoming clusters to bind
                               ZCLSAMPLESW_BINDINGLIST, bindingOutClusters,
                               TRUE );
    #endif // ZCL_EZMODE
      }

    ....

  • Thank you,

    I understand. What is the difference between Z-Stack Home 1.2.2a and Z-Stack 3.0.1? Does the project use different or the same version of the stack? The Z-Stack 3.0.1 example uses bdb_StartCommissioning with the BDB_COMMISSIONING_MODE_FINDING_BINDING parameter for bind?

    I checked BDB_FINDING_BINDING_CAPABILITY_ENABLED enabled.
  • Z-Stack Home 1.2.2a is based on Zigbee HA profile and Z-Stack 3.0 is based on Zigbee 3.0 spec. Basically, end device binding can be supported on both HA profile and Zigbee 3.0. BDB is only supported by Zigbee 3.0.