This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Zigbee attribute reporting not reporting as configured.

Since migrating to the Zigbee 3.1 SDK I have noticed a few oddities with the behavior of attribute reporting that I am thinking are related to the following bugfix:

- Added configuring Default Reporting automatically for all attributes that support reporting,
with MinInterval equal to 5 sec, MaxInterval equal to 0 sec (no periodic reports), and Delta (analog attributes) equal to 0.

The end device that I am working on is connected to a SmartThings hub. The device handler I have written for the end device configures reporting for a number of attributes when the device is commissioned and all seems to work fine. Once my device establishes a connection I adjust the long poll interval and I log the sleep interval to the console. In SDK 3.0 the end device, upon reboot, would connect to the ST hub, report its attribute values, and eventually settle down and poll at the long poll interval. After moving to SDK 3.1 however, if the device is rebooted it never settles down and constantly polls at a shortened interval, behavior I usually observe after an attribute has been reported.

Prior to migrating to SDK 3.1 I came across this question in which the solution was to configure attribute reporting from the device. Although it seems the API has changed a little in SDK 3.1 I have the following for my configure reporting function and call this function in zboss_signal_handler on device first start/reboot.:

void configure_attribute_reporting()
    {
        zb_zcl_reporting_info_t temp_rep_info;
        memset(&temp_rep_info, 0, sizeof(temp_rep_info));
        
        temp_rep_info.direction = ZB_ZCL_CONFIGURE_REPORTING_SEND_REPORT;
        temp_rep_info.ep = MULTI_SENSOR_ENDPOINT;
        temp_rep_info.cluster_id = ZB_ZCL_CLUSTER_ID_TEMP_MEASUREMENT;
        temp_rep_info.cluster_role = ZB_ZCL_CLUSTER_SERVER_ROLE;
        temp_rep_info.attr_id = ZB_ZCL_ATTR_TEMP_MEASUREMENT_VALUE_ID;
        temp_rep_info.dst.profile_id = ZB_AF_HA_PROFILE_ID;
        temp_rep_info.u.send_info.min_interval = 30;      // 30 seconds
        temp_rep_info.u.send_info.max_interval = 300;    // 5 minutes
        temp_rep_info.u.send_info.delta.s16 = 0x0032;        // 0.5 degrees
        
        zb_zcl_reporting_info_t humid_rep_info;
        memset(&humid_rep_info, 0, sizeof(humid_rep_info));
        
        humid_rep_info.direction = ZB_ZCL_CONFIGURE_REPORTING_SEND_REPORT;
        humid_rep_info.ep = MULTI_SENSOR_ENDPOINT;
        humid_rep_info.cluster_id = ZB_ZCL_CLUSTER_ID_REL_HUMIDITY_MEASUREMENT;
        humid_rep_info.cluster_role = ZB_ZCL_CLUSTER_SERVER_ROLE;
        humid_rep_info.attr_id = ZB_ZCL_ATTR_REL_HUMIDITY_MEASUREMENT_VALUE_ID;
        humid_rep_info.dst.profile_id = ZB_AF_HA_PROFILE_ID;
        humid_rep_info.u.send_info.min_interval = 60;       // 60 seconds
        humid_rep_info.u.send_info.max_interval = 600;     // 10 minutes
        humid_rep_info.u.send_info.delta.u16 = 0x0064;         // 1% rh
        
        zb_zcl_reporting_info_t batt_rep_info;
        memset(&batt_rep_info, 0, sizeof(batt_rep_info));
        
        batt_rep_info.direction = ZB_ZCL_CONFIGURE_REPORTING_SEND_REPORT;
        batt_rep_info.ep = MULTI_SENSOR_ENDPOINT;
        batt_rep_info.cluster_id = ZB_ZCL_CLUSTER_ID_POWER_CONFIG;
        batt_rep_info.cluster_role = ZB_ZCL_CLUSTER_SERVER_ROLE;
        batt_rep_info.attr_id = ZB_ZCL_ATTR_POWER_CONFIG_BATTERY_REMAINING_ID;
        batt_rep_info.dst.profile_id = ZB_AF_HA_PROFILE_ID;
        batt_rep_info.u.send_info.min_interval = 30;       // 30 seconds
        batt_rep_info.u.send_info.max_interval = 21600;     // 5 minutes
        batt_rep_info.u.send_info.delta.u8 = 0x01;         // 1%
        
        // Prior to SDK 3.1 this function was zb_zcl_put_default_reporting_info(zb_zcl_reporting_info_t*)
        zb_zcl_put_reporting_info(&temp_rep_info, ZB_TRUE);    // Assume the override parameter here is to override the new default configuration.
        zb_zcl_put_reporting_info(&humid_rep_info, ZB_TRUE);
        zb_zcl_put_reporting_info(&batt_rep_info, ZB_TRUE);       
    }

With the device now configuring attribute reporting I seem to have fixed the problem above in that now between attribute updates (every minute), the device uses the long poll interval when sleeping unless an attribute is to be reported (without having to issue an attribute report configuration through SmartThings). This now leaves me with another set of issues that have me scratching my head a little.

  1. The temperature attribute to update every half degree with a maximum interval of 300 seconds. The problem, that is illustrated in the attached image, is that I am getting random reporting intervals that seem to completely ignore maximum interval.
    1. While writing this post it occurred to me that I am working with temperature in celsius on the device and it is translated to fahrenheit in SmartThings. I was expecting half degrees F, not C (doh).
  2. Relative humidity is configured to report every 600 seconds or every 1%. Again, the maximum interval appears to be ignored.
  3. Battery remaining percent changes too infrequently for me to have any data but given the points above I think I can safely assume it does not work as I want it to.

This leaves me with the following questions:

  1. When configuring the reporting value delta should we be using the hex value or integer value? I am leaning towards a hex value based on the observations in the above image and when configuring reporting in SmartThings, they use a hex value. Which is correct?
  2. What could be the cause of my maximum interval being ignored? I am wondering if just because I am configuring reporting locally to the device perhaps the central is not acknowledging it. I'm guessing a "re-binding" needs to occur on the central for reporting.
    1. Would setting temp_rep_info.dst.short_addr have any effect in triggering the central/hub to bind to the report?
    2. Regardless of the settings the end device configures for reporting, the central has to explicitly bind to these correct?
  3. If the device does not configure reporting as I have done above and relies on the hub to configure reporting, as my ST device handler does, what is the process for saving those parameters so that when the device reboots it does not have to be configured by the hub/device handler (or any other way other hubs handle devices). Are we to utilize zb_zcl_reporting_info_nvram_t?

Thanks in advance

-Patrick

Parents
  • Hi Patrick.

    Could you provide me with Sniffer Logs and the whole main.c? Also, are you only making the end device, do you have other devices as well?

    1) Try to use integers, not hex.

    2) It would be great to look at the Sniffe Logs and main.c for more information on this.

    3) Do not set ERASE_PERSISTENT_CONFIG to ZB_TRUE, set it to ZB_FALSE

    Best regards,

    Andreas

  • Hi Andreas,

    I am only working on an end device and do not have a coordinator or router set up on another dev kit. I did have another end device running a slightly older firmware based on SDK 3.0 that worked fine, connected to the same SmartThings hub I am using but had to replace the firmware so I could get a packet capture. The previous firmware did not have report configuration done device side (though I did try at one point and was seeing similar results).

    In order to provide the information you have asked for I changed ERASE_PERSISTENT_CONFIG to ZB_TRUE in order to capture the network key. Prior to this the device had ERASE_PERSISTENT_CONFIG set to ZB_FALSE. I made no other changes to the code. I have attached both my main.cpp and multi_sensor.h files for you to look over. I'd offer to provide the entire project however I am not using any of the supported IDEs.

    1. This is good to know and I will make this change in the future. I was originally using integers and apparently confused myself with unit conversions.
    2. Sniffer log and pertinent source files attached.
    3. As I mentioned above, ERASE_PERSISTENT_CONFIG was set to ZB_FALSE prior to resetting the end device so that I could get a good capture.

    While performing the capture I noticed a few things that I will note below. There are a few more oddities besides just reporting that I am seeing and cannot explain them. This capture was performed on a device that had just been commissioned on the hub. For your reference, the decryption key is 06647d2cfe5166a84bc692ae0c41c658. The device address is 0xdd26.

    1. Frame 197: ZCL IAS Zone: Zone Enroll Response. I have no idea why this is here. Nowhere in my code do I have endpoint 0x0500. This is seen sporadically throughout the capture (Frames 228, 230, 2900).
    2. Report configuration occurs around frames 204, 236, and 246. The report configuration parameters are those set by SmartThings.
    3. Frame 865 looks to be the first temperature report. I left the device for close to 20 minutes and only began to receive reports when I placed the device near an air vent to speed things along. The device was commissioned at 5:32 and the report came in around 5:57.
    4. To test the device not reporting correctly after a reboot, I reset the device to observe its behavior. Frame 2349 is around the occurrence of the reboot. The device was rebooted at 6:54. The previous temperature report occurred at 6:41 and the next not until 7:22. While reporting still seems random at times, the device did settle into using the long poll interval after a device reboot faster. Perhaps clearing persistent storage had something to do with this.
    5. Frame 2568: After reboot, humidity is reported.
    6. Frames 2824, 3286, and others show a read attribute. I am not entirely sure what triggered this.
    7. Frame 2880: Battery percent remaining is read. For whatever reason the data reads 39.5, actual value is 79 and this is reflected in SmartThings. This is probably not an issue, just something I am not understanding.
    8. Frame 3434: Final temp report that I logged. This was 42 minutes from the previous report.

    Unless I have completely missed the boat, the device should be reporting any value when the maximum interval has been reached. Prior device behavior had attribute reports coming in no later than the maximum interval consistently.

    I am also very confused as to why I am seeing packets containing the ZCL IAS Zone cluster and some other cluster that I have not been able to identify, 0x8021. I do not know which frame might show the latter but I did notice it in both the capture and SmartThings log when the device first joined. Neither of these are defined in my project so their presence is a mystery.

    ZigBeeTemperatureSensor.cpp

    zb_multi_sensor.h

    ZED Capture.pcapng

    Thanks for taking a look.

  • Hi.

    Patrick said:
    a report will only be sent if the reportable attribute is also greater than the reportable change value. Is this correct?

     I will ask our developers about this so that we get a proper answer.

    Patrick said:
    Is there a workaround to the bug you mentioned to store the reporting configuration?

     The only workaround so to speak is to set ERASE_PERSISTENT_CONFIG to ZB_TRUE.

    Best regards,

    Andreas

  • The only workaround so to speak is to set ERASE_PERSISTENT_CONFIG to ZB_TRUE.

    So do not rely on attribute report configuration in at least this version of ZBOSS for both device-side and coordinator side configuration. This configuration must take place every time the device connects.

  • Hi Patrick.

    Sorry for the late reply.

    I have not found any more information about attribute reporting configuration than what is written in ZCL 2.5.11.2.

    I think that should clairfy attribute reportings should be sent.

    Best regards,

    Andreas

  • Looks like this bug 

    Is there a workaround to the bug you mentioned to store the reporting configuration?

    is fixed in SDK v3.2, see this line from the release notes.

    - Fixed a bug that caused the reporting configuration to fall back to default values after the device reboot.

Reply Children
No Data
Related