espressif / esp-zigbee-sdk

Espressif Zigbee SDK
Apache License 2.0
173 stars 29 forks source link

unable to write a "large" string (TZ-546) #202

Closed diazmanuel closed 7 months ago

diazmanuel commented 10 months ago

Answers checklist.

IDF version.

v5.1.1-588-gc1c843f5e2

esp-zigbee-lib version.

1.0.7

esp-zboss-lib version.

1.0.7

Espressif SoC revision.

ESP32-H6 and ESP32-H2

What is the expected behavior?

I'm trying to write a string attribute with a length of like 150-200 characters. The behavior I expect is that it always arrives and the content is correct

What is the actual behavior?

The current behavior is that sometimes the write callback on the destination device is not activated or when it is activated the content is truncated or damaged

Steps to reproduce.

just send a string with a 150-200 characters

More Information.

I think it may be due to an internal buffer in the sender or in the receiver, is there any limitation on the number of characters? reading the zigbee 3.0 documentation I did not find a limit on the maximum length

xieqinan commented 10 months ago

@diazmanuel ,

The upcoming version will support the frame fragment feature, which should meet the above requirements. It is scheduled for release later this week.

diazmanuel commented 10 months ago

Hello, @xieqinan, I have seen the last update they made adding what you mentioned, but I don't understand how to use it to solve the problem I have of not being able to send a long string, could you tell me how to solve the problem?

xieqinan commented 10 months ago

@diazmanuel ,

The simple implementation is as followed:

void *esp_zb_zcl_custom_array_copy_malloc(esp_zb_zcl_attr_type_t type, void *array, uint32_t elem_size, uint16_t elem_count)
{
    uint8_t *value = NULL;
    uint8_t offset = 0;
    switch (type) {
    case ESP_ZB_ZCL_ATTR_TYPE_LONG_OCTET_STRING:
    case ESP_ZB_ZCL_ATTR_TYPE_LONG_CHAR_STRING:
    case ESP_ZB_ZCL_ATTR_TYPE_ARRAY:
    case ESP_ZB_ZCL_ATTR_TYPE_16BIT_ARRAY:
    case ESP_ZB_ZCL_ATTR_TYPE_32BIT_ARRAY:
        value = malloc(sizeof(uint16_t) + elem_size * elem_count);
        memcpy(value + offset, &elem_count, sizeof(uint16_t));
        offset += sizeof(uint16_t);
        break;
    case ESP_ZB_ZCL_ATTR_TYPE_OCTET_STRING:
    case ESP_ZB_ZCL_ATTR_TYPE_CHAR_STRING:
        value = malloc(sizeof(uint8_t) + elem_size * elem_count);
        memcpy(value + offset, &elem_count, sizeof(uint8_t));
        offset += sizeof(uint8_t);
        break;
    default:
        ESP_LOGW(TAG, "The data type(0x%x) is not array or string, failed to create it", type);
        value = NULL;
        break;
    }
    memcpy(value + offset, array, elem_count * elem_size);
    return value;
};

void esp_zb_zcl_custom_array_free(uint8_t *array)
{
    if (array) {
        free(array);
    }
}

static void esp_zb_buttons_handler(switch_func_pair_t *button_func_pair)
{
    if (button_func_pair->func == SWITCH_ONOFF_TOGGLE_CONTROL) {
        esp_zb_zcl_custom_cluster_cmd_req_t custom_req;

        uint8_t message[1024] = {};

        for (int i = 0; i < sizeof(message) / sizeof(uint8_t); i++) message[i] = i & 0xFF;

        uint8_t *value =
            esp_zb_zcl_custom_array_copy_malloc(ESP_ZB_ZCL_ATTR_TYPE_ARRAY, message, sizeof(message[0]), sizeof(message) / sizeof(uint8_t));
        custom_req.zcl_basic_cmd.dst_endpoint = light_node.endpoint;
        custom_req.zcl_basic_cmd.dst_addr_u.addr_short = light_node.short_addr;
        custom_req.zcl_basic_cmd.src_endpoint = HA_ONOFF_SWITCH_ENDPOINT;
        custom_req.address_mode = ESP_ZB_APS_ADDR_MODE_16_ENDP_PRESENT; // ESP_ZB_APS_ADDR_MODE_DST_ADDR_ENDP_NOT_PRESENT;
        custom_req.cluster_id = CUSTOM_CLUSTER_ID;
        custom_req.custom_cmd_id = 0x01;
        custom_req.profile_id = ESP_ZB_AF_HA_PROFILE_ID;
        custom_req.direction = ESP_ZB_ZCL_CMD_DIRECTION_TO_SRV;
        custom_req.data.type = ESP_ZB_ZCL_ATTR_TYPE_ARRAY;
        custom_req.data.value = value;
        ESP_EARLY_LOGI(TAG, " Transfer(%d) * * * * * * * * * * * * * * * * * *", sizeof(message));
        esp_zb_zcl_custom_cluster_cmd_req(&custom_req);
        esp_zb_zcl_custom_array_free(value);
    }
}
diazmanuel commented 10 months ago

hi @xieqinan ,Thanks for the reply, could you share the code on how to read it? Also, it is not possible to use the read and write command request functions with a long string?

xieqinan commented 9 months ago

@diazmanuel ,

The writing and reading are the same with the custom cluster request, only if the data type of attribute is supported.

diazmanuel commented 9 months ago

but why can't I declare an attribute of type string in a custom cluster and write and read it with the esp_zb_zcl_write_attr_cmd_req() and esp_zb_zcl_read_attr_cmd_req() functions? The length of the string according to the Zigbee 3.0 standard is supposed to be at least 255 characters, but in practice when I try to write or read something longer than 40 characters it starts to have errors.

I leave you a screenshot of the zigbee documentation

image

Is it possible to solve this problem so that the complete string can be used as indicated in the documentation?

xieqinan commented 8 months ago

@diazmanuel ,

Large data for custom clusters, both reading and writing, is now supported in esp-zigbee-sdk v1.2.1. You can test this functionality using the esp_zb_zcl_read_attr_cmd_req() and esp_zb_zcl_write_attr_cmd_req() APIs.

diazmanuel commented 8 months ago

@diazmanuel ,

Large data for custom clusters, both reading and writing, is now supported in esp-zigbee-sdk v1.2.1. You can test this functionality using the esp_zb_zcl_read_attr_cmd_req() and esp_zb_zcl_write_attr_cmd_req() APIs.

hello, thanks you, we will test this update after fixing the error with the custom clusters #285

diazmanuel commented 8 months ago

@diazmanuel ,

Large data for custom clusters, both reading and writing, is now supported in esp-zigbee-sdk v1.2.1. You can test this functionality using the esp_zb_zcl_read_attr_cmd_req() and esp_zb_zcl_write_attr_cmd_req() APIs.

Hello, we still haven't been able to get it to work, depending on the message, some arrive well and others don't. We carry out the following test, sending different messages and printing the response. In some cases the messages arrive fine (this is almost always the case with short message) It also happens that the system restarts when long messages arrive, anyway I couldn't find the logic why it fails, I leave the tests below so you can analyze it better. both the endpoint and the gateway are running version 1.2.1 on idf 5.1.2

Message 1: "This message has a length of 105: COMPUTER, MOUSE, DESK, CHAIR, FAN, LIGHT, NOTEBOOK, BOTTLE, PLUG, GLASS" Arrives Message 1: "E (288557) APP: len: 105 data: This message has a length of 105: COMPUTER, MOUSE, DESK, CHAIR, FAN, LIGHT, NOTEBOOK, BOTTLE, PLUG, GLASS " the code crashed?: YES Complete LOG Message 1:

I (607) cpu_start: Unicore app
I (607) cpu_start: Pro cpu up.
W (617) clk: esp_perip_clk_init() has not been implemented yet
I (623) cpu_start: Pro cpu start user code
I (624) cpu_start: cpu freq: 96000000 Hz
I (624) cpu_start: Application information:
I (626) cpu_start: Project name:     firmware_boiler_zigbee_G2
I (633) cpu_start: App version:      57fc143-dirty
I (638) cpu_start: Compile time:     Mar 18 2024 11:31:09
I (644) cpu_start: ELF file SHA256:  6477b87dfdecd40b...
Warning: checksum mismatch between flashed and built applications. Checksum of built application is dd9e1137f1e42cb1b5688d48547ad1725c8138bb5ef0f9814f90f64ff1615239
I (650) cpu_start: ESP-IDF:          v5.1.3-dirty
I (656) cpu_start: Min chip rev:     v0.0
I (660) cpu_start: Max chip rev:     v0.99 
I (665) cpu_start: Chip rev:         v0.1
I (670) heap_init: Initializing. RAM available for dynamic allocation:
I (677) heap_init: At 4081FED0 len 0002D4B0 (181 KiB): D/IRAM
I (684) heap_init: At 4084D380 len 00002B60 (10 KiB): STACK/DIRAM
I (691) spi_flash: detected chip: generic
I (695) spi_flash: flash io: dio
I (703) sleep: Configure to isolate all GPIO pins in sleep state
I (706) sleep: Enable automatic switching of GPIO sleep configuration
I (713) coexist: coex firmware version: 77cd7f8
I (719) app_start: Starting scheduler on CPU0
I (723) main_task: Started on CPU0
I (727) main_task: Calling app_main()
E (741) AZURE: dato 
E (741) AZURE: dato 
E (741) task_wdt: esp_task_wdt_init(593): TWDT already initialized
I (744) gpio: GPIO[14]| InputEn: 0| OutputEn: 1| OpenDrain: 0| Pullup: 0| Pulldown: 0| Intr:0 
I (753) gpio: GPIO[1]| InputEn: 0| OutputEn: 1| OpenDrain: 0| Pullup: 0| Pulldown: 0| Intr:0 
I (762) gpio: GPIO[0]| InputEn: 0| OutputEn: 1| OpenDrain: 0| Pullup: 0| Pulldown: 0| Intr:0 
I (772) taskZigbee: zigbee Handler Task Initialized
I (777) taskZigbee: Zigbee Handler Task Created
I (791) phy: phy_version: 230,2, 9aae6ea, Jan 15 2024, 11:17:12
I (792) phy: libbtbb version: 944f18e, Jan 15 2024, 11:17:25
I (822) taskZigbee:  Zigbee Task Created
W (825) taskZigbee: ZDO signal: 23, status: -1
I (826) taskZigbee: Zigbee signal: SKIP_STARTUP
I (1771) taskZigbee: Start network steering
W (1800) taskZigbee: ZDO signal: 54, status: 0
I (1804) taskZigbee: Zigbee signal: DEVICE_REBOOT
I (1804) taskZigbee: Zigbee stack initialized
I (1892) taskZigbee: ieee_cb address is: 60:55:f9:00:00:f6:f0:78
I (1893) taskZigbee: local address is: 74:4d:bd:ff:fe:60:9b:dd
I (1895) taskZigbee: local short address is: 0xf982
I (1909) taskZigbee: bind_cb status:0
W (1923) taskZigbee: ZDO signal: 50, status: 0
I (2129) BLE_INIT: Using main XTAL as clock source
I (2135) BLE_INIT: ble controller commit:[217f1bf]
I (2138) NimBLE_SPP_BLE_PRPH: BLE Host Task Started
I (2320) taskZigbee: Zigbee signal: DEVICE_REBOOT
I (2321) taskZigbee: Zigbee stack initialized
W (12977) taskZigbee: ZDO signal: 50, status: 0
W (20071) taskZigbee: ZDO signal: 50, status: 0
E (20915) system_api: 0 mac type is incorrect (not found)
W (30205) taskZigbee: ZDO signal: 50, status: 0
W (171199) taskZigbee: ZDO signal: 50, status: 0
W (201633) taskZigbee: ZDO signal: 50, status: 0
W (205701) taskZigbee: ZDO signal: 50, status: 0
W (275712) taskZigbee: ZDO signal: 50, status: 0
E (288557) APP: len: 105 data: This message has a length of 105: COMPUTER, MOUSE, DESK, CHAIR, FAN, LIGHT, NOTEBOOK, BOTTLE, PLUG, GLASS 
Guru Meditation Error: Core  0 panic'ed (Load access fault). Exception was unhandled.

Core  0 register dump:
MEPC    : 0x4080acfa  RA      : 0x4080acfa  SP      : 0x40812600  GP      : 0x40810460  
0x4080acfa: clk_ll_32k_calibration_get_target at /home/aebrecht/esp/v5.1.3/esp-idf/components/hal/esp32c6/include/hal/clk_tree_ll.h:616
 (inlined by) rtc_clk_cal_internal at /home/aebrecht/esp/v5.1.3/esp-idf/components/esp_hw_support/port/esp32c6/rtc_time.c:66
 (inlined by) rtc_clk_cal at /home/aebrecht/esp/v5.1.3/esp-idf/components/esp_hw_support/port/esp32c6/rtc_time.c:223

0x4080acfa: clk_ll_32k_calibration_get_target at /home/aebrecht/esp/v5.1.3/esp-idf/components/hal/esp32c6/include/hal/clk_tree_ll.h:616
 (inlined by) rtc_clk_cal_internal at /home/aebrecht/esp/v5.1.3/esp-idf/components/esp_hw_support/port/esp32c6/rtc_time.c:66
 (inlined by) rtc_clk_cal at /home/aebrecht/esp/v5.1.3/esp-idf/components/esp_hw_support/port/esp32c6/rtc_time.c:223

0x40810460: isr_handle_tx_done at /home/aebrecht/esp/v5.1.3/esp-idf/components/ieee802154/driver/esp_ieee802154_dev.c:397
 (inlined by) ieee802154_isr at /home/aebrecht/esp/v5.1.3/esp-idf/components/ieee802154/driver/esp_ieee802154_dev.c:620

TP      : 0x407fe234  T0      : 0x7fffffff  T1      : 0x2000104c  T2      : 0x00000002  
S0/FP   : 0x4843202c  S1      : 0x00000001  A0      : 0x00000002  A1      : 0x4081262c  
A2      : 0x4081263c  A3      : 0x00000004  A4      : 0x20001090  A5      : 0x00001881  
A6      : 0x00000000  A7      : 0x00000000  S2      : 0x00000001  S3      : 0x4081263c  
S4      : 0x00000000  S5      : 0x4081262c  S6      : 0x00000000  S7      : 0x00000000  
S8      : 0x00000000  S9      : 0x00000000  S10     : 0x00000000  S11     : 0x00000000  
T3      : 0x4081e628  T4      : 0x00000000  T5      : 0x00000001  T6      : 0x00000000  
MSTATUS : 0x00001881  MTVEC   : 0x40800001  MCAUSE  : 0x00000005  MTVAL   : 0x48432064  
0x40800001: _vector_table at ??:?

MHARTID : 0x00000000  

Stack memory:
40812600: 0x00000000 0x00000000 0x00000000 0x4081f000 0x00000001 0x00000001 0x408259b4 0x4080216e
0x4080216e: npl_freertos_event_deinit at /home/aebrecht/esp/v5.1.3/esp-idf/components/bt/porting/npl/freertos/src/npl_os_freertos.c:115 (discriminator 1)

40812620: 0x00000000 0x00000000 0x00000000 0x4081eed4 0x00000001 0x4082d19c 0x4082d14c 0x4080363c
0x4080363c: r_ble_lll_rfmgmt_instant_wakeup_check at ??:?

40812640: 0x03ffffff 0x00000001 0x4081f000 0x40805b40 0x00001881 0x00000000 0x00000000 0x00000001
0x40805b40: r_ble_log_internal_x0 at ??:?

40812660: 0x00001881 0x8000000f 0x4081e000 0x4080505a 0x00001881 0x8000000d 0x4081e000 0x408001ec
0x4080505a: r_ble_hci_uart_tx_char at ??:?

0x408001ec: _interrupt_handler at ??:?

40812680: 0x6000b000 0x4080901e 0x4080902a 0x00000000 0x4081268c 0x00000000 0x00000000 0x00000000
0x4080901e: modem_clock_hal_get_clock_domain_icg_bitmap at /home/aebrecht/esp/v5.1.3/esp-idf/components/hal/esp32c6/modem_clock_hal.c:66

0x4080902a: modem_clock_hal_get_clock_domain_icg_bitmap at /home/aebrecht/esp/v5.1.3/esp-idf/components/hal/esp32c6/modem_clock_hal.c:66

408126a0: 0x408126a4 0xffffffff 0x408126a4 0x408126a4 0x00000000 0x408126b8 0xffffffff 0x408126b8
408126c0: 0x408126b8 0x00000001 0x00000001 0x00000000 0x0001ffff 0x00000000 0xb33fffff 0x00000000
408126e0: 0x00000000 0x408126e0 0x00000000 0x00000000 0x00000000 0x408126f8 0xffffffff 0x408126f8
40812700: 0x408126f8 0x00000000 0x4081270c 0xffffffff 0x4081270c 0x4081270c 0x00000001 0x00000001
40812720: 0x00000000 0x0001ffff 0x00000000 0xb33fffff 0x00000000 0x00000000 0x40820884 0x408208ec
40812740: 0x40820954 0x00000000 0x00000000 0x00000001 0x00000000 0x00000000 0x00000000 0x420eb346
0x420eb346: set_pbus_mem at ??:?

40812760: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x40812780
40812780: 0x00000000 0x00000001 0x420d5b6c 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
0x420d5b6c: std::collate<wchar_t>::do_compare(wchar_t const*, wchar_t const*, wchar_t const*, wchar_t const*) const at /builds/idf/crosstool-NG/.build/riscv32-esp-elf/build/build-cc-gcc-final/riscv32-esp-elf/rv32imac_zicsr_zifencei/ilp32/no-rtti/libstdc++-v3/include/bits/locale_classes.tcc:195

408127a0: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
408127c0: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
408127e0: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
40812800: 0x00000000 0x00000000 0x00000000 0x40820878 0x00000000 0x00000000 0x00000000 0x40820c68
40812820: 0x00000000 0x6000b000 0x4080901e 0x4080902a 0x4082062c 0x408206f0 0x408207b4 0x4084f8d4
0x4080901e: modem_clock_hal_get_clock_domain_icg_bitmap at /home/aebrecht/esp/v5.1.3/esp-idf/components/hal/esp32c6/modem_clock_hal.c:66

0x4080902a: modem_clock_hal_get_clock_domain_icg_bitmap at /home/aebrecht/esp/v5.1.3/esp-idf/components/hal/esp32c6/modem_clock_hal.c:66

40812840: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
40812860: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
40812880: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
408128a0: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
408128c0: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
408128e0: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
40812900: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
40812920: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
40812940: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
40812960: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
40812980: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
408129a0: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x408129c4
408129c0: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x408129e4
408129e0: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000

ELF file SHA256: 6477b87dfdecd40b
Warning: checksum mismatch between flashed and built applications. Checksum of built application is dd9e1137f1e42cb1b5688d48547ad1725c8138bb5ef0f9814f90f64ff1615239

Rebooting...

Message 2: "This message has a length of 135: COMPUTER, MOUSE, DESK, CHAIR, FAN, LIGHT, NOTEBOOK, BOTTLE, PLUG, GLASS, MONITOR, TOOLS, SOURCE, AUTO" Arrives Message 2: "E (440666) APP: len: 135 data: This message has a length of 135: COMPUTER, MOUSE, DESK, CHAIR, FAN, LIGHT, NOTEBOOK, BOTTLE, PLUG, GLASS, MONITOR, TOOLS, SOURCE, AUTO" the code crashed?: YES Complete LOG Message 2:

I (607) cpu_start: Unicore app
I (607) cpu_start: Pro cpu up.
W (617) clk: esp_perip_clk_init() has not been implemented yet
I (623) cpu_start: Pro cpu start user code
I (624) cpu_start: cpu freq: 96000000 Hz
I (624) cpu_start: Application information:
I (626) cpu_start: Project name:     firmware_boiler_zigbee_G2
I (633) cpu_start: App version:      57fc143-dirty
I (638) cpu_start: Compile time:     Mar 18 2024 11:31:09
I (644) cpu_start: ELF file SHA256:  6477b87dfdecd40b...
Warning: checksum mismatch between flashed and built applications. Checksum of built application is dd9e1137f1e42cb1b5688d48547ad1725c8138bb5ef0f9814f90f64ff1615239
I (650) cpu_start: ESP-IDF:          v5.1.3-dirty
I (656) cpu_start: Min chip rev:     v0.0
I (660) cpu_start: Max chip rev:     v0.99 
I (665) cpu_start: Chip rev:         v0.1
I (670) heap_init: Initializing. RAM available for dynamic allocation:
I (677) heap_init: At 4081FED0 len 0002D4B0 (181 KiB): D/IRAM
I (684) heap_init: At 4084D380 len 00002B60 (10 KiB): STACK/DIRAM
I (691) spi_flash: detected chip: generic
I (695) spi_flash: flash io: dio
I (703) sleep: Configure to isolate all GPIO pins in sleep state
I (706) sleep: Enable automatic switching of GPIO sleep configuration
I (713) coexist: coex firmware version: 77cd7f8
I (719) app_start: Starting scheduler on CPU0
I (723) main_task: Started on CPU0
I (727) main_task: Calling app_main()
E (741) AZURE: dato 
E (741) AZURE: dato 
E (741) task_wdt: esp_task_wdt_init(593): TWDT already initialized
I (744) gpio: GPIO[14]| InputEn: 0| OutputEn: 1| OpenDrain: 0| Pullup: 0| Pulldown: 0| Intr:0 
I (753) gpio: GPIO[1]| InputEn: 0| OutputEn: 1| OpenDrain: 0| Pullup: 0| Pulldown: 0| Intr:0 
I (762) gpio: GPIO[0]| InputEn: 0| OutputEn: 1| OpenDrain: 0| Pullup: 0| Pulldown: 0| Intr:0 
I (772) taskZigbee: zigbee Handler Task Initialized
I (777) taskZigbee: Zigbee Handler Task Created
I (791) phy: phy_version: 230,2, 9aae6ea, Jan 15 2024, 11:17:12
I (792) phy: libbtbb version: 944f18e, Jan 15 2024, 11:17:25
I (823) taskZigbee:  Zigbee Task Created
W (826) taskZigbee: ZDO signal: 23, status: -1
I (827) taskZigbee: Zigbee signal: SKIP_STARTUP
I (1771) taskZigbee: Start network steering
W (1875) taskZigbee: ZDO signal: 54, status: 0
I (1878) taskZigbee: Zigbee signal: DEVICE_REBOOT
I (1879) taskZigbee: Zigbee stack initialized
I (1974) taskZigbee: ieee_cb address is: 60:55:f9:00:00:f6:f0:78
I (1974) taskZigbee: local address is: 74:4d:bd:ff:fe:60:9b:dd
I (1976) taskZigbee: local short address is: 0xf982
I (1990) taskZigbee: bind_cb status:0
I (2130) BLE_INIT: Using main XTAL as clock source
I (2138) BLE_INIT: ble controller commit:[217f1bf]
I (2140) NimBLE_SPP_BLE_PRPH: BLE Host Task Started
I (2324) taskZigbee: Zigbee signal: DEVICE_REBOOT
I (2325) taskZigbee: Zigbee stack initialized
W (17006) taskZigbee: ZDO signal: 50, status: 0
E (20932) system_api: 0 mac type is incorrect (not found)
W (29170) taskZigbee: ZDO signal: 50, status: 0
W (42375) taskZigbee: ZDO signal: 50, status: 0
W (57593) taskZigbee: ZDO signal: 50, status: 0
W (74832) taskZigbee: ZDO signal: 50, status: 0
W (89020) taskZigbee: ZDO signal: 50, status: 0
W (396506) taskZigbee: ZDO signal: 50, status: 0
W (411737) taskZigbee: ZDO signal: 50, status: 0
E (440666) APP: len: 135 data: This message has a length of 135: COMPUTER, MOUSE, DESK, CHAIR, FAN, LIGHT, NOTEBOOK, BOTTLE, PLUG, GLASS, MONITOR, TOOLS, SOURCE, AUTO 
Guru Meditation Error: Core  0 panic'ed (Load access fault). Exception was unhandled.

Core  0 register dump:
MEPC    : 0x4080acfa  RA      : 0x4080acfa  SP      : 0x40812600  GP      : 0x40810460  
0x4080acfa: clk_ll_32k_calibration_get_target at /home/aebrecht/esp/v5.1.3/esp-idf/components/hal/esp32c6/include/hal/clk_tree_ll.h:616
 (inlined by) rtc_clk_cal_internal at /home/aebrecht/esp/v5.1.3/esp-idf/components/esp_hw_support/port/esp32c6/rtc_time.c:66
 (inlined by) rtc_clk_cal at /home/aebrecht/esp/v5.1.3/esp-idf/components/esp_hw_support/port/esp32c6/rtc_time.c:223

0x4080acfa: clk_ll_32k_calibration_get_target at /home/aebrecht/esp/v5.1.3/esp-idf/components/hal/esp32c6/include/hal/clk_tree_ll.h:616
 (inlined by) rtc_clk_cal_internal at /home/aebrecht/esp/v5.1.3/esp-idf/components/esp_hw_support/port/esp32c6/rtc_time.c:66
 (inlined by) rtc_clk_cal at /home/aebrecht/esp/v5.1.3/esp-idf/components/esp_hw_support/port/esp32c6/rtc_time.c:223

0x40810460: isr_handle_tx_done at /home/aebrecht/esp/v5.1.3/esp-idf/components/ieee802154/driver/esp_ieee802154_dev.c:397
 (inlined by) ieee802154_isr at /home/aebrecht/esp/v5.1.3/esp-idf/components/ieee802154/driver/esp_ieee802154_dev.c:620

TP      : 0x407fe234  T0      : 0x7fffffff  T1      : 0x2000104c  T2      : 0x00000002  
S0/FP   : 0x4843202c  S1      : 0x00000001  A0      : 0x00000002  A1      : 0x4081262c  
A2      : 0x4081263c  A3      : 0x00000004  A4      : 0x20001090  A5      : 0x00001881  
A6      : 0x00000000  A7      : 0x00000000  S2      : 0x00000001  S3      : 0x4081263c  
S4      : 0x00000000  S5      : 0x4081262c  S6      : 0x00000000  S7      : 0x00000000  
S8      : 0x00000000  S9      : 0x00000000  S10     : 0x00000000  S11     : 0x00000000  
T3      : 0x4081e628  T4      : 0x00000000  T5      : 0x00000001  T6      : 0x00000000  
MSTATUS : 0x00001881  MTVEC   : 0x40800001  MCAUSE  : 0x00000005  MTVAL   : 0x48432064  
0x40800001: _vector_table at ??:?

MHARTID : 0x00000000  

Stack memory:
40812600: 0x00000000 0x00000000 0x00000000 0x4081f000 0x00000001 0x00000001 0x408259b4 0x4080216e
0x4080216e: npl_freertos_event_deinit at /home/aebrecht/esp/v5.1.3/esp-idf/components/bt/porting/npl/freertos/src/npl_os_freertos.c:115 (discriminator 1)

40812620: 0x00000000 0x00000000 0x00000000 0x4081eed4 0x00000001 0x4082d1a4 0x4082d154 0x4080363c
0x4080363c: r_ble_lll_rfmgmt_instant_wakeup_check at ??:?

40812640: 0x03ffffff 0x00000001 0x4081f000 0x40805b40 0x00001881 0x00000000 0x00000000 0x00000001
0x40805b40: r_ble_log_internal_x0 at ??:?

40812660: 0x00001881 0x8000000f 0x4081e000 0x4080505a 0x00001881 0x8000000d 0x4081e000 0x408001ec
0x4080505a: r_ble_hci_uart_tx_char at ??:?

0x408001ec: _interrupt_handler at ??:?

40812680: 0x6000b000 0x4080901e 0x4080902a 0x00000000 0x4081268c 0x00000000 0x00000000 0x00000000
0x4080901e: modem_clock_hal_get_clock_domain_icg_bitmap at /home/aebrecht/esp/v5.1.3/esp-idf/components/hal/esp32c6/modem_clock_hal.c:66

0x4080902a: modem_clock_hal_get_clock_domain_icg_bitmap at /home/aebrecht/esp/v5.1.3/esp-idf/components/hal/esp32c6/modem_clock_hal.c:66

408126a0: 0x408126a4 0xffffffff 0x408126a4 0x408126a4 0x00000000 0x408126b8 0xffffffff 0x408126b8
408126c0: 0x408126b8 0x00000001 0x00000001 0x00000000 0x0001ffff 0x00000000 0xb33fffff 0x00000000
408126e0: 0x00000000 0x408126e0 0x00000000 0x00000000 0x00000000 0x408126f8 0xffffffff 0x408126f8
40812700: 0x408126f8 0x00000000 0x4081270c 0xffffffff 0x4081270c 0x4081270c 0x00000001 0x00000001
40812720: 0x00000000 0x0001ffff 0x00000000 0xb33fffff 0x00000000 0x00000000 0x40820884 0x408208ec
40812740: 0x40820954 0x00000000 0x00000000 0x00000001 0x00000000 0x00000000 0x00000000 0x420eb346
0x420eb346: set_pbus_mem at ??:?

40812760: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x40812780
40812780: 0x00000000 0x00000001 0x420d5b6c 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
0x420d5b6c: std::collate<wchar_t>::do_compare(wchar_t const*, wchar_t const*, wchar_t const*, wchar_t const*) const at /builds/idf/crosstool-NG/.build/riscv32-esp-elf/build/build-cc-gcc-final/riscv32-esp-elf/rv32imac_zicsr_zifencei/ilp32/no-rtti/libstdc++-v3/include/bits/locale_classes.tcc:195

408127a0: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
408127c0: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
408127e0: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
40812800: 0x00000000 0x00000000 0x00000000 0x40820878 0x00000000 0x00000000 0x00000000 0x40820c68
40812820: 0x00000000 0x6000b000 0x4080901e 0x4080902a 0x4082062c 0x408206f0 0x408207b4 0x4084f8d4
0x4080901e: modem_clock_hal_get_clock_domain_icg_bitmap at /home/aebrecht/esp/v5.1.3/esp-idf/components/hal/esp32c6/modem_clock_hal.c:66

0x4080902a: modem_clock_hal_get_clock_domain_icg_bitmap at /home/aebrecht/esp/v5.1.3/esp-idf/components/hal/esp32c6/modem_clock_hal.c:66

40812840: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
40812860: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
40812880: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
408128a0: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
408128c0: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
408128e0: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
40812900: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
40812920: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
40812940: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
40812960: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
40812980: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
408129a0: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x408129c4
408129c0: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x408129e4
408129e0: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000

ELF file SHA256: 6477b87dfdecd40b
Warning: checksum mismatch between flashed and built applications. Checksum of built application is dd9e1137f1e42cb1b5688d48547ad1725c8138bb5ef0f9814f90f64ff1615239

Rebooting...

Message 3: "This message has a length of 41: COMPUTER" Arrives Message 3: "E (152350) APP: len: 41 data: This message has a length of 41: COMPUTER " the code crashed?: No

Message 4: "This message has a length of 53: COMPUTER, LAMP, LAMP" Arrives Message 4: "E (244004) APP: len: 53 data: This message has a length of 53: COMPUTER, LAMP " the code crashed?: No

Message 5: "This message has a length of 230: COMPUTER, LAMP, FOCUS, HOTMIGA, KEYBOARD, GUITAR, BOTTLE, GLASS, CELL PHONE, DESK, WATER, BATHROOM, FIRE, TRUCK, ONE, TWO, THREE, FOUR, FIVE, SIX, SEVEN, EIGHT, NINE, TEN, ELEVEN, TWELVE, THIRTEEN" Arrives Message 5: nothing arrived it just crash the code crashed?: Yes Complete LOG Message 5:

Rebooting...
I (607) cpu_start: Unicore app
I (607) cpu_start: Pro cpu up.
W (617) clk: esp_perip_clk_init() has not been implemented yet
I (623) cpu_start: Pro cpu start user code
I (624) cpu_start: cpu freq: 96000000 Hz
I (624) cpu_start: Application information:
I (626) cpu_start: Project name:     firmware_boiler_zigbee_G2
I (633) cpu_start: App version:      57fc143-dirty
I (638) cpu_start: Compile time:     Mar 18 2024 11:31:09
I (644) cpu_start: ELF file SHA256:  6477b87dfdecd40b...
Warning: checksum mismatch between flashed and built applications. Checksum of built application is dd9e1137f1e42cb1b5688d48547ad1725c8138bb5ef0f9814f90f64ff1615239
I (650) cpu_start: ESP-IDF:          v5.1.3-dirty
I (656) cpu_start: Min chip rev:     v0.0
I (660) cpu_start: Max chip rev:     v0.99 
I (665) cpu_start: Chip rev:         v0.1
I (670) heap_init: Initializing. RAM available for dynamic allocation:
I (677) heap_init: At 4081FED0 len 0002D4B0 (181 KiB): D/IRAM
I (684) heap_init: At 4084D380 len 00002B60 (10 KiB): STACK/DIRAM
I (691) spi_flash: detected chip: generic
I (695) spi_flash: flash io: dio
I (703) sleep: Configure to isolate all GPIO pins in sleep state
I (706) sleep: Enable automatic switching of GPIO sleep configuration
I (713) coexist: coex firmware version: 77cd7f8
I (719) app_start: Starting scheduler on CPU0
I (723) main_task: Started on CPU0
I (727) main_task: Calling app_main()
E (741) AZURE: dato 
E (741) AZURE: dato 
E (741) task_wdt: esp_task_wdt_init(593): TWDT already initialized
I (744) gpio: GPIO[14]| InputEn: 0| OutputEn: 1| OpenDrain: 0| Pullup: 0| Pulldown: 0| Intr:0 
I (753) gpio: GPIO[1]| InputEn: 0| OutputEn: 1| OpenDrain: 0| Pullup: 0| Pulldown: 0| Intr:0 
I (762) gpio: GPIO[0]| InputEn: 0| OutputEn: 1| OpenDrain: 0| Pullup: 0| Pulldown: 0| Intr:0 
I (772) taskZigbee: zigbee Handler Task Initialized
I (777) taskZigbee: Zigbee Handler Task Created
I (791) phy: phy_version: 230,2, 9aae6ea, Jan 15 2024, 11:17:12
I (793) phy: libbtbb version: 944f18e, Jan 15 2024, 11:17:25
I (813) taskZigbee:  Zigbee Task Created
W (816) taskZigbee: ZDO signal: 23, status: -1
I (817) taskZigbee: Zigbee signal: SKIP_STARTUP
I (1771) taskZigbee: Start network steering
W (1800) taskZigbee: ZDO signal: 54, status: 0
I (1804) taskZigbee: Zigbee signal: DEVICE_REBOOT
I (1804) taskZigbee: Zigbee stack initialized
I (1892) taskZigbee: ieee_cb address is: 60:55:f9:00:00:f6:f0:78
I (1893) taskZigbee: local address is: 74:4d:bd:ff:fe:60:9b:dd
I (1895) taskZigbee: local short address is: 0xf982
I (1908) taskZigbee: bind_cb status:0
I (2113) BLE_INIT: Using main XTAL as clock source
I (2124) BLE_INIT: ble controller commit:[217f1bf]
I (2126) NimBLE_SPP_BLE_PRPH: BLE Host Task Started
I (2321) taskZigbee: Zigbee signal: DEVICE_REBOOT
I (2322) taskZigbee: Zigbee stack initialized
E (20939) system_api: 0 mac type is incorrect (not found)
W (23101) taskZigbee: ZDO signal: 50, status: 0
W (38321) taskZigbee: ZDO signal: 50, status: 0
Guru Meditation Error: Core  0 panic'ed (Load access fault). Exception was unhandled.

Core  0 register dump:
MEPC    : 0x4080acfa  RA      : 0x4080acfa  SP      : 0x40812600  GP      : 0x40810460  
0x4080acfa: clk_ll_32k_calibration_get_target at /home/aebrecht/esp/v5.1.3/esp-idf/components/hal/esp32c6/include/hal/clk_tree_ll.h:616
 (inlined by) rtc_clk_cal_internal at /home/aebrecht/esp/v5.1.3/esp-idf/components/esp_hw_support/port/esp32c6/rtc_time.c:66
 (inlined by) rtc_clk_cal at /home/aebrecht/esp/v5.1.3/esp-idf/components/esp_hw_support/port/esp32c6/rtc_time.c:223

0x4080acfa: clk_ll_32k_calibration_get_target at /home/aebrecht/esp/v5.1.3/esp-idf/components/hal/esp32c6/include/hal/clk_tree_ll.h:616
 (inlined by) rtc_clk_cal_internal at /home/aebrecht/esp/v5.1.3/esp-idf/components/esp_hw_support/port/esp32c6/rtc_time.c:66
 (inlined by) rtc_clk_cal at /home/aebrecht/esp/v5.1.3/esp-idf/components/esp_hw_support/port/esp32c6/rtc_time.c:223

0x40810460: isr_handle_tx_done at /home/aebrecht/esp/v5.1.3/esp-idf/components/ieee802154/driver/esp_ieee802154_dev.c:397
 (inlined by) ieee802154_isr at /home/aebrecht/esp/v5.1.3/esp-idf/components/ieee802154/driver/esp_ieee802154_dev.c:620

TP      : 0x40800394  T0      : 0x7fffffff  T1      : 0x2000104c  T2      : 0x00000002  
0x40800394: pthread_mutex_unlock at /home/aebrecht/esp/v5.1.3/esp-idf/components/pthread/pthread.c:693

S0/FP   : 0x4f48202c  S1      : 0x00000001  A0      : 0x00000002  A1      : 0x4081262c  
A2      : 0x4081263c  A3      : 0x00000004  A4      : 0x20001090  A5      : 0x00001881  
A6      : 0xa0000000  A7      : 0x0000000a  S2      : 0x00000001  S3      : 0x4081263c  
S4      : 0x00000000  S5      : 0x4081262c  S6      : 0x00000003  S7      : 0x40824d34  
S8      : 0x00000005  S9      : 0x00000073  S10     : 0x00000000  S11     : 0x00000000  
T3      : 0x4081e628  T4      : 0x00000000  T5      : 0x00000001  T6      : 0x47494520  
MSTATUS : 0x00001881  MTVEC   : 0x40800001  MCAUSE  : 0x00000005  MTVAL   : 0x4f482064  
0x40800001: _vector_table at ??:?

MHARTID : 0x00000000  

Stack memory:
40812600: 0x00000003 0x408250a8 0x00000002 0x4081f000 0x00000001 0x00000001 0x408259b4 0x4080216e
0x4080216e: npl_freertos_event_deinit at /home/aebrecht/esp/v5.1.3/esp-idf/components/bt/porting/npl/freertos/src/npl_os_freertos.c:115 (discriminator 1)

40812620: 0x40814000 0x40814000 0x40814000 0x4081eed4 0x00000001 0x4082d1a4 0x4082d154 0x4080363c
0x4080363c: r_ble_lll_rfmgmt_instant_wakeup_check at ??:?

40812640: 0x03ffffff 0x00000001 0x4081f000 0x40805b40 0x00001881 0x00000000 0x00000000 0x00000001
0x40805b40: r_ble_log_internal_x0 at ??:?

40812660: 0x00001881 0x8000000f 0x00000000 0x4080505a 0x00001881 0x8000000d 0x00000010 0x408001ec
0x4080505a: r_ble_hci_uart_tx_char at ??:?

0x408001ec: _interrupt_handler at ??:?

40812680: 0x6000b000 0x4080901e 0x4080902a 0x00000000 0x4081268c 0x00000000 0x00000000 0x00000000
0x4080901e: modem_clock_hal_get_clock_domain_icg_bitmap at /home/aebrecht/esp/v5.1.3/esp-idf/components/hal/esp32c6/modem_clock_hal.c:66

0x4080902a: modem_clock_hal_get_clock_domain_icg_bitmap at /home/aebrecht/esp/v5.1.3/esp-idf/components/hal/esp32c6/modem_clock_hal.c:66

408126a0: 0x408126a4 0xffffffff 0x408126a4 0x408126a4 0x00000000 0x408126b8 0xffffffff 0x408126b8
408126c0: 0x408126b8 0x00000001 0x00000001 0x00000000 0x0001ffff 0x00000000 0xb33fffff 0x00000000
408126e0: 0x00000000 0x408126e0 0x00000000 0x00000000 0x00000000 0x408126f8 0xffffffff 0x408126f8
40812700: 0x408126f8 0x00000000 0x4081270c 0xffffffff 0x4081270c 0x4081270c 0x00000001 0x00000001
40812720: 0x00000000 0x0001ffff 0x00000000 0xb33fffff 0x00000000 0x00000000 0x40820884 0x408208ec
40812740: 0x40820954 0x00000000 0x00000000 0x00000001 0x00000000 0x00000000 0x00000000 0x420eb346
0x420eb346: set_pbus_mem at ??:?

40812760: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x40812780
40812780: 0x00000000 0x00000001 0x420d5b6c 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
0x420d5b6c: std::collate<wchar_t>::do_compare(wchar_t const*, wchar_t const*, wchar_t const*, wchar_t const*) const at /builds/idf/crosstool-NG/.build/riscv32-esp-elf/build/build-cc-gcc-final/riscv32-esp-elf/rv32imac_zicsr_zifencei/ilp32/no-rtti/libstdc++-v3/include/bits/locale_classes.tcc:195

408127a0: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
408127c0: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
408127e0: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
40812800: 0x00000000 0x00000000 0x00000000 0x40820878 0x00000000 0x00000000 0x00000000 0x40820c68
40812820: 0x00000000 0x6000b000 0x4080901e 0x4080902a 0x4082062c 0x408206f0 0x408207b4 0x4084f8d4
0x4080901e: modem_clock_hal_get_clock_domain_icg_bitmap at /home/aebrecht/esp/v5.1.3/esp-idf/components/hal/esp32c6/modem_clock_hal.c:66

0x4080902a: modem_clock_hal_get_clock_domain_icg_bitmap at /home/aebrecht/esp/v5.1.3/esp-idf/components/hal/esp32c6/modem_clock_hal.c:66

40812840: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
40812860: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
40812880: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
408128a0: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
408128c0: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
408128e0: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
40812900: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
40812920: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
40812940: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
40812960: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
40812980: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
408129a0: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x408129c4
408129c0: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x408129e4
408129e0: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000

ELF file SHA256: 6477b87dfdecd40b
Warning: checksum mismatch between flashed and built applications. Checksum of built application is dd9e1137f1e42cb1b5688d48547ad1725c8138bb5ef0f9814f90f64ff1615239

Rebooting...

Message 6: "This message has a length of 230: COMPUTER, LAMP, FOCUS, HOTMIGA, KEYBOARD, GUITAR, BOTTLE, GLASS, CELL PHONE, DESK, WATER, BATHROOM, FIRE, TRUCK, ONE, TWO, THREE, FOUR, FIVE, SIX, SEVEN, EIGHT, NINE, TEN, ELEVEN, TWELVE, THIRTEEN" Arrives Message 6: "E (16097) APP: len: 230 data: This message has a length of 230: COMPUTER, LAMP, FOCUS, HOTMIGA, KEYBOARD, GUITAR, BOTTLE, GLASS, CELL PHONE, DESK, WATER, BATHROOM, FIRE, TRUCK, ONE, TWO, THREE, FOUR, FIVE, SIX, SEVEN, EIGHT, NINE, TEN, ELEVEN, TWELV " the code crashed?: Yes Complete LOG Message 6:

I (421) cpu_start: Unicore app
I (422) cpu_start: Pro cpu up.
W (430) clk: esp_perip_clk_init() has not been implemented yet
I (437) cpu_start: Pro cpu start user code
I (437) cpu_start: cpu freq: 96000000 Hz
I (438) cpu_start: Application information:
I (440) cpu_start: Project name:     firmware_boiler_zigbee_G2
I (446) cpu_start: App version:      57fc143-dirty
I (452) cpu_start: Compile time:     Mar 18 2024 11:31:09
I (458) cpu_start: ELF file SHA256:  1353e9c0aef86a7c...
I (464) cpu_start: ESP-IDF:          v5.1.3-dirty
I (469) cpu_start: Min chip rev:     v0.0
I (474) cpu_start: Max chip rev:     v0.99 
I (479) cpu_start: Chip rev:         v0.1
I (484) heap_init: Initializing. RAM available for dynamic allocation:
I (491) heap_init: At 40820960 len 0002CA20 (178 KiB): D/IRAM
I (497) heap_init: At 4084D380 len 00002B60 (10 KiB): STACK/DIRAM
I (505) spi_flash: detected chip: generic
I (509) spi_flash: flash io: dio
I (516) sleep: Configure to isolate all GPIO pins in sleep state
I (519) sleep: Enable automatic switching of GPIO sleep configuration
I (527) coexist: coex firmware version: 77cd7f8
I (532) app_start: Starting scheduler on CPU0
I (537) main_task: Started on CPU0
I (541) main_task: Calling app_main()
E (555) AZURE: dato 
E (555) AZURE: dato 
E (555) task_wdt: esp_task_wdt_init(593): TWDT already initialized
I (558) gpio: GPIO[14]| InputEn: 0| OutputEn: 1| OpenDrain: 0| Pullup: 0| Pulldown: 0| Intr:0 
I (567) gpio: GPIO[1]| InputEn: 0| OutputEn: 1| OpenDrain: 0| Pullup: 0| Pulldown: 0| Intr:0 
I (576) gpio: GPIO[0]| InputEn: 0| OutputEn: 1| OpenDrain: 0| Pullup: 0| Pulldown: 0| Intr:0 
I (586) taskZigbee: zigbee Handler Task Initialized
I (591) taskZigbee: Zigbee Handler Task Created
I (605) phy: phy_version: 230,2, 9aae6ea, Jan 15 2024, 11:17:12
I (607) phy: libbtbb version: 944f18e, Jan 15 2024, 11:17:25
I (616) taskZigbee:  Zigbee Task Created
W (619) taskZigbee: ZDO signal: 23, status: -1
I (620) taskZigbee: Zigbee signal: SKIP_STARTUP
I (1585) taskZigbee: Start network steering
I (1738) taskZigbee: Zigbee signal: STEERING
I (1739) taskZigbee: Network steering was not successful (status: -1)
I (1926) BLE_INIT: Using main XTAL as clock source
I (1932) BLE_INIT: ble controller commit:[217f1bf]
I (1934) NimBLE_SPP_BLE_PRPH: BLE Host Task Started
I (2131) taskZigbee: Zigbee signal: DEVICE_FIRST_START
I (2131) taskZigbee: Zigbee stack initialized
W (7972) taskZigbee: ZDO signal: 54, status: 0
W (8114) taskZigbee: ZDO signal: 54, status: 0
W (8560) taskZigbee: ZDO signal: 54, status: 0
I (8563) taskZigbee: Zigbee signal: STEERING
I (8564) taskZigbee: Joined network successfully (Extended PAN ID: 60:55:f9:00:00:f6:f0:78, PAN ID: 0xca80, Channel:16)
I (8626) taskZigbee: ieee_cb address is: 60:55:f9:00:00:f6:f0:78
I (8627) taskZigbee: local address is: 74:4d:bd:ff:fe:60:9b:dd
I (8629) taskZigbee: local short address is: 0xf982
I (8643) taskZigbee: bind_cb status:0
E (16097) APP: len: 230 data: This message has a length of 230: COMPUTER, LAMP, FOCUS, HOTMIGA, KEYBOARD, GUITAR, BOTTLE, GLASS, CELL PHONE, DESK, WATER, BATHROOM, FIRE, TRUCK, ONE, TWO, THREE, FOUR, FIVE, SIX, SEVEN, EIGHT, NINE, TEN, ELEVEN, TWELV 
Guru Meditation Error: Core  0 panic'ed (Load access fault). Exception was unhandled.

Core  0 register dump:
MEPC    : 0x4080acfa  RA      : 0x4080acfa  SP      : 0x40812600  GP      : 0x40810460  
0x4080acfa: xQueueGenericSendFromISR at /home/aebrecht/esp/v5.1.3/esp-idf/components/freertos/FreeRTOS-Kernel/queue.c:1149
0x4080acfa: xQueueGenericSendFromISR at /home/aebrecht/esp/v5.1.3/esp-idf/components/freertos/FreeRTOS-Kernel/queue.c:1149

TP      : 0x40800e24  T0      : 0x7fffffff  T1      : 0x2000104c  T2      : 0x00000002  
0x40800e24: esp_intr_enable at /home/aebrecht/esp/v5.1.3/esp-idf/components/esp_hw_support/intr_alloc.c:805

S0/FP   : 0x4f48202c  S1      : 0x00000001  A0      : 0x00000002  A1      : 0x4081262c  
A2      : 0x4081263c  A3      : 0x00000004  A4      : 0x20001090  A5      : 0x00001881  
A6      : 0x0000001f  A7      : 0x00000035  S2      : 0x00000001  S3      : 0x4081263c  
S4      : 0x00000000  S5      : 0x4081262c  S6      : 0x00000008  S7      : 0x4081553b  
S8      : 0x00000001  S9      : 0x40814000  S10     : 0x40814000  S11     : 0x40814000  
T3      : 0x4081f0b8  T4      : 0x00000000  T5      : 0x00000001  T6      : 0x821a4800  
MSTATUS : 0x00001881  MTVEC   : 0x40800001  MCAUSE  : 0x00000005  MTVAL   : 0x4f482064  
0x40800001: _vector_table at ??:?

MHARTID : 0x00000000  

Stack memory:
40812600: 0x00000008 0x408261d8 0x408189ff 0x4081f000 0x00000001 0x00000001 0x40826444 0x4080216e
0x4080216e: npl_freertos_eventq_put at /home/aebrecht/esp/v5.1.3/esp-idf/components/bt/porting/npl/freertos/src/npl_os_freertos.c:241

40812620: 0x40814000 0x40814000 0x00000001 0x4081f964 0x00000001 0x4082dc34 0x4082dbe4 0x4080363c
0x4080363c: r_ble_lll_sched_update_cur_entry at ??:?

40812640: 0x03ffffff 0x00000001 0x40820000 0x40805b40 0x00001881 0x00000000 0x40812680 0x00000001
0x40805b40: r_ble_lll_recycle_sch_entry at ??:?

40812660: 0x00001881 0x8000000f 0x40825fbc 0x4080505a 0x00001881 0x8000000b 0x408260c0 0x408001ec
0x4080505a: r_ble_phy_isr at ??:?
0x408001ec: _interrupt_handler at ??:?

40812680: 0x6000b000 0x4080901e 0x4080902a 0x00000000 0x4081268c 0x00000000 0x00000000 0x00000000
0x4080901e: systimer_ticks_to_us at /home/aebrecht/esp/v5.1.3/esp-idf/components/esp_hw_support/port/esp32h2/systimer.c:15
0x4080902a: systimer_us_to_ticks at /home/aebrecht/esp/v5.1.3/esp-idf/components/esp_hw_support/port/esp32h2/systimer.c:20

408126a0: 0x408126a4 0xffffffff 0x408126a4 0x408126a4 0x00000000 0x408126b8 0xffffffff 0x408126b8
408126c0: 0x408126b8 0x00000001 0x00000001 0x00000000 0x0001ffff 0x00000000 0xb33fffff 0x00000000
408126e0: 0x00000000 0x408126e0 0x00000000 0x00000000 0x00000000 0x408126f8 0xffffffff 0x408126f8
40812700: 0x408126f8 0x00000000 0x4081270c 0xffffffff 0x4081270c 0x4081270c 0x00000001 0x00000001
40812720: 0x00000000 0x0001ffff 0x00000000 0xb33fffff 0x00000000 0x00000000 0x40821314 0x4082137c
40812740: 0x408213e4 0x00000000 0x00000000 0x00000001 0x00000000 0x00000000 0x00000000 0x420eb34c
0x420eb34c: _cleanup_r at /builds/idf/crosstool-NG/.build/riscv32-esp-elf/src/newlib/newlib/libc/stdio/findfp.c:229

40812760: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x40812780
40812780: 0x00000000 0x00000001 0x420d5b72 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
0x420d5b72: __tcf_0 at /builds/idf/crosstool-NG/.build/riscv32-esp-elf/build/build-cc-gcc-final/riscv32-esp-elf/rv32imac_zicsr_zifencei/ilp32/no-rtti/libstdc++-v3/include/riscv32-esp-elf/bits/gthr-default.h:740
(inlined by) __gnu_cxx::__mutex::~__mutex() at /builds/idf/crosstool-NG/.build/riscv32-esp-elf/build/build-cc-gcc-final/riscv32-esp-elf/rv32imac_zicsr_zifencei/ilp32/no-rtti/libstdc++-v3/include/ext/concurrence.h:140
(inlined by) __tcf_0 at /builds/idf/crosstool-NG/.build/riscv32-esp-elf/build/build-cc-gcc-final/riscv32-esp-elf/rv32imac_zicsr_zifencei/ilp32/no-rtti/libstdc++-v3/libsupc++/atomicity.cc:33

408127a0: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
408127c0: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
408127e0: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
40812800: 0x00000000 0x00000000 0x00000000 0x40821308 0x00000000 0x00000000 0x00000000 0x408216f8
40812820: 0x00000000 0x6000b000 0x4080901e 0x4080902a 0x408210bc 0x40821180 0x40821244 0x4084f8d4
0x4080901e: systimer_ticks_to_us at /home/aebrecht/esp/v5.1.3/esp-idf/components/esp_hw_support/port/esp32h2/systimer.c:15
0x4080902a: systimer_us_to_ticks at /home/aebrecht/esp/v5.1.3/esp-idf/components/esp_hw_support/port/esp32h2/systimer.c:20

40812840: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
40812860: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
40812880: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
408128a0: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
408128c0: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
408128e0: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
40812900: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
40812920: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
40812940: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
40812960: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
40812980: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
408129a0: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x408129c4
408129c0: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x408129e4
408129e0: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000

ELF file SHA256: 1353e9c0aef86a7c

Rebooting...

Results: Messages 1: Len 105, arrived correctly and crash Messages 2: Len 135, arrived correctly and crash Messages 3: Len 41, arrived correctly and do not crash Messages 4: Len 53, arrived truncated and do not crash Messages 5: Len 230, did not arrive and crash Messages 6: Len , arrived truncated and crash

Each message was sent multiple times giving the same results, meaning that the messages that are truncated do so systematically and in the same place.

Could you reopen this issue to follow up? thank you

xieqinan commented 8 months ago

Hi, @diazmanuel ,

I have created a simple example to test this issue, which is attached here. Could you please also verify it?

custom_test.zip

diazmanuel commented 8 months ago

hello, @xieqinan I was testing the example that you sent me and yes, it works correctly without any type of error, so to continue with the testing, I made a modification to bring it closer to what I have. On the endpoint side I simply added another way to print the data that came to me in string format:

            for (int i = 0; i < message->attribute.data.size; i++) {
                printf("0x%2x ", *(uint8_t *)(message->attribute.data.value + i));
            }
            printf("\n");
            printf("%s",(char *)message->attribute.data.value);
            printf("\n");
            ESP_LOGE(TAG,"%s",(char *)message->attribute.data.value);

On the other hand, in the coordinator, I replaced the way in which the character string is generated as follows:

        case 1: {
            // uint8_t value[CUSTOM_STRING_MAX_SIZE];
            // value[0] = CUSTOM_STRING_MAX_SIZE - 1;
            // for (int i = 1; i < CUSTOM_STRING_MAX_SIZE; i++) {
            //     value[i] = i;
            // }
            char *msg="This message has a length of 230: COMPUTER, LAMP, FOCUS, HOTMIGA, KEYBOARD, GUITAR, BOTTLE, GLASS, CELL PHONE, DESK, WATER, BATHROOM, FIRE, TRUCK, ONE, TWO, THREE, FOUR, FIVE, SIX, SEVEN, EIGHT, NINE, TEN, ELEVEN, TWELVE, THIRTEEN";
            char *value;
            value = (void *)malloc(sizeof(uint8_t) * (strlen(msg) +  1));
            memset( value,0,sizeof(uint8_t) * (strlen(msg) +  1));
            ZBM_Set_Zigbee_Attr_String(value,strlen(msg),msg);
            esp_zb_zcl_attribute_t attrs = {2, {ESP_ZB_ZCL_ATTR_TYPE_CHAR_STRING, sizeof(value), value}};
            esp_zb_zcl_write_attr_cmd_t cmd_req = {
                .zcl_basic_cmd.src_endpoint = HA_ONOFF_SWITCH_ENDPOINT,
                .address_mode = ESP_ZB_APS_ADDR_MODE_DST_ADDR_ENDP_NOT_PRESENT,
                .clusterID = CUSTOM_CLUSTER_ID,
                .attr_number = 1,
                .attr_field = &attrs,
            };
            esp_zb_zcl_write_attr_cmd_req(&cmd_req);
            ESP_LOGI(TAG, "Send 'write large data(%d)' command", sizeof(value));
            flag = 2;
            free(value);
            break;
bool ZBM_Set_Zigbee_Attr_String(void *attr_data, uint16_t attr_len, char *s)
{
  bool res = false;

  if(NULL == attr_data || 0 == attr_len || NULL == s)
  {
    return res;
  }

  ((uint8_t*)attr_data)[0] = (uint8_t)attr_len;

  if(0 < attr_len) {
    memcpy(&((uint8_t*)attr_data)[1], s, attr_len);
  }

  res = true;
  return res;  
}

After sending the message from the coordinator, the endpoint receives the following message

I (18027) ESP_ZB_ON_OFF_LIGHT: Received message: endpoint(10), cluster(0xfc00), attribute(0x2), data size(231)
0xe6 0x54 0x68 0x69 0x73 0x20 0x6d 0x65 0x73 0x73 0x61 0x67 0x65 0x20 0x68 0x61 0x73 0x20 0x61 0x20 0x6c 0x65 0x6e 0x67 0x74 0x68 0x20 0x6f 0x66 0x20 0x32 0x33 0x30 0x3a 0x20 0x43 0x4f 0x4d 0x50 0x55 0x54 0x45 0x52 0x2c 0x20 0x4c 0x41 0x4d 0x50 0x2c 0x20 0x46 0x4f 0x43 0x55 0x53 0x2c 0x20 0x48 0x4f 0x54 0x4d 0x49 0x47 0x41 0x2c 0x20 0x4b 0x45 0x59 0x42 0x4f 0x41 0x52 0x44 0x2c 0x20 0x47 0x55 0x49 0x54 0x41 0x52 0x2c 0x20 0x42 0x4f 0x54 0x54 0x4c 0x45 0x2c 0x20 0x47 0x4c 0x41 0x53 0x53 0x2c 0x20 0x43 0x45 0x4c 0x4c 0x20 0x50 0x48 0x4f 0x4e 0x45 0x2c 0x20 0x44 0x45 0x53 0x4b 0x2c 0x20 0x57 0x41 0x54 0x45 0x52 0x2c 0x20 0x42 0x41 0x54 0x48 0x52 0x4f 0x4f 0x4d 0x2c 0x20 0x46 0x49 0x52 0x45 0x2c 0x20 0x54 0x52 0x55 0x43 0x4b 0x2c 0x20 0x4f 0x4e 0x45 0x2c 0x20 0x54 0x57 0x4f 0x2c 0x20 0x54 0x48 0x52 0x45 0x45 0x2c 0x20 0x46 0x4f 0x55 0x52 0x2c 0x20 0x46 0x49 0x56 0x45 0x2c 0x20 0x53 0x49 0x58 0x2c 0x20 0x53 0x45 0x56 0x45 0x4e 0x2c 0x20 0x45 0x49 0x47 0x48 0x54 0x2c 0x20 0x4e 0x49 0x4e 0x45 0x2c 0x20 0x54 0x45 0x4e 0x2c 0x20 0x45 0x4c 0x45 0x56 0x45 0x4e 0x2c 0x20 0x54 0x57 0x45 0x4c 0x56 0x 0 0x 0 0x 0 0x 0 0x a 0x42 0x52 0x54 0x45 0x45 0x4e 
�This message has a length of 230: COMPUTER, LAMP, FOCUS, HOTMIGA, KEYBOARD, GUITAR, BOTTLE, GLASS, CELL PHONE, DESK, WATER, BATHROOM, FIRE, TRUCK, ONE, TWO, THREE, FOUR, FIVE, SIX, SEVEN, EIGHT, NINE, TEN, ELEVEN, TWELV
E (18147) ESP_ZB_ON_OFF_LIGHT: �This message has a length of 230: COMPUTER, LAMP, FOCUS, HOTMIGA, KEYBOARD, GUITAR, BOTTLE, GLASS, CELL PHONE, DESK, WATER, BATHROOM, FIRE, TRUCK, ONE, TWO, THREE, FOUR, FIVE, SIX, SEVEN, EIGHT, NINE, TEN, ELEVEN, TWELV

It was possible to observe that the string of characters is cut, and analyzing the print by bytes it is seen that some bytes at the end are found as split (0x45 0x4c 0x56 0x 0 0x 0 0x 0 0x 0 0x a 0x42 0x52 0x54 0x45 0x45 0x4e) , something strange that I cannot explain, and I do not understand how this case can occur but I interpret it as that the message was corrupted, which results in the last value read by the print or the log function being 0x, which it interprets as \0, meaning the end of the chain. This explains why I noticed that the chain was breaking, it could also explain why it sometimes crashed in my code but this requires further analysis.

Another thing I noticed in your example is that if I modify the length of the message you originally sent, changing the CUSTOM_STRING_MAX_SIZE parameter to 150, the program crashes, I understand that because it is of type string it should be able to send up to 255 as specified by the standard, I don't know if there is a limitation on this topic

Anyway here you can see that the data is being corrupted. I also attach the modified example. In addition to the changes I mentioned above, I also had to modify the dependencies.lock file since the idf versions did not match, and the coordinator is an ESP32-C6.

custom_test_mod.zip

diazmanuel commented 7 months ago

hello, @xieqinan do you have any update about this issue? Could you open it again so that it can continue following?

xieqinan commented 7 months ago

@diazmanuel ,

Could you update the esp-idf version to v5.1.3 for testing again? I also will test the examples provided by you and give you feedback ASAP.

xieqinan commented 7 months ago

@diazmanuel ,

It was possible to observe that the string of characters is cut, and analyzing the print by bytes it is seen that some bytes at the end are found as split (0x45 0x4c 0x56 0x 0 0x 0 0x 0 0x 0 0x a 0x42 0x52 0x54 0x45 0x45 0x4e) , something strange that I cannot explain, and I do not understand how this case can occur but I interpret it as that the message was corrupted, which results in the last value read by the print or the log function being 0x, which it interprets as \0, meaning the end of the chain. This explains why I noticed that the chain was breaking, it could also explain why it sometimes crashed in my code but this requires further analysis.

The issue has been confirmed as a stack issue, and we will fix it in the next release. The root cause of this issue is that the I/O buffer does not have sufficient capacity for the input data, resulting in data being overwritten at the end.

Another thing I noticed in your example is that if I modify the length of the message you originally sent, changing the CUSTOM_STRING_MAX_SIZE parameter to 150, the program crashes, I understand that because it is of type string it should be able to send up to 255 as specified by the standard, I don't know if there is a limitation on this topic

Have you made any modifications to the code I provided? I tested it with a length equal to 150 case, and it worked successfully.

diazmanuel commented 7 months ago

hello @xieqinan,

The issue has been confirmed as a stack issue, and we will fix it in the next release. The root cause of this issue is that the I/O buffer does not have sufficient capacity for the input data, resulting in data being overwritten at the end.

I'm glad to hear you were able to identify the problem.

Have you made any modifications to the code I provided? I tested it with a length equal to 150 case, and it worked successfully.

No, the only changes I made were those I mentioned above, and I also used an H2 chip in one case and a C6 in the other. I think the only difference may be the versions of the SDK. In a previous comment I attached the modified project, there you can check the dependencies file. Anyway, I'll try it again and let you know if the error continues to appear.

xieqinan commented 7 months ago

@diazmanuel

The issue has been confirmed as a stack issue, and we will fix it in the next release. The root cause of this issue is that the I/O buffer does not have sufficient capacity for the input data, resulting in data being overwritten at the end.

This issue has been fixed in the v1.2.3 version. Could you test it again?

diazmanuel commented 7 months ago

Thanks, we tried it and now it works correctly

kgkask commented 5 months ago

I am wondering if it can be used with Arduino IDE, I am new to both Zigbee and ESP32H2 in general and I would like to used it for some projects, so is it possible .

kgkask commented 5 months ago

@diazmanuel I used this example and it works fine, however I tried to adjust it to suits my case, where I want to send the string from the ED to the Coordinator as well (bidirectional) when I do that and adjust everything accordingly the zigbee coordinator do not receive any thing, the action handler does not notice any message or a response. So I think that the esp_zb_zcl_write_attr_cmd_t can not be initiated from ED NOT sure but I reached to this conclusion.

any help I will be highly appreciated.