The reporting by ZB_ZCL_SET_ATTRIBUTE is very slow.

Hi,

We have implemented a custom attribute reporting function based on IasZone. However, there is a very long delay in reporting device attributes, which may range from a few seconds to over ten seconds.

The ZB_SCHEDULE_CALLBACK function is called in the ZB_ZCL_SET_ATTRIBUTE function to request an actual data transmission, but it will take a very long time to be called. That's why attribute reporting takes a very long time.

I couldn't find any special configuration instructions for the ZB_SCHEDULE_CLLBACK function. So what caused this problem?

Bset regards,

Dunlianglight_switch_54l15_debug20250327.zip

Parents
  • Hi, 

    Not sure how you send the attribute report since you have not included the changes you made to ZB_ZCL_SET_ATTRIBUTE, and I don’t see any use of ZB_SCHEDULE_CLLBACK() in the code you attached.
    However, we were able to send attribute reports immediately upon a button press with the following:

    static void send_attr_report(zb_uint8_t bufid)
    {
    	struct zb_zcl_reporting_info_s *rep_info;
    
        // Allocate memory for the reporting info structure
        rep_info = ZB_BUF_GET_PARAM(bufid, struct zb_zcl_reporting_info_s);
    
        // Fill the reporting info structure
        rep_info->direction = ZB_ZCL_FRAME_DIRECTION_TO_CLI; 		// Direction: Server to Client
        rep_info->ep = MULTI_SENSOR_ENDPOINT;               		// Source endpoint
        rep_info->cluster_id = ZB_ZCL_CLUSTER_ID_TEMP_MEASUREMENT;  // Cluster ID
        rep_info->cluster_role = ZB_ZCL_CLUSTER_SERVER_ROLE; 		// Cluster role: Server
        rep_info->attr_id = ZB_ZCL_ATTR_TEMP_MEASUREMENT_VALUE_ID; 	// Attribute ID
        rep_info->dst.short_addr = parent_device_ctx.short_addr;   	// Destination short address
        rep_info->dst.endpoint = parent_device_ctx.endpoint;       	// Destination endpoint
        rep_info->dst.profile_id = ZB_AF_HA_PROFILE_ID;            	// Profile ID (Home Automation)
    
    	zb_zcl_send_report_attr_command(rep_info, bufid);
    	LOG_INF("Attribute report sent");
    }
    I called the send_attr_report() function with zb_buf_get_out_delayed() in my button handler:
    
    
    
    zb_buf_get_out_delayed(send_attr_report);
    In order for reporting to work, the client (ZC in my case) had to have already configured binding and attribute reports. Once this was configured, the device could send attribute reports immediately.
    
     
    
    They might see the same delay when using zb_buf_get_out_delayed() as with ZB_SCHEDULE_APP_ALARM() since both go through the scheduler. If so, the only way to avoid the delay would be to call the function directly without scheduling, but I would not recommend this.

    I called the send_attr_report() function with zb_buf_get_out_delayed() in my button handler:

    zb_buf_get_out_delayed(send_attr_report);

    For reporting to work, the client (ZC in my case) had to have already configured binding and attribute reports. Once this was configured, the device could send attribute reports immediately.

    You might see the same delay when using zb_buf_get_out_delayed() as with ZB_SCHEDULE_APP_ALARM() since both go through the scheduler. If so, the only way to avoid the delay would be to call the function directly without scheduling, but we would not recommend this.

    -Amanda H.

Reply
  • Hi, 

    Not sure how you send the attribute report since you have not included the changes you made to ZB_ZCL_SET_ATTRIBUTE, and I don’t see any use of ZB_SCHEDULE_CLLBACK() in the code you attached.
    However, we were able to send attribute reports immediately upon a button press with the following:

    static void send_attr_report(zb_uint8_t bufid)
    {
    	struct zb_zcl_reporting_info_s *rep_info;
    
        // Allocate memory for the reporting info structure
        rep_info = ZB_BUF_GET_PARAM(bufid, struct zb_zcl_reporting_info_s);
    
        // Fill the reporting info structure
        rep_info->direction = ZB_ZCL_FRAME_DIRECTION_TO_CLI; 		// Direction: Server to Client
        rep_info->ep = MULTI_SENSOR_ENDPOINT;               		// Source endpoint
        rep_info->cluster_id = ZB_ZCL_CLUSTER_ID_TEMP_MEASUREMENT;  // Cluster ID
        rep_info->cluster_role = ZB_ZCL_CLUSTER_SERVER_ROLE; 		// Cluster role: Server
        rep_info->attr_id = ZB_ZCL_ATTR_TEMP_MEASUREMENT_VALUE_ID; 	// Attribute ID
        rep_info->dst.short_addr = parent_device_ctx.short_addr;   	// Destination short address
        rep_info->dst.endpoint = parent_device_ctx.endpoint;       	// Destination endpoint
        rep_info->dst.profile_id = ZB_AF_HA_PROFILE_ID;            	// Profile ID (Home Automation)
    
    	zb_zcl_send_report_attr_command(rep_info, bufid);
    	LOG_INF("Attribute report sent");
    }
    I called the send_attr_report() function with zb_buf_get_out_delayed() in my button handler:
    
    
    
    zb_buf_get_out_delayed(send_attr_report);
    In order for reporting to work, the client (ZC in my case) had to have already configured binding and attribute reports. Once this was configured, the device could send attribute reports immediately.
    
     
    
    They might see the same delay when using zb_buf_get_out_delayed() as with ZB_SCHEDULE_APP_ALARM() since both go through the scheduler. If so, the only way to avoid the delay would be to call the function directly without scheduling, but I would not recommend this.

    I called the send_attr_report() function with zb_buf_get_out_delayed() in my button handler:

    zb_buf_get_out_delayed(send_attr_report);

    For reporting to work, the client (ZC in my case) had to have already configured binding and attribute reports. Once this was configured, the device could send attribute reports immediately.

    You might see the same delay when using zb_buf_get_out_delayed() as with ZB_SCHEDULE_APP_ALARM() since both go through the scheduler. If so, the only way to avoid the delay would be to call the function directly without scheduling, but we would not recommend this.

    -Amanda H.

Children
No Data
Related