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.

LAUNCHXL-CC26X2R1: zed_genericapp won't report to coordinator

Part Number: LAUNCHXL-CC26X2R1

Hi,

I would like to build an end device that reports attribute data back to a concentrator that is connected to zigbee2mqtt.

I cloned zed_genericapp and added two attributes, ATTRID_BASIC_MODEL_IDENTIFIER (mandantory for zigbee2mqtt) and:

unsigned char zclGenericApp_iov_stateText[256];

...

{
ZCL_CLUSTER_ID_GENERAL_MULTISTATE_VALUE_BASIC,
{ // Attribute record
ATTRID_IOV_BASIC_STATE_TEXT,
ZCL_DATATYPE_CHAR_STR,
(ACCESS_CONTROL_READ | ACCESS_CONTROL_WRITE | ACCESS_REPORTABLE),
(void *)zclGenericApp_iov_stateText,
}
},

Also added ZCL_CLUSTER_ID_GENERAL_MULTISTATE_VALUE_BASIC to zclGenericApp_InClusterList.

With this setup I'm able to set a new value from zigbee2mqtt and request that value back.

Now I want to report that value upon key press. I modified zclGenericApp_processKey to:

if(_btn == gRightButtonHandle)
{

// Zstackapi_bdbResetLocalActionReq(appServiceTaskId);
ZStatus_t status = bdb_RepChangedAttrValue(
GENERICAPP_ENDPOINT,
ZCL_CLUSTER_ID_GENERAL_MULTISTATE_VALUE_BASIC,
ATTRID_IOV_BASIC_STATE_TEXT
);
}

In this function I'm encountering a problem,

if( FLAGS_CHECKFLAG( bdb_reportingClusterEndpointArray[indexClusterEndpoint].flags, BDBREPORTING_HASBINDING_FLAG_MASK ) == BDBREPORTING_FALSE )

is true, so no report will be sent.

What does this mean? No binding? I've done "left button" before and have a nice connection to my concentrator I think. There's Association Request/Response, Key Exchange, Node Descriptor Request/Response, though no Bind Request.

Any help is appreciated...

Regards,
Frithjof

  • Hi Frithjof,

    It is assumed that the device sending reports should have a bind which contains the cluster and attribute ID being used.  MT command ZDO_BIND_REQ (for ZNP) or Z-Stack API Zstackapi_ZdoBindReq (ZCL projects) should help create a manual bind if automatic cannot be achieved through BDB Finding and Binding.  You can also add attributes records to the reporting list using Zstackapi_bdbRepAddAttrCfgRecordDefaultToListReq.  I recommend that you review the Zigbee Fundamental Project Development SimpleLink Academy Lab and perhaps try to get reporting to work using the zed_temperaturesensor or zed_light before implementing your custom solution.  You can also refer to the zigbee2mqtt Github discussion board for questions regarding this system.

    Regards,
    Ryan

  • Hello Ryan,

    thank you for the suggested reading.

    It turned out that zigbee2mqtt wouldn't request a bind to that cluster.

    With the information from SimpleLink Academy (Part 2: Send raw data) I eventually solved my issue and send a hand crafted "Attribute Report" Command.

    zstack_afDataReq_t pReq;
    ...
    // hand-craft a report attributes command
    pPayload[0] = 0b0001000; // frame control field
    //  - disable default response: false
    //   - direction: server to client
    //    - manufacturer specific: false
    //     -- frame type: profile-wide
    pPayload[1] = sequence_number;
    pPayload[2] = ZCL_CMD_REPORT;
    OsalPort_memcpy ( pPayload+3, &attribute_id, 2 );
    pPayload[5] = attribute_datatype;
    pPayload[6] = len;
    OsalPort_memcpy ( pPayload+7, bytes, len );
    
    pReq.n_payload = len + 7;
    pReq.pPayload = pPayload;
    
    ret = Zstackapi_AfDataReq(appServiceTaskId, &pReq);
    

    I guessed the payload header from wireshark output.

    Is there documentation about these seven bytes payload header?

    Thanks,

    Frithjof

  • This would be deduced from the Zigbee Cluster Library Specification, here is revision 6 although the latest supported version is ZCLv7.

    Regards,
    Ryan