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.

LP-CC2652RB: How can i add devices into groups at runtime?

Part Number: LP-CC2652RB
Other Parts Discussed in Thread: Z-STACK, SIMPLELINK-CC13XX-CC26XX-SDK

Hi, i hope this doesn't sound too stupid. I want to practice zigbee development and find a way to add a set of devices into groups of varying size at runtime from a coordinator device. I imagine this is similar to the way home automation apps work where you can create groups of devices from their web application.

However, there's a few thing which are unclear to me:

  1. How can i know which device is which? If i have tens of devices, that means i have to hold a container of tens of short addresses inside my coordinator, so i can always associate device X with its address?
  2. All i have to do is send the "Add Group" command from the coordinator to the desired device?
  • Hi,

    Without getting into too much detail, have you first completed the Zigbee ZCL SimpleLink Academy Lab?  The second part contains information about adding groups with zclGeneral_SendGroupAdd.  I also recommend that you further review the Z-Stack Overview section of the User's Guide.  You can keep track of the short addresses within your Zigbee application.

    Regards,
    Ryan

  • 1. Yes, we usually maintain a device list inside application on coordinator.

    2. You can send ZCL add group commands from coordinator or you can add group on device itself. However, we seldom do add group on device itself since device usually doesn’t know what group to join by itself.

  • Thanks a lot, i wasn't aware of that particular project you sent me. Will take a close look at all those samples.

  • Hi. Didn't want to make a new topic, but have encountered a really weird issue with group Adding. Was planning on playing around with groups and group addressing as suggested by Ryan in this example . However, whenever i try and send a group request i get two weird error messages: Symbol ||$O1$$|| has already been defined. The messages are located at seemingly random LOCs (one of which is actually a comment) and only appear when using zclGeneral_SendGroupAdd. I went as far as copy-paste code from the tutorial and the same errors persist.

        case zstackmsg_CmdIDs_ZDO_MATCH_DESC_RSP:
        {
            zstackmsg_zdoMatchDescRspInd_t  *pInd = (zstackmsg_zdoMatchDescRspInd_t *) pMsg;
    
            afAddrType_t dstAddr;
            zclGeneral_Scene_t *scene;
            memset(&dstAddr, 0x00, sizeof(afAddrType_t));
            dstAddr.addrMode = afAddr16Bit;
            dstAddr.addr.shortAddr = pInd->rsp.nwkAddrOfInterest;
            uint8_t i;
            for (i = 0; i < pInd->rsp.n_matchList; i++)
            {
                dstAddr.endPoint = pInd->rsp.pMatchList[i];
    
                zstack_getZCLFrameCounterRsp_t Rsp;
                Zstackapi_getZCLFrameCounterReq(sampleApp_serviceTaskId, &Rsp);
    
                zclGeneral_SendGroupAdd(SAMPLEAPP_ENDPOINT, &dstAddr, GROUP_ID, groupName, false, Rsp.zclFrameCounter);
    //            zclGeneral_SendGroupView(SAMPLEAPP_ENDPOINT, &dstAddr, GROUP_ID, false, Rsp.zclFrameCounter); // no error
    //            zclGeneral_SendAddScene(SAMPLEAPP_ENDPOINT, &dstAddr, scene, false, Rsp.zclFrameCounter); // mock-up to try scenes cluster as well; no error
            }
        }
        break;

    Any idea why this might happen?

  • I copied your zstackmsg_CmdIDs_ZDO_MATCH_DESC_RSP code directly and was able to have it successfully build the SIMPLELINK-CC13XX-CC26XX-SDK v5.30 zc_sw project in CCS v11.0 after changing groupName, SAMPLEAPP_ENDPOINT, and sampleApp_serviceTaskId to match my example's naming conventions.  Make sure to follow all steps verbatim and check your SDK version.  You can also try cleaning then rebuilding the code or list any other changes you've made which could have caused this issue.

    Regards,
    Ryan

  • Try to do mass erase chip and build/download application to test again