espressif / esp-zigbee-sdk

Espressif Zigbee SDK
Apache License 2.0
164 stars 28 forks source link

esp_zb_zcl_report_attr_cmd_t not working for humidity or pressure clusters (TZ-603) #233

Closed kylemwagner83 closed 7 months ago

kylemwagner83 commented 9 months ago

Answers checklist.

IDF version.

v5.1.2

esp-zigbee-lib version.

0.9.0

esp-zboss-lib version.

0.7.0

Espressif SoC revision.

ESP32-C6

What is the expected behavior?

Update and report ESP_ZB_ZCL_ATTR_REL_HUMIDITY_MEASUREMENT_VALUE_ID and ESP_ZB_ZCL_ATTR_PRESSURE_MEASUREMENT_VALUE_ID

What is the actual behavior?

Reporting works fine for temperature, but not for humidity or pressure. Nothing happens when esp_zb_zcl_report_attr_cmd_t is called for humidity/pressure, no errors are thrown, and the values are not reported.

Steps to reproduce.

Here is the esp_zb_task function, defining the clusters, attributes/default values, cluster/endpoint lists:

static void esp_zb_task(void *params)
{
    // Define cluster attributes
    char manufname[] = {9, 'E', 's', 'p', 'r', 'e', 's', 's', 'i', 'f'};
    char modelid[] = {14, 'E', 'S', 'P', '3', '2', 'C', '6', '.', 'S', 'e', 'n', 's', 'o', 'r'};

    int tempValue = 2300;
    int tempMin = 0;
    int tempMax = 32000;

    int humidityValue = 4000;
    int humidityMin = 0;
    int humidityMax = 9999;
    int humidityTolerance = 1;

    int pressureValue = 100;
    int pressureMin = 0;
    int pressureMax = 32000;

    // Initialize Zigbee stack
    esp_zb_cfg_t zb_nwk_cfg = ESP_ZB_ZED_CONFIG();
    esp_zb_init(&zb_nwk_cfg);

    // Create genBasic cluster/attribute list
    esp_zb_attribute_list_t *esp_zb_basic_cluster = esp_zb_zcl_attr_list_create(ESP_ZB_ZCL_CLUSTER_ID_BASIC);
    esp_zb_basic_cluster_add_attr(esp_zb_basic_cluster, ESP_ZB_ZCL_ATTR_BASIC_MANUFACTURER_NAME_ID, &manufname[0]);
    esp_zb_basic_cluster_add_attr(esp_zb_basic_cluster, ESP_ZB_ZCL_ATTR_BASIC_MODEL_IDENTIFIER_ID, &modelid[0]);

    // Create temperature cluster/attribute list
    esp_zb_attribute_list_t *esp_zb_temperature_cluster = esp_zb_zcl_attr_list_create(ESP_ZB_ZCL_CLUSTER_ID_TEMP_MEASUREMENT);
    esp_zb_temperature_meas_cluster_add_attr(esp_zb_temperature_cluster, ESP_ZB_ZCL_ATTR_TEMP_MEASUREMENT_VALUE_ID, &tempValue);
    esp_zb_temperature_meas_cluster_add_attr(esp_zb_temperature_cluster, ESP_ZB_ZCL_ATTR_TEMP_MEASUREMENT_MIN_VALUE_ID, &tempMin);
    esp_zb_temperature_meas_cluster_add_attr(esp_zb_temperature_cluster, ESP_ZB_ZCL_ATTR_TEMP_MEASUREMENT_MAX_VALUE_ID, &tempMax);

    // Create humidity cluster/attribute list
    esp_zb_attribute_list_t *esp_zb_humidity_cluster = esp_zb_zcl_attr_list_create(ESP_ZB_ZCL_CLUSTER_ID_REL_HUMIDITY_MEASUREMENT);
    esp_zb_humidity_meas_cluster_add_attr(esp_zb_humidity_cluster, ESP_ZB_ZCL_ATTR_REL_HUMIDITY_MEASUREMENT_VALUE_ID, &humidityValue);
    esp_zb_humidity_meas_cluster_add_attr(esp_zb_humidity_cluster, ESP_ZB_ZCL_ATTR_REL_HUMIDITY_MEASUREMENT_MIN_VALUE_ID, &humidityMin);
    esp_zb_humidity_meas_cluster_add_attr(esp_zb_humidity_cluster, ESP_ZB_ZCL_ATTR_REL_HUMIDITY_MEASUREMENT_MAX_VALUE_ID, &humidityMax);
    esp_zb_humidity_meas_cluster_add_attr(esp_zb_humidity_cluster, ESP_ZB_ZCL_ATTR_REL_HUMIDITY_TOLERANCE_ID, &humidityTolerance);

    // Create pressure cluster/attribute list
    esp_zb_attribute_list_t *esp_zb_pressure_cluster = esp_zb_zcl_attr_list_create(ESP_ZB_ZCL_CLUSTER_ID_PRESSURE_MEASUREMENT);
    esp_zb_pressure_meas_cluster_add_attr(esp_zb_pressure_cluster, ESP_ZB_ZCL_ATTR_PRESSURE_MEASUREMENT_VALUE_ID, &pressureValue);
    esp_zb_pressure_meas_cluster_add_attr(esp_zb_pressure_cluster, ESP_ZB_ZCL_ATTR_PRESSURE_MEASUREMENT_MIN_VALUE_ID, &pressureMin);
    esp_zb_pressure_meas_cluster_add_attr(esp_zb_pressure_cluster, ESP_ZB_ZCL_ATTR_PRESSURE_MEASUREMENT_MAX_VALUE_ID, &pressureMax);

    // Create cluster list
    esp_zb_cluster_list_t *esp_zb_cluster_list = esp_zb_zcl_cluster_list_create();
    esp_zb_cluster_list_add_basic_cluster(esp_zb_cluster_list, esp_zb_basic_cluster, ESP_ZB_ZCL_CLUSTER_SERVER_ROLE);
    esp_zb_cluster_list_add_temperature_meas_cluster(esp_zb_cluster_list, esp_zb_temperature_cluster, ESP_ZB_ZCL_CLUSTER_SERVER_ROLE);
    esp_zb_cluster_list_add_humidity_meas_cluster(esp_zb_cluster_list, esp_zb_humidity_cluster, ESP_ZB_ZCL_CLUSTER_SERVER_ROLE);
    esp_zb_cluster_list_add_pressure_meas_cluster(esp_zb_cluster_list, esp_zb_pressure_cluster, ESP_ZB_ZCL_CLUSTER_SERVER_ROLE);

    // Create endpoint list
    esp_zb_ep_list_t *esp_zb_ep_list = esp_zb_ep_list_create();
    // esp_zb_ep_list_add_ep(esp_zb_ep_list, esp_zb_cluster_list, HA_ESP_SENSOR_ENDPOINT, ESP_ZB_AF_HA_PROFILE_ID, ESP_ZB_HA_TEMPERATURE_SENSOR_DEVICE_ID);
    esp_zb_ep_list_add_ep(esp_zb_ep_list, esp_zb_cluster_list, HA_ESP_SENSOR_ENDPOINT, ESP_ZB_AF_HA_PROFILE_ID, ESP_ZB_HA_CUSTOM_ATTR_DEVICE_ID);

    // Register endpoint list
    esp_zb_device_register(esp_zb_ep_list);

    // Error check, and start zigbee main loop
    ESP_ERROR_CHECK(esp_zb_start(false));
    esp_zb_main_loop_iteration();
}

Here are the functions to update and report the 3 attributes:

esp_err_t zb_update_temperature(int32_t temperature)
{
    /* Update temperature attribute */
    esp_zb_zcl_status_t state = esp_zb_zcl_set_attribute_val(
        HA_ESP_SENSOR_ENDPOINT,
        ESP_ZB_ZCL_CLUSTER_ID_TEMP_MEASUREMENT,
        ESP_ZB_ZCL_CLUSTER_SERVER_ROLE,
        ESP_ZB_ZCL_ATTR_TEMP_MEASUREMENT_VALUE_ID,
        &temperature,
        false
    );

    /* Error check */
    if(state != ESP_ZB_ZCL_STATUS_SUCCESS)
    {
        ESP_LOGE(TAG, "Updating temperature attribute failed!");
        return ESP_FAIL;
    }

    /* Report temperature attribute */
    static esp_zb_zcl_report_attr_cmd_t temperature_cmd_req = {
        .zcl_basic_cmd.src_endpoint = 1,
        .address_mode = ESP_ZB_APS_ADDR_MODE_DST_ADDR_ENDP_NOT_PRESENT,
        .clusterID = ESP_ZB_ZCL_CLUSTER_ID_TEMP_MEASUREMENT,
        .cluster_role = ESP_ZB_ZCL_CLUSTER_SERVER_ROLE,
        .attributeID = ESP_ZB_ZCL_ATTR_TEMP_MEASUREMENT_VALUE_ID
    };
    state = esp_zb_zcl_report_attr_cmd_req(&temperature_cmd_req);

    /* Error check */
    if(state != ESP_ZB_ZCL_STATUS_SUCCESS)
    {
        ESP_LOGE(TAG, "Reporting temperature attribute failed!");
        return ESP_FAIL;
    }

    return ESP_OK;
}

esp_err_t zb_update_humidity(int32_t humidity)
{
    /* Update humidity attribute */
    esp_zb_zcl_status_t state = esp_zb_zcl_set_attribute_val(
        HA_ESP_SENSOR_ENDPOINT,
        ESP_ZB_ZCL_CLUSTER_ID_REL_HUMIDITY_MEASUREMENT,
        ESP_ZB_ZCL_CLUSTER_SERVER_ROLE,
        ESP_ZB_ZCL_ATTR_REL_HUMIDITY_MEASUREMENT_VALUE_ID,
        &humidity,
        false
    );

    /* Error check */
    if(state != ESP_ZB_ZCL_STATUS_SUCCESS)
    {
        ESP_LOGE(TAG, "Updating humidity attribute failed!");
        return ESP_FAIL;
    }

    /* Report humidity attribute */
    static esp_zb_zcl_report_attr_cmd_t humidity_cmd_req = {
        .zcl_basic_cmd.src_endpoint = 1,
        .address_mode = ESP_ZB_APS_ADDR_MODE_DST_ADDR_ENDP_NOT_PRESENT,
        .clusterID = ESP_ZB_ZCL_CLUSTER_ID_REL_HUMIDITY_MEASUREMENT,
        .cluster_role = ESP_ZB_ZCL_CLUSTER_SERVER_ROLE,
        .attributeID = ESP_ZB_ZCL_ATTR_REL_HUMIDITY_MEASUREMENT_VALUE_ID
    };
    state = esp_zb_zcl_report_attr_cmd_req(&humidity_cmd_req);

    /* Error check */
    if(state != ESP_ZB_ZCL_STATUS_SUCCESS)
    {
        ESP_LOGE(TAG, "Reporting humidity attribute failed!");
        return ESP_FAIL;
    }

    return ESP_OK;
}

esp_err_t zb_update_pressure(int32_t pressure)
{
    /* Update pressure attribute */
    esp_zb_zcl_status_t state = esp_zb_zcl_set_attribute_val(
        HA_ESP_SENSOR_ENDPOINT,
        ESP_ZB_ZCL_CLUSTER_ID_PRESSURE_MEASUREMENT,
        ESP_ZB_ZCL_CLUSTER_SERVER_ROLE,
        ESP_ZB_ZCL_ATTR_PRESSURE_MEASUREMENT_VALUE_ID,
        &pressure,
        false
    );

    /* Error check */
    if(state != ESP_ZB_ZCL_STATUS_SUCCESS)
    {
        ESP_LOGE(TAG, "Updating pressure attribute failed!");
        return ESP_FAIL;
    }

    /* Report pressure attribute */
    static esp_zb_zcl_report_attr_cmd_t pressure_cmd_req = {
        .zcl_basic_cmd.src_endpoint = 1,
        .address_mode = ESP_ZB_APS_ADDR_MODE_DST_ADDR_ENDP_NOT_PRESENT,
        .clusterID = ESP_ZB_ZCL_CLUSTER_ID_PRESSURE_MEASUREMENT,
        .cluster_role = ESP_ZB_ZCL_CLUSTER_SERVER_ROLE,
        .attributeID = ESP_ZB_ZCL_ATTR_PRESSURE_MEASUREMENT_VALUE_ID
    };
    state = esp_zb_zcl_report_attr_cmd_req(&pressure_cmd_req);

    /* Error check */
    if(state != ESP_ZB_ZCL_STATUS_SUCCESS)
    {
        ESP_LOGE(TAG, "Reporting pressure attribute failed!");
        return ESP_FAIL;
    }

    return ESP_OK;
}

More Information.

The zb_update_temperature function works as expected, the ESP_ZB_ZCL_ATTR_TEMP_MEASUREMENT_VALUE_ID is updated, and the new value is properly reported to the coordinator.

The zb_update_humidity and zb_update_pressure don't work, it appears the attributes are updated in their respective clusters (I can see the updated values if I manually read the cluster), but are not automatically reported.

xieqinan commented 9 months ago

@kylemwagner83,

I believe that the temperature, humidity, and pressure attributes are similar. The issue may arise from different configurations for attribute reporting. Could you please show me how to configure report to the Zigbee device in the coordinator side? A Wireshark packet or code will be fine.

kylemwagner83 commented 9 months ago

For the coordinator, I'm using a Sonoff USB Dongle: Sonoff ZigBee 3.0 USB Dongle Plus

I'm reading the Zigbee cluster values in Zigbee2MQTT using a custom converter:

Zigbee2MQTT Converter

The converter code is very straightforward:

const fz = require('zigbee-herdsman-converters/converters/fromZigbee');
const tz = require('zigbee-herdsman-converters/converters/toZigbee');
const exposes = require('zigbee-herdsman-converters/lib/exposes');
const reporting = require('zigbee-herdsman-converters/lib/reporting');
const extend = require('zigbee-herdsman-converters/lib/extend');
const e = exposes.presets;
const ea = exposes.access;

const definition = {
    zigbeeModel: ['ESP32C6.Sensor'],
    model: 'ESP32C6', 
    vendor: 'Espressif', 
    description: 'ESP32C6 Sensor', 
    fromZigbee: [fz.humidity, fz.temperature, fz.pressure],
    toZigbee: [], // Should be empty, unless device can be controlled (e.g. lights, switches).
    exposes: [e.battery(), e.temperature(), e.humidity(), e.pressure()], // Defines what this device exposes, used for e.g. Home Assistant discovery and in the frontend
};

module.exports = definition;

Once the ESP32C6 joins my Zigbee network, In Zigbee2MQTT I can see the clusters I've defined:

Screenshot 2024-02-02 064058

But in the logs, when the esp_zb_zcl_report_attr_cmd_req functions are called, I see the temperature but not humidity or pressure, they both show as NULL:

Screenshot 2024-02-02 064144

Same in the state.json:

Screenshot 2024-02-02 064204

However, when the device first joins I can see the default value I've set by manually reading the attribute:

Screenshot 2024-02-02 064255

And after the esp_zb_zcl_set_attribute_val functions are called, I can also manually read the updated value:

Screenshot 2024-02-02 064313

So it looks like the attributes are getting set properly, but are not reporting properly.

xieqinan commented 9 months ago

@kylemwagner83,

Thank you for the detailed information. I believe that Zigbee2MQTT has already configured the attribute reporting. However, I am not sure whether the report information on the ESP32H2 side is correct. Could you please utilize the esp_zb_zcl_find_reporting_info() function to locate the attribute report information? This function can help us determine whether the humidity and pressure clusters can correctly send the attribute reports.

kylemwagner83 commented 9 months ago

Thank you for the advice, esp_zb_zcl_find_reporting_info() was not available in esp-zigbee-lib 0.9.0, so in idf_component.yml I updated both esp-zigbee-lib and esp-zboss-lib to 1.1.1 This seems to have fixed the humidity and pressure reporting, so now all 3 attributes (temp, humidity, pressure) are updating in MQTT - if I set reporting intervals in Zigbee2MQTT.

I believe I'm still missing some reporting configuration to set report intervals in ESP-IDF code rather than in Zigbee2MQTT. I'm guessing this uses something like esp_zb_zcl_update_reporting_info(). Is this correct and are there any code examples for setting report intervals?

kylemwagner83 commented 9 months ago

Seems like there is still an issue with reporting, without manually setting report intervals in Zigbee2MQTT nothing is reported, esp_zb_zcl_report_attr_cmd_req() doesn't send anything when called. I'm not sure what information would be most useful from the esp_zb_zcl_find_reporting_info() command, I just printed what I can to console:

    esp_zb_zcl_attr_location_info_t humidity_attr_info = {
        HA_ESP_SENSOR_ENDPOINT,
        ESP_ZB_ZCL_CLUSTER_ID_REL_HUMIDITY_MEASUREMENT,
        ESP_ZB_ZCL_CLUSTER_SERVER_ROLE,
        ESP_ZB_ZCL_ATTR_NON_MANUFACTURER_SPECIFIC, //
        ESP_ZB_ZCL_ATTR_REL_HUMIDITY_MEASUREMENT_VALUE_ID,
    };

    esp_zb_zcl_reporting_info_t humidity_reporting_state = *esp_zb_zcl_find_reporting_info(humidity_attr_info);

    printf("Humidity report - direction: %i\n", humidity_reporting_state.direction);
    printf("Humidity report - endpoint: %i\n", humidity_reporting_state.ep);
    printf("Humidity report - cluster id: %i\n", humidity_reporting_state.cluster_id);
    printf("Humidity report - cluster role: %i\n", humidity_reporting_state.cluster_role);
    printf("Humidity report - attribute id: %i\n", humidity_reporting_state.attr_id);
    printf("Humidity report - flags: %i\n", humidity_reporting_state.flags);
    printf("Humidity report - run time: %lu\n", (unsigned long)humidity_reporting_state.run_time);
    printf("Humidity report - actual min interval: %i\n", humidity_reporting_state.u.send_info.min_interval);
    printf("Humidity report - actual max interval: %i\n", humidity_reporting_state.u.send_info.max_interval);
    printf("Humidity report - default min interval: %i\n", humidity_reporting_state.u.send_info.def_min_interval);
    printf("Humidity report - default max interval: %i\n", humidity_reporting_state.u.send_info.def_max_interval);
    printf("Humidity report - timeout: %i\n", humidity_reporting_state.u.recv_info.timeout);
    printf("Humidity report - dst short address: %i\n", humidity_reporting_state.dst.short_addr);
    printf("Humidity report - dst endpoint: %i\n", humidity_reporting_state.dst.endpoint);
    printf("Humidity report - dst profile id: %i\n", humidity_reporting_state.dst.profile_id);
    printf("Humidity report - manufacturer code: %i\n", humidity_reporting_state.manuf_code);

Here is the output:

Humidity report - direction: 0
Humidity report - endpoint: 1
Humidity report - cluster id: 1029
Humidity report - cluster role: 1
Humidity report - attribute id: 0
Humidity report - flags: 33
Humidity report - run time: 425
Humidity report - actual min interval: 5
Humidity report - actual max interval: 0
Humidity report - default min interval: 5
Humidity report - default max interval: 0
Humidity report - timeout: 5
Humidity report - dst short address: 0
Humidity report - dst endpoint: 0
Humidity report - dst profile id: 260
Humidity report - manufacturer code: 65535

When I try to configure the report using esp_zb_zcl_config_report_cmd_req(), it crashes (specifically when setting anything in the record_field), here is the code and output:

    esp_zb_zcl_config_report_record_t report_record;
    report_record.attributeID = ESP_ZB_ZCL_ATTR_REL_HUMIDITY_MEASUREMENT_VALUE_ID;
    report_record.attrType = ESP_ZB_ZCL_ATTR_TYPE_U32;
    report_record.min_interval = 1;
    report_record.max_interval = 4;
    report_record.reportable_change = 0;

    esp_zb_zcl_config_report_cmd_t report_cmd;
    report_cmd.zcl_basic_cmd.dst_addr_u.addr_short=esp_zb_get_short_address();
    report_cmd.zcl_basic_cmd.dst_endpoint = 1;
    report_cmd.zcl_basic_cmd.src_endpoint = 1;
    report_cmd.address_mode = ESP_ZB_APS_ADDR_MODE_16_ENDP_PRESENT;
    report_cmd.clusterID = ESP_ZB_ZCL_CLUSTER_ID_REL_HUMIDITY_MEASUREMENT;
    report_cmd.record_field = &report_record;

    esp_zb_zcl_config_report_cmd_req(&report_cmd);
I (1489) phy_init: phy_version 230,c773401,Oct 30 2023,15:07:16
I (1519) phy: libbtbb version: 7243671, Oct 30 2023, 15:07:30
I (1549) ESP32C6_BME280: ZDO signal: ZDO Config Ready (0x17), status: ESP_FAIL
I (1549) ESP32C6_BME280: Zigbee stack initialized
I (4039) ESP32C6_BME280: Start network steering
I (4049) ESP32C6_BME280: Joined network successfully (Extended PAN ID: a6:c0:b0:17:73:67:44:94, PAN ID: 0x45fa, Channel:11)
Guru Meditation Error: Core  0 panic'ed (Load access fault). Exception was unhandled.

Core  0 register dump:
MEPC    : 0x4203104a  RA      : 0x42010e64  SP      : 0x4081d040  GP      : 0x40810004
0x4203104a: zb_zcl_put_value_to_packet at ??:?
0x42010e64: esp_zb_zcl_config_report_cmd_req at ??:?

TP      : 0x4080ca9c  T0      : 0x40030dca  T1      : 0x000000ff  T2      : 0xffffffff
0x4080ca9c: mmu_hal_pages_to_bytes at C:/Users/kylem/esp/esp-idf/components/hal/mmu_hal.c:43
0x40030dca: memset in ROM

S0/FP   : 0x40813717  S1      : 0x40813717  A0      : 0x40813717  A1      : 0x00000000
A2      : 0x00000000  A3      : 0x00000023  A4      : 0x00000023  A5      : 0x00000023
A6      : 0x00000018  A7      : 0x00000001  S2      : 0x00000000  S3      : 0x00000019
S4      : 0x00000000  S5      : 0x00000000  S6      : 0x00000000  S7      : 0x00000000
S8      : 0x00000000  S9      : 0x00000000  S10     : 0x00000000  S11     : 0x00000000
T3      : 0x00000000  T4      : 0x00024201  T5      : 0xffffffff  T6      : 0xffffffff
MSTATUS : 0x00001881  MTVEC   : 0x40800001  MCAUSE  : 0x00000005  MTVAL   : 0x00000000
0x40800001: _vector_table at ??:?

MHARTID : 0x00000000

Stack memory:
4081d040: 0x4080fb58 0x4087f0f0 0x4081d0f8 0x00000019 0x00000000 0x40813717 0x4081d0f8 0x42010e64
0x42010e64: esp_zb_zcl_config_report_cmd_req at ??:?

4081d060: 0x4080fb58 0x4087f0f0 0x00000001 0x42010ce6 0x00000000 0x00000000 0x00000000 0x00000000
0x42010ce6: esp_zb_zcl_report_attr_cmd_req at ??:?

4081d080: 0x00000000 0x00000001 0x00000000 0x42008a12 0x4080c30a 0x4080c302 0x4081d110 0x40810004
0x42008a12: zb_update_humidity at D:/Coding/esp32c6-bme280-zigbee/main/zigbee/zb_update_attr.c:103
0x4080c30a: vPortYield at C:/Users/kylem/esp/esp-idf/components/freertos/FreeRTOS-Kernel/portable/riscv/port.c:404 (discriminator 3)
0x4080c302: vPortYield at C:/Users/kylem/esp/esp-idf/components/freertos/FreeRTOS-Kernel/portable/riscv/port.c:404 (discriminator 3)

4081d0a0: 0x4080ca9c 0x40030dca 0x000000ff 0x00000d31 0x0000012c 0x00000000 0x00000001 0x00000001
0x4080ca9c: mmu_hal_pages_to_bytes at C:/Users/kylem/esp/esp-idf/components/hal/mmu_hal.c:43
0x40030dca: memset in ROM

4081d0c0: 0x0000019e 0x00000004 0x00000001 0x00000001 0x420596b8 0x4087f05c 0x00000000 0x00000000
0x420596b8: event_write at C:/Users/kylem/esp/esp-idf/components/vfs/vfs_eventfd.c:243

4081d0e0: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x0000bbb9 0x00000000
4081d100: 0x00000101 0x00000002 0xffff0405 0x4081d110 0x00000000 0x00230000 0x00040001 0x00000000
4081d120: 0x4206c2cc 0x00000000 0x50001000 0x42008d2a 0x4206c298 0x00000000 0x50001000 0x420096c6
0x50001000: esp_wake_stub_entry at C:/Users/kylem/esp/esp-idf/components/esp_hw_support/sleep_modes.c:286
0x42008d2a: update_attributes at D:/Coding/esp32c6-bme280-zigbee/main/main.c:50 (discriminator 2)
0x50001000: esp_wake_stub_entry at C:/Users/kylem/esp/esp-idf/components/esp_hw_support/sleep_modes.c:286
0x420096c6: esp_zb_zcl_attr_list_create at ??:?

4081d140: 0x4206ad10 0x0000018f 0x4206b000 0x42062a0c 0x00000000 0x00001388 0x00000000 0x00000000
0x42062a0c: main_task at C:/Users/kylem/esp/esp-idf/components/freertos/app_startup.c:209 (discriminator 13)

4081d160: 0x00000000 0x00000000 0x00000000 0x4080c152 0x00000000 0x00000000 0x00000000 0x00000000
0x4080c152: vPortTaskWrapper at C:/Users/kylem/esp/esp-idf/components/freertos/FreeRTOS-Kernel/portable/riscv/port.c:205

4081d180: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5
4081d1a0: 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 0x00000154 0x4081d090 0x0000019e 0x40811450 0x40811450
4081d1c0: 0x4081d1b0 0x40811448 0x00000018 0x4087dff4 0x4087dff4 0x4081d1b0 0x00000000 0x00000001
4081d1e0: 0x4081c1ac 0x6e69616d 0x23102100 0xeb38777f 0x0084d1fe 0x00000000 0x4081d1a0 0x00000001
4081d200: 0x00000000 0x00000000 0x00000000 0x00000000 0x4081aa88 0x4081aaf0 0x4081ab58 0x00000000
4081d220: 0x00000000 0x00000001 0x00000000 0x00000000 0x4087e078 0x42060ba6 0x00000000 0x00000000
0x42060ba6: _cleanup_r at /builds/idf/crosstool-NG/.build/HOST-x86_64-w64-mingw32/riscv32-esp-elf/src/newlib/newlib/libc/stdio/findfp.c:229

4081d240: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
4081d260: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
4081d280: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
4081d2a0: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
4081d2c0: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
4081d2e0: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
4081d300: 0x40000000 0x00000600 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5
0x40000000: _start in ROM

4081d320: 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5
4081d340: 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5
4081d360: 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5
4081d380: 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5
4081d3a0: 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5
4081d3c0: 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5
4081d3e0: 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5
4081d400: 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5
4081d420: 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5

ELF file SHA256: 9da32ebc678fbdb3

Rebooting...
ESP-ROM:esp32c6-20220919
Build:Sep 19 2022
rst:0xc (SW_CPU),boot:0xc (SPI_FAST_FLASH_BOOT)
Saved PC:0x4001975a
0x4001975a: software_reset_cpu in ROM
xieqinan commented 8 months ago

@kylemwagner83 ,

Please use the esp_zb_zcl_update_reporting_info() function to update the report information, then use the esp_zb_zcl_find_reporting_info() function to verify whether it has been updated.

The attribute type of ESP_ZB_ZCL_ATTR_REL_HUMIDITY_MEASUREMENT_VALUE_ID should be ESP_ZB_ZCL_ATTR_TYPE_U16. Could you update it and try again?

kylemwagner83 commented 7 months ago

I ended up restructuring my program using the HA_Temperature_Sensor/HA_Thermostat examples and the reporting seems to be working now. At least part of the problem seems to have been calling esp_zb_zcl_update_reporting_info() after the main loop iteration. Handling the reporting configuration as part of the cluster/attribute setup in esp_zb_task prior to starting the main loop works. Thanks!