2024-06-17 01:25 AM
Hey,
I working on a project with the following goal: setup one central coordinator and let multiple sleepy end devices send sensor data periodically. For development I am trying to alter the code of the Zigbee_TempMeas_Client_Router/Zigbee_TempMeas_Server_Coord example projects, such that sending long strings is possible.
The setup is the following:
static const struct ZbZclAttrT ZclTemp_AttrList[] = {
{
MY_ZCL_DEV_LS, ZCL_DATATYPE_STRING_LONG_CHARACTER,
ZCL_ATTR_FLAG_REPORTABLE|ZCL_ATTR_FLAG_WRITABLE,
512, // custom size
NULL, // callback
{0, 0}, //no value range
{1, 10}
}
};
static void APP_ZIGBEE_ReportConfig(void)
{
uint16_t rep_change = (uint16_t) ZCL_REPORT_CHANGE;
struct ZbZclAttrReportConfigT report;
report.dst.endpoint = SW1_ENDPOINT;
report.dst.mode = ZB_APSDE_ADDRMODE_SHORT;
report.dst.nwkAddr = 0x0000;
report.num_records = 1;
report.record_list[0].direction = ZCL_REPORT_DIRECTION_NORMAL;
report.record_list[0].min = ZCL_MIN_REPORT; //10s
report.record_list[0].max = ZCL_MAX_REPORT; //10s
report.record_list[0].change = 0;
report.record_list[0].attr_id = MY_ZCL_DEV_LS;
report.record_list[0].attr_type = ZCL_DATATYPE_STRING_LONG_CHARACTER;
ZbZclAttrReportConfigReq(zigbee_app_info.custom_ls_server,&report,&APP_ZIGBEE_Report_cb,(void*)&rep_change);
}/*APP_ZIGBEE_ReportConfig*/
The problem:
I would appreciate any help.
Best regards!
Solved! Go to Solution.
2024-06-17 06:29 AM
Hi @user5 ,
Indeed, Zigbee_TempMeas_Client_Router and Zigbee_TempMeas_Server_Coord are not suitable for the SED configuration, as the router is sending a periodic Read command to the server to read measured temperature value.
In your case, The server is configured as a SED and is not supposed to receive commands asynchronously as it goes to the sleep mode most of the time. As you mentioned it succeeds the first time when the device join the network as it is active.
For your application such a Temperature sensor I recommend to use only the reporting to send periodically the measured values to the coordinator within the poll timeout, so no need to send read commands from the coordinator side.
Best regards,
Ouadi
2024-06-17 06:29 AM
Hi @user5 ,
Indeed, Zigbee_TempMeas_Client_Router and Zigbee_TempMeas_Server_Coord are not suitable for the SED configuration, as the router is sending a periodic Read command to the server to read measured temperature value.
In your case, The server is configured as a SED and is not supposed to receive commands asynchronously as it goes to the sleep mode most of the time. As you mentioned it succeeds the first time when the device join the network as it is active.
For your application such a Temperature sensor I recommend to use only the reporting to send periodically the measured values to the coordinator within the poll timeout, so no need to send read commands from the coordinator side.
Best regards,
Ouadi
2024-06-17 08:55 AM
Hey Ouadi,
im not familiar with the Zigbee Stack. From reading your response, I think you are referring to the function ZbZclAttrReportKick to remotely report. From this point on I have two more questions, as my setup is still not working:
1) Can I assume, that calling ZbZclAttrReportKick on server side results in APP_ZIGBEE_Temp_ls_client_report being the corresponding callback on client side?
2) Is this the correct setup on client side? Especially the adressing is confusing me.
2024-06-17 09:28 AM
Hi
Reporting is done automatically by the stack when it is enabled, no need to call any API from server side, Callback APP_ZIGBEE_Temp_ls_client_report would be triggered with the configured reporting period .
The nwkAddr = 0 corresponds to the coordinator's address, if the coordinator is the client then you have to set the correct nwkAddr that you can catch at the join, or set a broadcast destination mode => report.dst.nwkAddr = 0xFFFF.
Regards,
Ouadi
2024-06-18 07:05 AM
Hey,
thanks for the patient help.
I am sending the configuration to the end device as it joins now, but receive back error 0xC3, UNSUPPORTED_CLUSTER.
Unfortunately, I cant find any information on this in the official stm api docs or manufacture specific cluster docs.
Best regards,
Martin
2024-06-18 07:15 AM
Hi,
Could you share the file "app_zigbee.c" for both projects ?
Thanks
Ouadi
2024-06-18 07:31 AM
Hi,
I am not able to share code publicly.
Best regards
2024-06-19 12:54 AM
Hi,
I am not able to share code publicly. Is it possible to get contacted?
Best regards