Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Zigbee: problem with battery powered devices after power off/on #10612

Closed
1 task done
michapr opened this issue Nov 17, 2024 · 100 comments
Closed
1 task done

Zigbee: problem with battery powered devices after power off/on #10612

michapr opened this issue Nov 17, 2024 · 100 comments
Assignees
Labels
Area: Zigbee Issues and Feature Request about Zigbee Chip: ESP32-C6 Issue is related to support of ESP32-C6 Chip Status: In Progress Issue is in progress

Comments

@michapr
Copy link

michapr commented Nov 17, 2024

Board

ESP32C6

Device Description

DevKit

Hardware Configuration

No external connections, only modul.

Version

latest development Release Candidate (RC-X)

IDE Name

Arduino IDE

Operating System

Windows 11

Flash frequency

80MHz

PSRAM enabled

no

Upload speed

921600

Description

Using Zigbee2MQTT battery powered device will be recognized and values will be reported as expected.
After power on/off device (remove power) the device will not more join and send values to the network and reboots regularly.

Have seen that this is happen only for battery powered devices.

If adding some delay after Zigbee.addEndpoint(&zbTempSensor); and after Zigbee.begin(); device will not reboot, but will also not join again / report values (some other debug messages).

Sketch

example Zigbee_Temperature_Sensor.ino modified:

static void temp_sensor_value_update(void *arg) {
  for (;;) {
    // Read temperature sensor value
    float tsens_value = temperatureRead();
    log_v("Temperature sensor value: %.2f°C", tsens_value);
    // Update temperature value in Temperature sensor EP
    zbTempSensor.setTemperature(tsens_value);
    zbTempSensor.setHumidity(tsens_value);
    delay(1000);
  }
}

....
  // Optional: set Zigbee device name and model
  zbTempSensor.setManufacturerAndModel("Espressif", "ZigbeeTempSensor");

  zbTempSensor.setPowerSource(ZB_POWER_SOURCE_BATTERY, 100);
  zbTempSensor.addHumiditySensor(0, 100, 1);

  // Set minimum and maximum temperature measurement value (10-50°C is default range for chip temperature measurement)
  zbTempSensor.setMinMaxValue(10, 50);
....

Debug Message

=========== Before Setup Start ===========
Chip Info:
------------------------------------------
  Model             : ESP32-C6
  Package           : 1
  Revision          : 0.01
  Cores             : 1
  CPU Frequency     : 160 MHz
  XTAL Frequency    : 40 MHz
  Features Bitfield : 0x00000052
  Embedded Flash    : No
  Embedded PSRAM    : No
  2.4GHz WiFi       : Yes
  Classic BT        : No
  BT Low Energy     : Yes
  IEEE 802.15.4     : Yes
------------------------------------------
INTERNAL Memory Info:
------------------------------------------
  Total Size        :   445324 B ( 434.9 KB)
  Free Bytes        :   414112 B ( 404.4 KB)
  Allocated Bytes   :    24260 B (  23.7 KB)
  Minimum Free Bytes:   409300 B ( 399.7 KB)
  Largest Free Block:   376820 B ( 368.0 KB)
------------------------------------------
Flash Info:
------------------------------------------
  Chip Size         :  4194304 B (4 MB)
  Block Size        :    65536 B (  64.0 KB)
  Sector Size       :     4096 B (   4.0 KB)
  Page Size         :      256 B (   0.2 KB)
  Bus Speed         : 40 MHz
  Bus Mode          : QIO
------------------------------------------
Partitions Info:
------------------------------------------
                nvs : addr: 0x00009000, size:    20.0 KB, type: DATA, subtype: NVS
            otadata : addr: 0x0000E000, size:     8.0 KB, type: DATA, subtype: OTA
               app0 : addr: 0x00010000, size:  1280.0 KB, type:  APP, subtype: OTA_0
               app1 : addr: 0x00150000, size:  1280.0 KB, type:  APP, subtype: OTA_1
             spiffs : addr: 0x00290000, size:  1388.0 KB, type: DATA, subtype: SPIFFS
         zb_storage : addr: 0x003EB000, size:    16.0 KB, type: DATA, subtype: FAT
             zb_fct : addr: 0x003EF000, size:     4.0 KB, type: DATA, subtype: FAT
           coredump : addr: 0x003F0000, size:    64.0 KB, type: DATA, subtype: COREDUMP
------------------------------------------
Software Info:
------------------------------------------
  Compile Date/Time : Nov 16 2024 21:10:20
  Compile Host OS   : windows
  ESP-IDF Version   : v5.3.1-638-ga0f798cfc4-dirty
  Arduino Version   : 3.1.0
------------------------------------------
Board Info:
------------------------------------------
  Arduino Board     : ESP32C6_DEV
  Arduino Variant   : esp32c6
  Arduino FQBN      : esp32:esp32:esp32c6:UploadSpeed=921600,CDCOnBoot=cdc,CPUFreq=160,FlashFreq=80,FlashMode=qio,FlashSize=4M,PartitionScheme=zigbee,DebugLevel=verbose,EraseFlash=all,JTAGAdapter=default,ZigbeeMode=ed
============ Before Setup End ============
[   990][I][esp32-hal-periman.c:141] perimanSetPinBus(): Pin 12 already has type USB_DM (38) with bus 0x4081155c
[   991][I][esp32-hal-periman.c:141] perimanSetPinBus(): Pin 13 already has type USB_DP (39) with bus 0x4081155c
[   991][V][esp32-hal-periman.c:235] perimanSetBusDeinit(): Deinit function for type GPIO (1) successfully set to 0x4200348e
[   992][V][esp32-hal-periman.c:160] perimanSetPinBus(): Pin 9 successfully set to type GPIO (1) with bus 0xa
[   993][D][ZigbeeCore.cpp:66] addEndpoint(): Endpoint: 10, Device ID: 0x0302
[   993][D][ZigbeeCore.cpp:103] zigbeeInit(): Initialize Zigbee stack
[  1028][D][ZigbeeCore.cpp:110] zigbeeInit(): Register all Zigbee EPs in list
[  1030][I][ZigbeeCore.cpp:118] zigbeeInit(): List of registered Zigbee EPs:
[  1030][I][ZigbeeCore.cpp:120] zigbeeInit(): Device type: Temperature Sensor, Endpoint: 10, Device ID: 0x0302
Zigbee stack assertion failed common/zb_error_indication.c:8
abort() was called at PC 0x42012b5d on core 0
Core  0 register dump:
MEPC    : 0x40801588  RA      : 0x40807ffc  SP      : 0x40824220  GP      : 0x4080f824
TP      : 0x408243b0  T0      : 0x37363534  T1      : 0x7271706f  T2      : 0x33323130
S0/FP   : 0x4082424c  S1      : 0x4082424c  A0      : 0x40824258  A1      : 0x4082423a
A2      : 0x00000000  A3      : 0x40824285  A4      : 0x00000001  A5      : 0x40816000
A6      : 0x00000000  A7      : 0x76757473  S2      : 0x00000000  S3      : 0x4081365c
S4      : 0x00000001  S5      : 0x00000000  S6      : 0x00000000  S7      : 0x00000000
S8      : 0x00000000  S9      : 0x00000000  S10     : 0x00000000  S11     : 0x00000000
T3      : 0x6e6d6c6b  T4      : 0x6a696867  T5      : 0x66656463  T6      : 0x62613938
MSTATUS : 0x00001881  MTVEC   : 0x40800001  MCAUSE  : 0x00000007  MTVAL   : 0x00000000
MHARTID : 0x00000000

Stack memory:
40824220: 0x00000000 0x00000000 0x40824238 0x4080dea6 0x00000000 0x00000000 0x00000030 0x40810e00
40824240: 0x4082424c 0x40810e1c 0x40824238 0x31303234 0x64356232 0x00000000 0x726f6261 0x20292874
40824260: 0x20736177 0x6c6c6163 0x61206465 0x43502074 0x34783020 0x32313032 0x20643562 0x63206e6f
40824280: 0x2065726f 0x00000030 0x00000000 0x5c9fa1b1 0x0000002f 0x40813a48 0x42075e69 0x42012b60
408242a0: 0x00000bd6 0x00000000 0x00000000 0x00000051 0x00000000 0x00000000 0x000000fe 0x420374f8
408242c0: 0x00000000 0x40813a48 0x40824320 0x42013ed6 0x00000000 0x00000000 0x00000ac0 0x0000001f
408242e0: 0x00000019 0x001f0040 0x00000000 0x00000000 0x000f0002 0x00000000 0x00000000 0x00000000
40824300: 0x0000001f 0x00000010 0x40813a48 0x420159e6 0x00000000 0x00000000 0x00000000 0x00000000
40824320: 0x00000019 0x001f0040 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x4202bd84
40824340: 0x00000000 0x00000000 0x00000000 0x4202c10e 0x00000000 0x00000000 0x00000000 0x42009084
40824360: 0x00000000 0x00000000 0x00000000 0x4200090c 0x00000000 0x00000000 0x00000000 0x408092b8
40824380: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
408243a0: 0x00000000 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 0xbaad5678 0x00058251 0x408169c4
408243c0: 0x408169c4 0xfc031e0c 0x78849b34 0x30c832a9 0x9d9c5b2a 0xae36ed22 0xadd31283 0xecb1fcf5
408243e0: 0x7c32a028 0x2d446289 0xe2cffffd 0x711286e4 0xe66f0bce 0x82719d97 0x7645118a 0x130cd72f
40824400: 0x8c12a31c 0x7158b14d 0x8a3fb378 0x9e867233 0x66837636 0xe997fc45 0x330036ca 0x0a0a8952
40824420: 0xc024d6f7 0xff7c0bb3 0xfb6f2de7 0x378053c9 0xec565c7f 0x7e9c383f 0xaad1000d 0x04923695
40824440: 0xeb226082 0xd2808128 0x384ef7ae 0xfd399651 0x2d15af93 0x244ab39b 0xa0f9c680 0x436558df
40824460: 0x053a2b45 0xf23ac453 0xba7fb0b1 0xf068200a 0x4539f116 0x1712f8c7 0x0666cf28 0x7344999c
40824480: 0xd9cd50c1 0xd032329a 0x963c700b 0x167d9b9d 0x39809846 0x53548e10 0x8a1a132c 0x793164ac
408244a0: 0x06065915 0x0109a3a0 0xe565e7e9 0x8d7fffef 0x5fcf1039 0xd80dcd7d 0xa1228c21 0x0b311ccc
408244c0: 0xd8709c0d 0x2cec1457 0xb87cd0f7 0x5b756ef5 0xd98cefbe 0xffff653f 0x891a1046 0x1a8284e1
408244e0: 0x4037cdc3 0x31c19682 0x2dbe8ffd 0x294cb0b3 0xb6e1bcf5 0x4afe2c80 0xc19ca484 0x6000aba2
40824500: 0xb43bd81c 0x407e7d43 0x1deca8ae 0xa89a607b 0x74976fa9 0xaa3bfa1a 0x0b9000b4 0x14a83808
40824520: 0x830eb325 0x092140d5 0xdbe5cddf 0xba4fd1ad 0xeef9a462 0x7e268f92 0x94995434 0x2cbaa2dc
40824540: 0xbe382aa4 0xaaa71779 0x6c1dd7f3 0xf5a629c4 0xfeedbf7e 0xf7f6df1f 0x281e284a 0x5f147465
40824560: 0x51c3c99c 0x16b20c02 0x233a567e 0x5d493983 0xd11ef234 0xf7fc57bb 0xcec44ee9 0x8024372a
40824580: 0x02410490 0x41922360 0xe2e2ecfd 0x0543feb7 0xda2039e6 0xfa72cff9 0xd6d01951 0x2c4b020d
408245a0: 0x0081cb07 0x05140fa4 0xfed2fd8b 0xe73f7a6f 0xe7dbf128 0xe6dc0622 0x4c651164 0x627c4962
408245c0: 0xd82de23e 0x246307be 0x8178f7f9 0xc137f57b 0x8ff857ec 0x435fefe0 0x3a0791b7 0x51f6b636
408245e0: 0x26cd3c8b 0x2ee16160 0x51e99b82 0x38b9a5b0 0xfecfa861 0xfb2567bd 0x1490ee9f 0x2d76ef80
40824600: 0x0a64f0e1 0x3b290665 0xcdf33fa8 0xf9ed4e27 0xbd850fbf 0x00762f2e 0x0849ca10 0xcd048484



ELF file SHA256: 5542d8f16

Rebooting...
ESP-ROM:esp32c6-20220919
Build:Sep 19 2022
rst:0xc (SW_CPU),boot:0xc (SPI_FAST_FLASH_BOOT)
Saved PC:0x4001975a
SPIWP:0xee
mode:DIO, clock div:2
load:0x40875720,len:0x1190
load:0x4086c110,len:0xd98
load:0x4086e610,len:0x2e84
entry 0x4086c110
[     0][V][esp32-hal-periman.c:235] perimanSetBusDeinit(): Deinit function for type UART_RX (2) successfully set to 0x42005dce
[    12][V][esp32-hal-periman.c:235] perimanSetBusDeinit(): Deinit function for type UART_TX (3) successfully set to 0x42005d92
[    23][V][esp32-hal-periman.c:235] perimanSetBusDeinit(): Deinit function for type UART_CTS (4) successfully set to 0x42005d56
[    34][V][esp32-hal-periman.c:235] perimanSetBusDeinit(): Deinit function for type UART_RTS (5) successfully set to 0x42005d1a
[    46][V][esp32-hal-periman.c:235] perimanSetBusDeinit(): Deinit function for type UART_RX (2) successfully set to 0x42005dce
[    57][V][esp32-hal-periman.c:235] perimanSetBusDeinit(): Deinit function for type UART_TX (3) successfully set to 0x42005d92
[    68][V][esp32-hal-periman.c:235] perimanSetBusDeinit(): Deinit function for type UART_CTS (4) successfully set to 0x42005d56
[    80][V][esp32-hal-periman.c:235] perimanSetBusDeinit(): Deinit function for type UART_RTS (5) successfully set to 0x42005d1a
[    91][V][esp32-hal-periman.c:235] perimanSetBusDeinit(): Deinit function for type USB_DM (38) successfully set to 0x420025c0
[   102][V][esp32-hal-periman.c:235] perimanSetBusDeinit(): Deinit function for type USB_DP (39) successfully set to 0x420025c0
[   114][V][ZigbeeEP.cpp:18] ZigbeeEP(): Endpoint: 10
[   131][V][esp32-hal-periman.c:160] perimanSetPinBus(): Pin 17 successfully set to type UART_RX (2) with bus 0x4080f0fc
[   141][V][esp32-hal-periman.c:160] perimanSetPinBus(): Pin 16 successfully set to type UART_TX (3) with bus 0x4080f0fc
[   152][V][esp32-hal-periman.c:160] perimanSetPinBus(): Pin 12 successfully set to type USB_DM (38) with bus 0x4081155c
[   163][V][esp32-hal-periman.c:160] perimanSetPinBus(): Pin 13 successfully set to type USB_DP (39) with bus 0x4081155c
=========== Before Setup Start ===========
Chip Info:
------------------------------------------
  Model             : ESP32-C6
  Package           : 1
  Revision          : 0.01
  Cores             : 1
  CPU Frequency     : 160 MHz
  XTAL Frequency    : 40 MHz
  Features Bitfield : 0x00000052
  Embedded Flash    : No
  Embedded PSRAM    : No
  2.4GHz WiFi       : Yes
  Classic BT        : No
  BT Low Energy     : Yes
  IEEE 802.15.4     : Yes
------------------------------------------
INTERNAL Memory Info:
------------------------------------------
  Total Size        :   445324 B ( 434.9 KB)
  Free Bytes        :   409124 B ( 399.5 KB)
  Allocated Bytes   :    29216 B (  28.5 KB)
  Minimum Free Bytes:   409124 B ( 399.5 KB)
  Largest Free Block:   376820 B ( 368.0 KB)
------------------------------------------
Flash Info:
------------------------------------------
  Chip Size         :  4194304 B (4 MB)
  Block Size        :    65536 B (  64.0 KB)
  Sector Size       :     4096 B (   4.0 KB)
  Page Size         :      256 B (   0.2 KB)
  Bus Speed         : 40 MHz
  Bus Mode          : QIO
------------------------------------------
Partitions Info:
------------------------------------------
                nvs : addr: 0x00009000, size:    20.0 KB, type: DATA, subtype: NVS
            otadata : addr: 0x0000E000, size:     8.0 KB, type: DATA, subtype: OTA
               app0 : addr: 0x00010000, size:  1280.0 KB, type:  APP, subtype: OTA_0
               app1 : addr: 0x00150000, size:  1280.0 KB, type:  APP, subtype: OTA_1
             spiffs : addr: 0x00290000, size:  1388.0 KB, type: DATA, subtype: SPIFFS
         zb_storage : addr: 0x003EB000, size:    16.0 KB, type: DATA, subtype: FAT
             zb_fct : addr: 0x003EF000, size:     4.0 KB, type: DATA, subtype: FAT
           coredump : addr: 0x003F0000, size:    64.0 KB, type: DATA, subtype: COREDUMP
------------------------------------------
Software Info:
------------------------------------------
  Compile Date/Time : Nov 16 2024 21:10:20
  Compile Host OS   : windows
  ESP-IDF Version   : v5.3.1-638-ga0f798cfc4-dirty
  Arduino Version   : 3.1.0
------------------------------------------
Board Info:
------------------------------------------
  Arduino Board     : ESP32C6_DEV
  Arduino Variant   : esp32c6
  Arduino FQBN      : esp32:esp32:esp32c6:UploadSpeed=921600,CDCOnBoot=cdc,CPUFreq=160,FlashFreq=80,FlashMode=qio,FlashSize=4M,PartitionScheme=zigbee,DebugLevel=verbose,EraseFlash=all,JTAGAdapter=default,ZigbeeMode=ed
============ Before Setup End ============
[   286][I][esp32-hal-periman.c:141] perimanSetPinBus(): Pin 12 already has type USB_DM (38) with bus 0x4081155c
[   287][I][esp32-hal-periman.c:141] perimanSetPinBus(): Pin 13 already has type USB_DP (39) with bus 0x4081155c
[   287][V][esp32-hal-periman.c:235] perimanSetBusDeinit(): Deinit function for type GPIO (1) successfully set to 0x4200348e
[   288][V][esp32-hal-periman.c:160] perimanSetPinBus(): Pin 9 successfully set to type GPIO (1) with bus 0xa
[   289][D][ZigbeeCore.cpp:66] addEndpoint(): Endpoint: 10, Device ID: 0x0302
[   289][D][ZigbeeCore.cpp:103] zigbeeInit(): Initialize Zigbee stack
[   325][D][ZigbeeCore.cpp:110] zigbeeInit(): Register all Zigbee EPs in list
[   326][I][ZigbeeCore.cpp:118] zigbeeInit(): List of registered Zigbee EPs:
[   327][I][ZigbeeCore.cpp:120] zigbeeInit(): Device type: Temperature Sensor, Endpoint: 10, Device ID: 0x0302
[   424][V][ZigbeeCore.cpp:301] esp_zb_app_signal_handler(): ZDO signal: ZDO Config Ready (0x17), status: ESP_FAIL
[   425][I][ZigbeeCore.cpp:191] esp_zb_app_signal_handler(): Zigbee stack initialized
[  1336][V][Zigbee_Temperature_Sensor.ino:45] temp_sensor_value_update(): Temperature sensor value: 24.00°C
[  1336][V][ZigbeeTempSensor.cpp:68] setTemperature(): Updating temperature sensor value...
[  1337][D][ZigbeeTempSensor.cpp:70] setTemperature(): Setting temperature to 2400
[  1337][V][ZigbeeTempSensor.cpp:107] setHumidity(): Updating humidity sensor value...
[  1338][D][ZigbeeTempSensor.cpp:109] setHumidity(): Setting humidity to 2400
=========== After Setup Start ============
INTERNAL Memory Info:
------------------------------------------
  Total Size        :   445324 B ( 434.9 KB)
  Free Bytes        :   384116 B ( 375.1 KB)
  Allocated Bytes   :    53280 B (  52.0 KB)
  Minimum Free Bytes:   383988 B ( 375.0 KB)
  Largest Free Block:   352244 B ( 344.0 KB)
------------------------------------------
GPIO Info:
------------------------------------------
  GPIO : BUS_TYPE[bus/unit][chan]
  --------------------------------------
     9 : GPIO
    12 : USB_DM
    13 : USB_DP
    16 : UART_TX[0]
    17 : UART_RX[0]
============ After Setup End =============
[  2338][V][Zigbee_Temperature_Sensor.ino:45] temp_sensor_value_update(): Temperature sensor value: 25.00°C
[  2339][V][ZigbeeTempSensor.cpp:68] setTemperature(): Updating temperature sensor value...
[  2339][D][ZigbeeTempSensor.cpp:70] setTemperature(): Setting temperature to 2500
[  2340][V][ZigbeeTempSensor.cpp:107] setHumidity(): Updating humidity sensor value...
[  2340][D][ZigbeeTempSensor.cpp:109] setHumidity(): Setting humidity to 2500
[  3340][V][Zigbee_Temperature_Sensor.ino:45] temp_sensor_value_update(): Temperature sensor value: 26.00°C
[  3341][V][ZigbeeTempSensor.cpp:68] setTemperature(): Updating temperature sensor value...
[  3341][D][ZigbeeTempSensor.cpp:70] setTemperature(): Setting temperature to 2600
[  3342][V][ZigbeeTempSensor.cpp:107] setHumidity(): Updating humidity sensor value...
[  3342][D][ZigbeeTempSensor.cpp:109] setHumidity(): Setting humidity to 2600
[  4342][V][Zigbee_Temperature_Sensor.ino:45] temp_sensor_value_update(): Temperature sensor value: 26.00°C
[  4343][V][ZigbeeTempSensor.cpp:68] setTemperature(): Updating temperature sensor value...
[  4343][D][ZigbeeTempSensor.cpp:70] setTemperature(): Setting temperature to 2600
[  4343][V][ZigbeeTempSensor.cpp:107] setHumidity(): Updating humidity sensor value...
[  4344][D][ZigbeeTempSensor.cpp:109] setHumidity(): Setting humidity to 2600
[  5344][V][Zigbee_Temperature_Sensor.ino:45] temp_sensor_value_update(): Temperature sensor value: 27.00°C
[  5345][V][ZigbeeTempSensor.cpp:68] setTemperature(): Updating temperature sensor value...
[  5345][D][ZigbeeTempSensor.cpp:70] setTemperature(): Setting temperature to 2700
[  5346][V][ZigbeeTempSensor.cpp:107] setHumidity(): Updating humidity sensor value...
[  5346][D][ZigbeeTempSensor.cpp:109] setHumidity(): Setting humidity to 2700
[  6346][V][Zigbee_Temperature_Sensor.ino:45] temp_sensor_value_update(): Temperature sensor value: 27.00°C
[  6347][V][ZigbeeTempSensor.cpp:68] setTemperature(): Updating temperature sensor value...
[  6347][D][ZigbeeTempSensor.cpp:70] setTemperature(): Setting temperature to 2700
[  6348][V][ZigbeeTempSensor.cpp:107] setHumidity(): Updating humidity sensor value...
[  6348][D][ZigbeeTempSensor.cpp:109] setHumidity(): Setting humidity to 2700
[  7348][V][Zigbee_Temperature_Sensor.ino:45] temp_sensor_value_update(): Temperature sensor value: 28.00°C
[  7349][V][ZigbeeTempSensor.cpp:68] setTemperature(): Updating temperature sensor value...
[  7349][D][ZigbeeTempSensor.cpp:70] setTemperature(): Setting temperature to 2800
[  7350][V][ZigbeeTempSensor.cpp:107] setHumidity(): Updating humidity sensor value...
[  7350][D][ZigbeeTempSensor.cpp:109] setHumidity(): Setting humidity to 2800
[  8350][V][Zigbee_Temperature_Sensor.ino:45] temp_sensor_value_update(): Temperature sensor value: 28.00°C
[  8351][V][ZigbeeTempSensor.cpp:68] setTemperature(): Updating temperature sensor value...
[  8351][D][ZigbeeTempSensor.cpp:70] setTemperature(): Setting temperature to 2800
[  8352][V][ZigbeeTempSensor.cpp:107] setHumidity(): Updating humidity sensor value...
[  8352][D][ZigbeeTempSensor.cpp:109] setHumidity(): Setting humidity to 2800
[  9352][V][Zigbee_Temperature_Sensor.ino:45] temp_sensor_value_update(): Temperature sensor value: 28.00°C
[  9353][V][ZigbeeTempSensor.cpp:68] setTemperature(): Updating temperature sensor value...
[  9353][D][ZigbeeTempSensor.cpp:70] setTemperature(): Setting temperature to 2800
[  9354][V][ZigbeeTempSensor.cpp:107] setHumidity(): Updating humidity sensor value...
[  9354][D][ZigbeeTempSensor.cpp:109] setHumidity(): Setting humidity to 2800
[ 10354][V][Zigbee_Temperature_Sensor.ino:45] temp_sensor_value_update(): Temperature sensor value: 29.00°C
[ 10355][V][ZigbeeTempSensor.cpp:68] setTemperature(): Updating temperature sensor value...
[ 10355][D][ZigbeeTempSensor.cpp:70] setTemperature(): Setting temperature to 2900
[ 10356][V][ZigbeeTempSensor.cpp:107] setHumidity(): Updating humidity sensor value...
[ 10356][D][ZigbeeTempSensor.cpp:109] setHumidity(): Setting humidity to 2900
[ 11356][V][Zigbee_Temperature_Sensor.ino:45] temp_sensor_value_update(): Temperature sensor value: 29.00°C
[ 11357][V][ZigbeeTempSensor.cpp:68] setTemperature(): Updating temperature sensor value...
[ 11357][D][ZigbeeTempSensor.cpp:70] setTemperature(): Setting temperature to 2900
[ 11358][V][ZigbeeTempSensor.cpp:107] setHumidity(): Updating humidity sensor value...
[ 11358][D][ZigbeeTempSensor.cpp:109] setHumidity(): Setting humidity to 2900
[ 12358][V][Zigbee_Temperature_Sensor.ino:45] temp_sensor_value_update(): Temperature sensor value: 29.00°C
[ 12359][V][ZigbeeTempSensor.cpp:68] setTemperature(): Updating temperature sensor value...
[ 12359][D][ZigbeeTempSensor.cpp:70] setTemperature(): Setting temperature to 2900
[ 12360][V][ZigbeeTempSensor.cpp:107] setHumidity(): Updating humidity sensor value...
[ 12360][D][ZigbeeTempSensor.cpp:109] setHumidity(): Setting humidity to 2900
[ 12772ESP-ROM:esp32c6-20220919
Build:Sep 19 2022
rst:0xc (SW_CPU),boot:0xc (SPI_FAST_FLASH_BOOT)
Saved PC:0x4001975a
SPIWP:0xee
mode:DIO, clock div:2
load:0x40875720,len:0x1190
load:0x4086c110,len:0xd98
load:0x4086e610,len:0x2e84
entry 0x4086c110
[     0][V][esp32-hal-periman.c:235] perimanSetBusDeinit(): Deinit function for type UART_RX (2) successfully set to 0x42005dce
[    12][V][esp32-hal-periman.c:235] perimanSetBusDeinit(): Deinit function for type UART_TX (3) successfully set to 0x42005d92
[    23][V][esp32-hal-periman.c:235] perimanSetBusDeinit(): Deinit function for type UART_CTS (4) successfully set to 0x42005d56
[    34][V][esp32-hal-periman.c:235] perimanSetBusDeinit(): Deinit function for type UART_RTS (5) successfully set to 0x42005d1a
[    46][V][esp32-hal-periman.c:235] perimanSetBusDeinit(): Deinit function for type UART_RX (2) successfully set to 0x42005dce
[    57][V][esp32-hal-periman.c:235] perimanSetBusDeinit(): Deinit function for type UART_TX (3) successfully set to 0x42005d92
[    68][V][esp32-hal-periman.c:235] perimanSetBusDeinit(): Deinit function for type UART_CTS (4) successfully set to 0x42005d56
[    80][V][esp32-hal-periman.c:235] perimanSetBusDeinit(): Deinit function for type UART_RTS (5) successfully set to 0x42005d1a
[    91][V][esp32-hal-periman.c:235] perimanSetBusDeinit(): Deinit function for type USB_DM (38) successfully set to 0x420025c0
[   102][V][esp32-hal-periman.c:235] perimanSetBusDeinit(): Deinit function for type USB_DP (39) successfully set to 0x420025c0
[   114][V][ZigbeeEP.cpp:18] ZigbeeEP(): Endpoint: 10
[   131][V][esp32-hal-periman.c:160] perimanSetPinBus(): Pin 17 successfully set to type UART_RX (2) with bus 0x4080f0fc
[   141][V][esp32-hal-periman.c:160] perimanSetPinBus(): Pin 16 successfully set to type UART_TX (3) with bus 0x4080f0fc
[   152][V][esp32-hal-periman.c:160] perimanSetPinBus(): Pin 12 successfully set to type USB_DM (38) with bus 0x4081155c
[   163][V][esp32-hal-periman.c:160] perimanSetPinBus(): Pin 13 successfully set to type USB_DP (39) with bus 0x4081155c
=========== Before Setup Start ===========
Chip Info:
------------------------------------------
  Model             : ESP32-C6
  Package           : 1
  Revision          : 0.01
  Cores             : 1
  CPU Frequency     : 160 MHz
  XTAL Frequency    : 40 MHz
  Features Bitfield : 0x00000052
  Embedded Flash    : No
  Embedded PSRAM    : No
  2.4GHz WiFi       : Yes
  Classic BT        : No
  BT Low Energy     : Yes
  IEEE 802.15.4     : Yes
------------------------------------------
INTERNAL Memory Info:
------------------------------------------
  Total Size        :   445324 B ( 434.9 KB)
  Free Bytes        :   409124 B ( 399.5 KB)
  Allocated Bytes   :    29216 B (  28.5 KB)
  Minimum Free Bytes:   409124 B ( 399.5 KB)
  Largest Free Block:   376820 B ( 368.0 KB)
------------------------------------------
Flash Info:
------------------------------------------
  Chip Size         :  4194304 B (4 MB)
  Block Size        :    65536 B (  64.0 KB)
  Sector Size       :     4096 B (   4.0 KB)
  Page Size         :      256 B (   0.2 KB)
  Bus Speed         : 40 MHz
  Bus Mode          : QIO
------------------------------------------
Partitions Info:
------------------------------------------
                nvs : addr: 0x00009000, size:    20.0 KB, type: DATA, subtype: NVS
            otadata : addr: 0x0000E000, size:     8.0 KB, type: DATA, subtype: OTA
               app0 : addr: 0x00010000, size:  1280.0 KB, type:  APP, subtype: OTA_0
               app1 : addr: 0x00150000, size:  1280.0 KB, type:  APP, subtype: OTA_1
             spiffs : addr: 0x00290000, size:  1388.0 KB, type: DATA, subtype: SPIFFS
         zb_storage : addr: 0x003EB000, size:    16.0 KB, type: DATA, subtype: FAT
             zb_fct : addr: 0x003EF000, size:     4.0 KB, type: DATA, subtype: FAT
           coredump : addr: 0x003F0000, size:    64.0 KB, type: DATA, subtype: COREDUMP
------------------------------------------
Software Info:
------------------------------------------
  Compile Date/Time : Nov 16 2024 21:10:20
  Compile Host OS   : windows
  ESP-IDF Version   : v5.3.1-638-ga0f798cfc4-dirty
  Arduino Version   : 3.1.0
------------------------------------------
Board Info:
------------------------------------------
  Arduino Board     : ESP32C6_DEV
  Arduino Variant   : esp32c6
  Arduino FQBN      : esp32:esp32:esp32c6:UploadSpeed=921600,CDCOnBoot=cdc,CPUFreq=160,FlashFreq=80,FlashMode=qio,FlashSize=4M,PartitionScheme=zigbee,DebugLevel=verbose,EraseFlash=all,JTAGAdapter=default,ZigbeeMode=ed
============ Before Setup End ============
[   286][I][esp32-hal-periman.c:141] perimanSetPinBus(): Pin 12 already has type USB_DM (38) with bus 0x4081155c
[   287][I][esp32-hal-periman.c:141] perimanSetPinBus(): Pin 13 already has type USB_DP (39) with bus 0x4081155c
[   287][V][esp32-hal-periman.c:235] perimanSetBusDeinit(): Deinit function for type GPIO (1) successfully set to 0x4200348e
[   288][V][esp32-hal-periman.c:160] perimanSetPinBus(): Pin 9 successfully set to type GPIO (1) with bus 0xa
[   289][D][ZigbeeCore.cpp:66] addEndpoint(): Endpoint: 10, Device ID: 0x0302
[   289][D][ZigbeeCore.cpp:103] zigbeeInit(): Initialize Zigbee stack
[   337][D][ZigbeeCore.cpp:110] zigbeeInit(): Register all Zigbee EPs in list
[   339][I][ZigbeeCore.cpp:118] zigbeeInit(): List of registered Zigbee EPs:
[   339][I][ZigbeeCore.cpp:120] zigbeeInit(): Device type: Temperature Sensor, Endpoint: 10, Device ID: 0x0302
Zigbee stack assertion failed common/
abort() was called at PC 0x42012b5d on core 0
Core  0 register dump:
MEPC    : 0x40801588  RA      : 0x40807ffc  SP      : 0x40824490  GP      : 0x4080f824
TP      : 0x40824620  T0      : 0x37363534  T1      : 0x7271706f  T2      : 0x33323130
S0/FP   : 0x408244bc  S1      : 0x408244bc  A0      : 0x408244c8  A1      : 0x408244aa
A2      : 0x00000000  A3      : 0x408244f5  A4      : 0x00000001  A5      : 0x40816000
A6      : 0x00000000  A7      : 0x76757473  S2      : 0x00000000  S3      : 0x40813658
S4      : 0x00000002  S5      : 0x00000000  S6      : 0x00000000  S7      : 0x00000000
S8      : 0x00000000  S9      : 0x00000000  S10     : 0x00000000  S11     : 0x00000000
T3      : 0x6e6d6c6b  T4      : 0x6a696867  T5      : 0x66656463  T6      : 0x62613938
MSTATUS : 0x00001881  MTVEC   : 0x40800001  MCAUSE  : 0x00000007  MTVAL   : 0x00000000
MHARTID : 0x00000000

Stack memory:
40824490: 0x00000000 0x00000000 0x408244a8 0x4080dea6 0x00000000 0x00000000 0x00000030 0x40810e00
408244b0: 0x408244bc 0x40810e1c 0x408244a8 0x31303234 0x64356232 0x00000000 0x726f6261 0x20292874
408244d0: 0x20736177 0x6c6c6163 0x61206465 0x43502074 0x34783020 0x32313032 0x20643562 0x63206e6f
408244f0: 0x2065726f 0x00000030 0x00000000 0x7bf1811f 0x0000002f 0x40813a48 0x42075e69 0x42012b60
40824510: 0x0000cbb3 0x00000000 0x00000000 0x00000051 0x00000000 0x00000000 0x000000fe 0x420374f8
40824530: 0x00000000 0x40813a48 0x40824590 0x42013ed6 0x00000000 0x00000000 0x00000840 0x0001001f
40824550: 0x00000026 0x001f0040 0x00000000 0x00000000 0x00160003 0x00000002 0x00000000 0x00000000
40824570: 0x0000001f 0x00000010 0x40813a48 0x420159e6 0x00000000 0x00000000 0x00000000 0x00000000
40824590: 0x00000026 0x001f0040 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x4202bd84
408245b0: 0x00000000 0x00000000 0x00000000 0x4202c10e 0x00000000 0x00000000 0x00000000 0x42009084
408245d0: 0x00000000 0x00000000 0x00000000 0x4200090c 0x00000000 0x00000000 0x00000000 0x408092b8
408245f0: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
40824610: 0x00000000 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 0xbaad5678
40824630: 0x00057fd9 0x408169c4 0x408169c4 0x00000000 0x00000000 0x00000000 0xffffffff 0x7fefffff
40824650: 0x00000000 0x3fe00000 0x403d0000 0x00000000 0x00000000 0x3fc00000 0x00000000 0x40300000
40824670: 0x00000000 0x4004e20c 0x00000000 0x00000000 0x00000000 0x00000000 0xffffffff 0x40824b18
40824690: 0x00000000 0x3fe00000 0x00000000 0xa5a5a5a5 0x00000005 0x00000000 0x00000000 0x40300000
408246b0: 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 0x408246cc 0x00000000 0x00000000 0x42071778
408246d0: 0x00000002 0x4082476c 0x00000004 0x4082476b 0x00000005 0x00000000 0x00000002 0x00000000
408246f0: 0xa5a5a5a5 0xa5a5a5a5 0x4081999c 0xa5a5a5a5 0x4082470c 0x00000000 0x00000000 0x420701fc
40824710: 0x00000005 0x40819998 0x00000002 0x4004e20c 0x00000001 0x4081999a 0x00000002 0xa5a5a5a5
40824730: 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5
40824750: 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 0x31a5a5a5 0x30303932
40824770: 0xffffffff 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5
40824790: 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 0x31a5a5a5 0x35343332
408247b0: 0xffffffff 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5
408247d0: 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5
408247f0: 0x00003048 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 0x42071627 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5
40824810: 0x0000006d 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 0x42071704 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5
40824830: 0x00000b54 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 0x4207018c 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5
40824850: 0x0000002d 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 0x420701ac 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5
40824870: 0x00000000 0x403d0000 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5



ELF file SHA256: 5542d8f16

Other Steps to Reproduce

Removing from esp_zb_task(void *pvParameters) in ZigbeeCore.cpp the workaround device will join and report values after power off/on (without described delay device will reboot before stable work 2-3 times...) :

static void esp_zb_task(void *pvParameters) {
  /* initialize Zigbee stack */
  ESP_ERROR_CHECK(esp_zb_start(false));

  //NOTE: This is a workaround to make battery powered devices to be discovered as battery powered
  if (((zigbee_role_t)Zigbee.getRole() == ZIGBEE_END_DEVICE) && edBatteryPowered) {
   // zb_set_ed_node_descriptor(0, 0, 0);    <<<=====
  }

  esp_zb_stack_main_loop();
}

I have checked existing issues, online documentation and the Troubleshooting Guide

  • I confirm I have checked existing issues, online documentation and Troubleshooting guide.
@michapr michapr added the Status: Awaiting triage Issue is waiting for triage label Nov 17, 2024
@michapr michapr changed the title problem with battery powered devices after power off/on Zigbee: problem with battery powered devices after power off/on Nov 17, 2024
@P-R-O-C-H-Y
Copy link
Member

Hi @michapr, Thanks for the report. I will take a look and try to reproduce.

@P-R-O-C-H-Y P-R-O-C-H-Y added Status: Test needed Issue needs testing Status: In Progress Issue is in progress and removed Status: Awaiting triage Issue is waiting for triage labels Nov 18, 2024
@michapr
Copy link
Author

michapr commented Nov 18, 2024

Today have seen that my "solution" is not working stable - after some time reporting stop with error:
[6548110][V][ZigbeeCore.cpp:301] esp_zb_app_signal_handler(): ZDO signal: ZDO Device Unavailable (0x3c), status: ESP_OK

log looks like:

[6547533][V][Zigbee_Temperature_Sensor.ino:45] temp_sensor_value_update(): Temperature sensor value: 31.00°C
[6547534][V][ZigbeeTempSensor.cpp:68] setTemperature(): Updating temperature sensor value...
[6547534][D][ZigbeeTempSensor.cpp:70] setTemperature(): Setting temperature to 3100
[6547535][V][ZigbeeTempSensor.cpp:107] setHumidity(): Updating humidity sensor value...
[6547535][D][ZigbeeTempSensor.cpp:109] setHumidity(): Setting humidity to 3100
[6548110][V][ZigbeeCore.cpp:301] esp_zb_app_signal_handler(): ZDO signal: ZDO Device Unavailable (0x3c), status: ESP_OK
[6548535][V][Zigbee_Temperature_Sensor.ino:45] temp_sensor_value_update(): Temperature sensor value: 31.00°C
[6548536][V][ZigbeeTempSensor.cpp:68] setTemperature(): Updating temperature sensor value...
[6548536][D][ZigbeeTempSensor.cpp:70] setTemperature(): Setting temperature to 3100
[6548537][V][ZigbeeTempSensor.cpp:107] setHumidity(): Updating humidity sensor value...
[6548537][D][ZigbeeTempSensor.cpp:109] setHumidity(): Setting humidity to 3100
[6549537][V][Zigbee_Temperature_Sensor.ino:45] temp_sensor_value_update(): Temperature sensor value: 31.00°C

And - in the morning the device after power on (with changed code) was still rebooting again for some time - then was starting reporting.
So, is not stable...

Thanks for checking!

@P-R-O-C-H-Y
Copy link
Member

I was able to reproduce it with C6, however with ESP32-H2 there is no issue. Will continue in the investigation.

btw. the message esp_zb_app_signal_handler(): ZDO signal: ZDO Device Unavailable (0x3c), status: ESP_OK happened to me when I removed the device from the HomeAssistant but I did not reset the device to factory setting, so its still trying to send data to the network. I will also check that later :)

@P-R-O-C-H-Y
Copy link
Member

As the example with/without selecting power source works on H2, I assume there must be some error in the esp-zigbee-sdk for C6. It may take more time to fix. I will keep this issue updated when I get any news.

@P-R-O-C-H-Y P-R-O-C-H-Y added the Chip: ESP32-C6 Issue is related to support of ESP32-C6 Chip label Nov 18, 2024
@P-R-O-C-H-Y P-R-O-C-H-Y removed the Status: Test needed Issue needs testing label Nov 19, 2024
@P-R-O-C-H-Y
Copy link
Member

P-R-O-C-H-Y commented Nov 19, 2024

Hi @michapr, can you test please with the changes from this PR #10623 ?Thanks, it will help a lot :)

@michapr
Copy link
Author

michapr commented Nov 19, 2024

Have changed the lines in lib files - but no changes in original Temperature sample code (after power off / on - no reporting more)

=========== Before Setup Start ===========
Chip Info:
------------------------------------------
  Model             : ESP32-C6
  Package           : 1
  Revision          : 0.01
  Cores             : 1
  CPU Frequency     : 160 MHz
  XTAL Frequency    : 40 MHz
  Features Bitfield : 0x00000052
  Embedded Flash    : No
  Embedded PSRAM    : No
  2.4GHz WiFi       : Yes
  Classic BT        : No
  BT Low Energy     : Yes
  IEEE 802.15.4     : Yes
------------------------------------------
INTERNAL Memory Info:
------------------------------------------
  Total Size        :   445324 B ( 434.9 KB)
  Free Bytes        :   413968 B ( 404.3 KB)
  Allocated Bytes   :    24388 B (  23.8 KB)
  Minimum Free Bytes:   409156 B ( 399.6 KB)
  Largest Free Block:   376820 B ( 368.0 KB)
------------------------------------------
Flash Info:
------------------------------------------
  Chip Size         :  4194304 B (4 MB)
  Block Size        :    65536 B (  64.0 KB)
  Sector Size       :     4096 B (   4.0 KB)
  Page Size         :      256 B (   0.2 KB)
  Bus Speed         : 40 MHz
  Bus Mode          : QIO
------------------------------------------
Partitions Info:
------------------------------------------
                nvs : addr: 0x00009000, size:    20.0 KB, type: DATA, subtype: NVS
            otadata : addr: 0x0000E000, size:     8.0 KB, type: DATA, subtype: OTA
               app0 : addr: 0x00010000, size:  1280.0 KB, type:  APP, subtype: OTA_0
               app1 : addr: 0x00150000, size:  1280.0 KB, type:  APP, subtype: OTA_1
             spiffs : addr: 0x00290000, size:  1388.0 KB, type: DATA, subtype: SPIFFS
         zb_storage : addr: 0x003EB000, size:    16.0 KB, type: DATA, subtype: FAT
             zb_fct : addr: 0x003EF000, size:     4.0 KB, type: DATA, subtype: FAT
           coredump : addr: 0x003F0000, size:    64.0 KB, type: DATA, subtype: COREDUMP
------------------------------------------
Software Info:
------------------------------------------
  Compile Date/Time : Nov 19 2024 14:37:54
  Compile Host OS   : windows
  ESP-IDF Version   : v5.3.1-638-ga0f798cfc4-dirty
  Arduino Version   : 3.1.0
------------------------------------------
Board Info:
------------------------------------------
  Arduino Board     : ESP32C6_DEV
  Arduino Variant   : esp32c6
  Arduino FQBN      : esp32:esp32:esp32c6:UploadSpeed=921600,CDCOnBoot=cdc,CPUFreq=160,FlashFreq=80,FlashMode=qio,FlashSize=4M,PartitionScheme=zigbee,DebugLevel=verbose,EraseFlash=all,JTAGAdapter=default,ZigbeeMode=ed
============ Before Setup End ============
[   939][I][esp32-hal-periman.c:141] perimanSetPinBus(): Pin 12 already has type USB_DM (38) with bus 0x4081155c
[   940][I][esp32-hal-periman.c:141] perimanSetPinBus(): Pin 13 already has type USB_DP (39) with bus 0x4081155c
[   940][V][esp32-hal-periman.c:235] perimanSetBusDeinit(): Deinit function for type GPIO (1) successfully set to 0x42003216
[   941][V][esp32-hal-periman.c:160] perimanSetPinBus(): Pin 9 successfully set to type GPIO (1) with bus 0xa
[   942][D][ZigbeeCore.cpp:66] addEndpoint(): Endpoint: 10, Device ID: 0x0302
[   942][D][ZigbeeCore.cpp:103] zigbeeInit(): Initialize Zigbee stack
[   978][D][ZigbeeCore.cpp:110] zigbeeInit(): Register all Zigbee EPs in list
[   980][I][ZigbeeCore.cpp:118] zigbeeInit(): List of registered Zigbee EPs:
[   980][I][ZigbeeCore.cpp:120] zigbeeInit(): Device type: Temperature Sensor, Endpoint: 10, Device ID: 0x0302
[   986][V][Zigbee_Temperature_Sensor.ino:45] temp_sensor_value_update(): Temperature sensor value: 20.00°C
[   986][V][ZigbeeTempSensor.cpp:68] setTemperature(): Updating temperature sensor value...
[   987][D][ZigbeeTempSensor.cpp:70] setTemperature(): Setting temperature to 2000
[   988][V][ZigbeeCore.cpp:301] esp_zb_app_signal_handler(): ZDO signal: ZDO Config Ready (0x17), status: ESP_FAIL
[   989][I][ZigbeeCore.cpp:191] esp_zb_app_signal_handler(): Zigbee stack initialized
=========== After Setup Start ============
INTERNAL Memory Info:
------------------------------------------
  Total Size        :   445324 B ( 434.9 KB)
  Free Bytes        :   384372 B ( 375.4 KB)
  Allocated Bytes   :    53152 B (  51.9 KB)
  Minimum Free Bytes:   384336 B ( 375.3 KB)
  Largest Free Block:   352244 B ( 344.0 KB)
------------------------------------------
GPIO Info:
------------------------------------------
  GPIO : BUS_TYPE[bus/unit][chan]
  --------------------------------------
     9 : GPIO
    12 : USB_DM
    13 : USB_DP
    16 : UART_TX[0]
    17 : UART_RX[0]
============ After Setup End =============
[  1987][V][Zigbee_Temperature_Sensor.ino:45] temp_sensor_value_update(): Temperature sensor value: 22.00°C
[  1988][V][ZigbeeTempSensor.cpp:68] setTemperature(): Updating temperature sensor value...
[  1988][D][ZigbeeTempSensor.cpp:70] setTemperature(): Setting temperature to 2200
[  2988][V][Zigbee_Temperature_Sensor.ino:45] temp_sensor_value_update(): Temperature sensor value: 23.00°C
[  2989][V][ZigbeeTempSensor.cpp:68] setTemperature(): Updating temperature sensor value...
[  2989][D][ZigbeeTempSensor.cpp:70] setTemperature(): Setting temperature to 2300
[  3316][E][ZigbeeCore.cpp:219] esp_zb_app_signal_handler(): Failed to initialize Zigbee stack (status: ESP_FAIL)
[  3989][V][Zigbee_Temperature_Sensor.ino:45] temp_sensor_value_update(): Temperature sensor value: 24.00°C
[  3990][V][ZigbeeTempSensor.cpp:68] setTemperature(): Updating temperature sensor value...
[  3990][D][ZigbeeTempSensor.cpp:70] setTemperature(): Setting temperature to 2400
[  4990][V][Zigbee_Temperature_Sensor.ino:45] temp_sensor_value_update(): Temperature sensor value: 25.00°C
[  4991][V][ZigbeeTempSensor.cpp:68] setTemperature(): Updating temperature sensor value...
[  4991][D][ZigbeeTempSensor.cpp:70] setTemperature(): Setting temperature to 2500
[  5991][V][Zigbee_Temperature_Sensor.ino:45] temp_sensor_value_update(): Temperature sensor value: 25.00°C
[  5992][V][ZigbeeTempSensor.cpp:68] setTemperature(): Updating temperature sensor value...
[  5992][D][ZigbeeTempSensor.cpp:70] setTemperature(): Setting temperature to 2500
[  6992][V][Zigbee_Temperature_Sensor.ino:45] temp_sensor_value_update(): Temperature sensor value: 26.00°C
[  6993][V][ZigbeeTempSensor.cpp:68] setTemperature(): Updating temperature sensor value...
[  6993][D][ZigbeeTempSensor.cpp:70] setTemperature(): Setting temperature to 2600
[  7993][V][Zigbee_Temperature_Sensor.ino:45] temp_sensor_value_update(): Temperature sensor value: 26.00°C
[  7994][V][ZigbeeTempSensor.cpp:68] setTemperature(): Updating temperature sensor value...
[  7994][D][ZigbeeTempSensor.cpp:70] setTemperature(): Setting temperature to 2600
[  8994][V][Zigbee_Temperature_Sensor.ino:45] temp_sensor_value_update(): Temperature sensor value: 26.00°C
[  8995][V][ZigbeeTempSensor.cpp:68] setTemperature(): Updating temperature sensor value...
[  8995][D][ZigbeeTempSensor.cpp:70] setTemperature(): Setting temperature to 2600
[  9995][V][Zigbee_Temperature_Sensor.ino:45] temp_sensor_value_update(): Temperature sensor value: 27.00°C
[  9996][V][ZigbeeTempSensor.cpp:68] setTemperature(): Updating temperature sensor value...
[  9996][D][ZigbeeTempSensor.cpp:70] setTemperature(): Setting temperature to 2700
[ 10996][V][Zigbee_Temperature_Sensor.ino:45] temp_sensor_value_update(): Temperature sensor value: 27.00°C
[ 10997][V][ZigbeeTempSensor.cpp:68] setTemperature(): Updating temperature sensor value...
[ 10997][D][ZigbeeTempSensor.cpp:70] setTemperature(): Setting temperature to 2700
[ 11997][V][Zigbee_Temperature_Sensor.ino:45] temp_sensor_value_update(): Temperature sensor value: 27.00°C
[ 11998][V][ZigbeeTempSensor.cpp:68] setTemperature(): Updating temperature sensor value...
[ 11998][D][ZigbeeTempSensor.cpp:70] setTemperature(): Setting temperature to 2700
[ 12998][V][Zigbee_Temperature_Sensor.ino:45] temp_sensor_value_update(): Temperature sensor value: 28.00°C
[ 12999][V][ZigbeeTempSensor.cpp:68] setTemperature(): Updating temperature sensor value...

@P-R-O-C-H-Y
Copy link
Member

I assume you removed the device from your system and do a factory reset.

@michapr
Copy link
Author

michapr commented Nov 19, 2024

I removed, erased flash while programming, restarted Zigbee2MQTT (in database it is deleted, nothing more in memory) - so it should be new device...

@P-R-O-C-H-Y
Copy link
Member

Time to time that happens to me also, but lets say 1 out of 10 times.
For you its every single reboot?

@P-R-O-C-H-Y
Copy link
Member

P-R-O-C-H-Y commented Nov 19, 2024

Can you try to flash other ESP32C6/H2 with Thermostat example and try to connect to that one? To check if its related to the Zigbee2MQTT?

@P-R-O-C-H-Y
Copy link
Member

P-R-O-C-H-Y commented Nov 19, 2024

I have installed the Zigbee2MQTT add-on in my HomeAssistant.
Adding the device was fine, event I am getting message that device is not supported, due to manufacturer/name.
The temperature reporting is fine with the changes from the PR.
But After reboot the device is correctly started again. No crash reboots on my side.

@michapr
Copy link
Author

michapr commented Nov 19, 2024

Yes,... I have tried several times, the device is not reporting values more after power off/on...

I do not have a second ESP32C6 in this time, wanted to test at first how Zigbee is working with ESP32 ;)
All other work with ESP32 last time was with BLE and LoRaWAN devices ....

As far as I understood the thermostat sample is not an end device, but is waiting for any other temperature sensor device right?

In my Zigbee2MQTT installation are 14 other devices connected, sensors, plugs and thermostats (valves) - they do not have such problems, so I hope, that Z2M installation is not the problem.

As I wrote, the color_dimmable_light is working fine, even after power off/on.

Any other idea?

@P-R-O-C-H-Y
Copy link
Member

Does the board reboots after the stack fails to initialize? That's the behavior I added to reset the board after
[ 3316][E][ZigbeeCore.cpp:219] esp_zb_app_signal_handler(): Failed to initialize Zigbee stack (status: ESP_FAIL)

I am really not sure what is happening on your side, this is not happening to me. I will try to investigate more but its hard when I am not able to replicate it.

@P-R-O-C-H-Y
Copy link
Member

IF you can try to sniff the packets going between the coordinator and the ESP that can help.

@michapr
Copy link
Author

michapr commented Nov 19, 2024

No, board does not reboot in my case (with temperature sketch). It only does not report more values - looks like does not join again.

What I just have tried - I added again a dely between some lines:

  // Set tolerance for temperature measurement in °C (lowest possible value is 0.01°C)
  zbTempSensor.setTolerance(1);
 delay(500);
  // Add endpoint to Zigbee Core
  Zigbee.addEndpoint(&zbTempSensor);
delay(500);
  // When all EPs are registered, start Zigbee in End Device mode
  Zigbee.begin();
delay(500);
  // Start Temperature sensor reading task
  xTaskCreate(temp_sensor_value_update, "temp_sensor_update", 2048, NULL, 10, NULL);
delay(500);

Now it "can happen" that device is reporting value after power off/on.

If not reporting - I do not see any packets in Z2M debug log from the device.

@michapr
Copy link
Author

michapr commented Nov 19, 2024

looks like with this settings (delay) device is reporting after power off/on every time:

  // Set tolerance for temperature measurement in °C (lowest possible value is 0.01°C)
  zbTempSensor.setTolerance(1);
 delay(500);
  // Add endpoint to Zigbee Core
  Zigbee.addEndpoint(&zbTempSensor);
delay(500);
  // When all EPs are registered, start Zigbee in End Device mode
  Zigbee.begin();
delay(1000);
  // Start Temperature sensor reading task
  xTaskCreate(temp_sensor_value_update, "temp_sensor_update", 2048, NULL, 10, NULL);
delay(1000);

Not sure at what place it is right/needed - maybe you have an idea ;)

@P-R-O-C-H-Y
Copy link
Member

Can you just add a bigger delay after the Zigbee.begin() Add like 2000-5000 ms. The other delays are not relevant from my point of view.

@michapr
Copy link
Author

michapr commented Nov 19, 2024

add a bigger delay after the Zigbee.begin()

this did not help at all - up to 5000ms (removed other delays)

Maybe that reporting starts before the stack was initialized?
I hope I will find tomorrow time to make more experiments with delays...

@michapr
Copy link
Author

michapr commented Nov 21, 2024

ok,.... have two different debug logs - one for working, second for not working device.
Have used the previous delay settings (500/500/1000/1000)
Device was powered off/on in every case.

Difference is after the "After Setup End" section - maybe you know why there can be different result??

NOT WORKING:

=========== Before Setup Start ===========
Chip Info:
------------------------------------------
  Model             : ESP32-C6
  Package           : 1
  Revision          : 0.01
  Cores             : 1
  CPU Frequency     : 160 MHz
  XTAL Frequency    : 40 MHz
  Features Bitfield : 0x00000052
  Embedded Flash    : No
  Embedded PSRAM    : No
  2.4GHz WiFi       : Yes
  Classic BT        : No
  BT Low Energy     : Yes
  IEEE 802.15.4     : Yes
------------------------------------------
INTERNAL Memory Info:
------------------------------------------
  Total Size        :   445324 B ( 434.9 KB)
  Free Bytes        :   413824 B ( 404.1 KB)
  Allocated Bytes   :    24516 B (  23.9 KB)
  Minimum Free Bytes:   409012 B ( 399.4 KB)
  Largest Free Block:   376820 B ( 368.0 KB)
------------------------------------------
Flash Info:
------------------------------------------
  Chip Size         :  4194304 B (4 MB)
  Block Size        :    65536 B (  64.0 KB)
  Sector Size       :     4096 B (   4.0 KB)
  Page Size         :      256 B (   0.2 KB)
  Bus Speed         : 40 MHz
  Bus Mode          : QIO
------------------------------------------
Partitions Info:
------------------------------------------
                nvs : addr: 0x00009000, size:    20.0 KB, type: DATA, subtype: NVS
            otadata : addr: 0x0000E000, size:     8.0 KB, type: DATA, subtype: OTA
               app0 : addr: 0x00010000, size:  1280.0 KB, type:  APP, subtype: OTA_0
               app1 : addr: 0x00150000, size:  1280.0 KB, type:  APP, subtype: OTA_1
             spiffs : addr: 0x00290000, size:  1388.0 KB, type: DATA, subtype: SPIFFS
         zb_storage : addr: 0x003EB000, size:    16.0 KB, type: DATA, subtype: FAT
             zb_fct : addr: 0x003EF000, size:     4.0 KB, type: DATA, subtype: FAT
           coredump : addr: 0x003F0000, size:    64.0 KB, type: DATA, subtype: COREDUMP
------------------------------------------
Software Info:
------------------------------------------
  Compile Date/Time : Nov 19 2024 14:37:54
  Compile Host OS   : windows
  ESP-IDF Version   : v5.3.1-638-ga0f798cfc4-dirty
  Arduino Version   : 3.1.0
------------------------------------------
Board Info:
------------------------------------------
  Arduino Board     : ESP32C6_DEV
  Arduino Variant   : esp32c6
  Arduino FQBN      : esp32:esp32:esp32c6:UploadSpeed=921600,CDCOnBoot=cdc,CPUFreq=160,FlashFreq=80,FlashMode=qio,FlashSize=4M,PartitionScheme=zigbee,DebugLevel=verbose,EraseFlash=all,JTAGAdapter=default,ZigbeeMode=ed
============ Before Setup End ============
[  1339][I][esp32-hal-periman.c:141] perimanSetPinBus(): Pin 12 already has type USB_DM (38) with bus 0x4081155c
[  1340][I][esp32-hal-periman.c:141] perimanSetPinBus(): Pin 13 already has type USB_DP (39) with bus 0x4081155c
[  1340][V][esp32-hal-periman.c:235] perimanSetBusDeinit(): Deinit function for type GPIO (1) successfully set to 0x42003236
[  1341][V][esp32-hal-periman.c:160] perimanSetPinBus(): Pin 9 successfully set to type GPIO (1) with bus 0xa
[  1841][D][ZigbeeCore.cpp:66] addEndpoint(): Endpoint: 10, Device ID: 0x0302
[  2341][D][ZigbeeCore.cpp:103] zigbeeInit(): Initialize Zigbee stack
[  2388][D][ZigbeeCore.cpp:110] zigbeeInit(): Register all Zigbee EPs in list
[  2389][I][ZigbeeCore.cpp:118] zigbeeInit(): List of registered Zigbee EPs:
[  2389][I][ZigbeeCore.cpp:120] zigbeeInit(): Device type: Temperature Sensor, Endpoint: 10, Device ID: 0x0302
[  2397][V][ZigbeeCore.cpp:301] esp_zb_app_signal_handler(): ZDO signal: ZDO Config Ready (0x17), status: ESP_FAIL
[  2397][I][ZigbeeCore.cpp:191] esp_zb_app_signal_handler(): Zigbee stack initialized
[  3395][V][Zigbee_Temperature_Sensor_test.ino:45] temp_sensor_value_update(): Temperature sensor value: 19.00°C
[  3395][V][ZigbeeTempSensor.cpp:68] setTemperature(): Updating temperature sensor value...
[  3396][D][ZigbeeTempSensor.cpp:70] setTemperature(): Setting temperature to 1900
[  4396][V][Zigbee_Temperature_Sensor_test.ino:45] temp_sensor_value_update(): Temperature sensor value: 20.00°C
[  4397][V][ZigbeeTempSensor.cpp:68] setTemperature(): Updating temperature sensor value...
[  4397][D][ZigbeeTempSensor.cpp:70] setTemperature(): Setting temperature to 2000
=========== After Setup Start ============
INTERNAL Memory Info:
------------------------------------------
  Total Size        :   445324 B ( 434.9 KB)
  Free Bytes        :   384368 B ( 375.4 KB)
  Allocated Bytes   :    53156 B (  51.9 KB)
  Minimum Free Bytes:   384236 B ( 375.2 KB)
  Largest Free Block:   352244 B ( 344.0 KB)
------------------------------------------
GPIO Info:
------------------------------------------
  GPIO : BUS_TYPE[bus/unit][chan]
  --------------------------------------
     9 : GPIO
    12 : USB_DM
    13 : USB_DP
    16 : UART_TX[0]
    17 : UART_RX[0]
============ After Setup End =============
[  4724][E][ZigbeeCore.cpp:219] esp_zb_app_signal_handler(): Failed to initialize Zigbee stack (status: ESP_FAIL)
[  5397][V][Zigbee_Temperature_Sensor_test.ino:45] temp_sensor_value_update(): Temperature sensor value: 21.00°C
[  5398][V][ZigbeeTempSensor.cpp:68] setTemperature(): Updating temperature sensor value...
[  5398][D][ZigbeeTempSensor.cpp:70] setTemperature(): Setting temperature to 2100
[  6398][V][Zigbee_Temperature_Sensor_test.ino:45] temp_sensor_value_update(): Temperature sensor value: 22.00°C
[  6399][V][ZigbeeTempSensor.cpp:68] setTemperature(): Updating temperature sensor value...
[  6399][D][ZigbeeTempSensor.cpp:70] setTemperature(): Setting temperature to 2200
[  7399][V][Zigbee_Temperature_Sensor_test.ino:45] temp_sensor_value_update(): Temperature sensor value: 22.00°C
[  7400][V][ZigbeeTempSensor.cpp:68] setTemperature(): Updating temperature sensor value...
[  7400][D][ZigbeeTempSensor.cpp:70] setTemperature(): Setting temperature to 2200
[  8400][V][Zigbee_Temperature_Sensor_test.ino:45] temp_sensor_value_update(): Temperature sensor value: 22.00°C
[  8401][V][ZigbeeTempSensor.cpp:68] setTemperature(): Updating temperature sensor value...
[  8401][D][ZigbeeTempSensor.cpp:70] setTemperature(): Setting temperature to 2200
[  9401][V][Zigbee_Temperature_Sensor_test.ino:45] temp_sensor_value_update(): Temperature sensor value: 23.00°C

WORKING:

=========== Before Setup Start ===========
Chip Info:
------------------------------------------
  Model             : ESP32-C6
  Package           : 1
  Revision          : 0.01
  Cores             : 1
  CPU Frequency     : 160 MHz
  XTAL Frequency    : 40 MHz
  Features Bitfield : 0x00000052
  Embedded Flash    : No
  Embedded PSRAM    : No
  2.4GHz WiFi       : Yes
  Classic BT        : No
  BT Low Energy     : Yes
  IEEE 802.15.4     : Yes
------------------------------------------
INTERNAL Memory Info:
------------------------------------------
  Total Size        :   445324 B ( 434.9 KB)
  Free Bytes        :   413968 B ( 404.3 KB)
  Allocated Bytes   :    24388 B (  23.8 KB)
  Minimum Free Bytes:   409156 B ( 399.6 KB)
  Largest Free Block:   376820 B ( 368.0 KB)
------------------------------------------
Flash Info:
------------------------------------------
  Chip Size         :  4194304 B (4 MB)
  Block Size        :    65536 B (  64.0 KB)
  Sector Size       :     4096 B (   4.0 KB)
  Page Size         :      256 B (   0.2 KB)
  Bus Speed         : 40 MHz
  Bus Mode          : QIO
------------------------------------------
Partitions Info:
------------------------------------------
                nvs : addr: 0x00009000, size:    20.0 KB, type: DATA, subtype: NVS
            otadata : addr: 0x0000E000, size:     8.0 KB, type: DATA, subtype: OTA
               app0 : addr: 0x00010000, size:  1280.0 KB, type:  APP, subtype: OTA_0
               app1 : addr: 0x00150000, size:  1280.0 KB, type:  APP, subtype: OTA_1
             spiffs : addr: 0x00290000, size:  1388.0 KB, type: DATA, subtype: SPIFFS
         zb_storage : addr: 0x003EB000, size:    16.0 KB, type: DATA, subtype: FAT
             zb_fct : addr: 0x003EF000, size:     4.0 KB, type: DATA, subtype: FAT
           coredump : addr: 0x003F0000, size:    64.0 KB, type: DATA, subtype: COREDUMP
------------------------------------------
Software Info:
------------------------------------------
  Compile Date/Time : Nov 19 2024 14:37:54
  Compile Host OS   : windows
  ESP-IDF Version   : v5.3.1-638-ga0f798cfc4-dirty
  Arduino Version   : 3.1.0
------------------------------------------
Board Info:
------------------------------------------
  Arduino Board     : ESP32C6_DEV
  Arduino Variant   : esp32c6
  Arduino FQBN      : esp32:esp32:esp32c6:UploadSpeed=921600,CDCOnBoot=cdc,CPUFreq=160,FlashFreq=80,FlashMode=qio,FlashSize=4M,PartitionScheme=zigbee,DebugLevel=verbose,EraseFlash=all,JTAGAdapter=default,ZigbeeMode=ed
============ Before Setup End ============
[  1839][I][esp32-hal-periman.c:141] perimanSetPinBus(): Pin 12 already has type USB_DM (38) with bus 0x4081155c
[  1840][I][esp32-hal-periman.c:141] perimanSetPinBus(): Pin 13 already has type USB_DP (39) with bus 0x4081155c
[  1840][V][esp32-hal-periman.c:235] perimanSetBusDeinit(): Deinit function for type GPIO (1) successfully set to 0x42003236
[  1841][V][esp32-hal-periman.c:160] perimanSetPinBus(): Pin 9 successfully set to type GPIO (1) with bus 0xa
[  2341][D][ZigbeeCore.cpp:66] addEndpoint(): Endpoint: 10, Device ID: 0x0302
[  2841][D][ZigbeeCore.cpp:103] zigbeeInit(): Initialize Zigbee stack
[  2877][D][ZigbeeCore.cpp:110] zigbeeInit(): Register all Zigbee EPs in list
[  2878][I][ZigbeeCore.cpp:118] zigbeeInit(): List of registered Zigbee EPs:
[  2879][I][ZigbeeCore.cpp:120] zigbeeInit(): Device type: Temperature Sensor, Endpoint: 10, Device ID: 0x0302
[  2887][V][ZigbeeCore.cpp:301] esp_zb_app_signal_handler(): ZDO signal: ZDO Config Ready (0x17), status: ESP_FAIL
[  2887][I][ZigbeeCore.cpp:191] esp_zb_app_signal_handler(): Zigbee stack initialized
[  3885][V][Zigbee_Temperature_Sensor_test.ino:45] temp_sensor_value_update(): Temperature sensor value: 24.00°C
[  3885][V][ZigbeeTempSensor.cpp:68] setTemperature(): Updating temperature sensor value...
[  3886][D][ZigbeeTempSensor.cpp:70] setTemperature(): Setting temperature to 2400
[  4886][V][Zigbee_Temperature_Sensor_test.ino:45] temp_sensor_value_update(): Temperature sensor value: 25.00°C
[  4887][V][ZigbeeTempSensor.cpp:68] setTemperature(): Updating temperature sensor value...
[  4887][D][ZigbeeTempSensor.cpp:70] setTemperature(): Setting temperature to 2500
=========== After Setup Start ============
INTERNAL Memory Info:
------------------------------------------
  Total Size        :   445324 B ( 434.9 KB)
  Free Bytes        :   384368 B ( 375.4 KB)
  Allocated Bytes   :    53156 B (  51.9 KB)
  Minimum Free Bytes:   384236 B ( 375.2 KB)
  Largest Free Block:   352244 B ( 344.0 KB)
------------------------------------------
GPIO Info:
------------------------------------------
  GPIO : BUS_TYPE[bus/unit][chan]
  --------------------------------------
     9 : GPIO
    12 : USB_DM
    13 : USB_DP
    16 : UART_TX[0]
    17 : UART_RX[0]
============ After Setup End =============
[  5250][I][ZigbeeCore.cpp:197] esp_zb_app_signal_handler(): Device started up in non factory-reset mode
[  5250][I][ZigbeeCore.cpp:210] esp_zb_app_signal_handler(): Device rebooted
[  5887][V][Zigbee_Temperature_Sensor_test.ino:45] temp_sensor_value_update(): Temperature sensor value: 25.00°C
[  5888][V][ZigbeeTempSensor.cpp:68] setTemperature(): Updating temperature sensor value...
[  5888][D][ZigbeeTempSensor.cpp:70] setTemperature(): Setting temperature to 2500
[  5972][V][ZigbeeHandlers.cpp:134] zb_cmd_default_resp_handler(): Received default response: from address(0x0), src_endpoint(1) to dst_endpoint(10), cluster(0x402) with status 0x0
[  6888][V][Zigbee_Temperature_Sensor_test.ino:45] temp_sensor_value_update(): Temperature sensor value: 26.00°C
[  6889][V][ZigbeeTempSensor.cpp:68] setTemperature(): Updating temperature sensor value...
[  6889][D][ZigbeeTempSensor.cpp:70] setTemperature(): Setting temperature to 2600
[  7000][V][ZigbeeHandlers.cpp:134] zb_cmd_default_resp_handler(): Received default response: from address(0x0), src_endpoint(1) to dst_endpoint(10), cluster(0x402) with status 0x0
[  7889][V][Zigbee_Temperature_Sensor_test.ino:45] temp_sensor_value_update(): Temperature sensor value: 26.00°C
[  7890][V][ZigbeeTempSensor.cpp:68] setTemperature(): Updating temperature sensor value...
[  7890][D][ZigbeeTempSensor.cpp:70] setTemperature(): Setting temperature to 2600
[  8890][V][Zigbee_Temperature_Sensor_test.ino:45] temp_sensor_value_update(): Temperature sensor value: 26.00°C
[  8891][V][ZigbeeTempSensor.cpp:68] setTemperature(): Updating temperature sensor value...
[  8891][D][ZigbeeTempSensor.cpp:70] setTemperature(): Setting temperature to 2600
[  9891][V][Zigbee_Temperature_Sensor_test.ino:45] temp_sensor_value_update(): Temperature sensor value: 27.00°C
[  9892][V][ZigbeeTempSensor.cpp:68] setTemperature(): Updating temperature sensor value...
[  9892][D][ZigbeeTempSensor.cpp:70] setTemperature(): Setting temperature to 2700
[  9958][V][ZigbeeHandlers.cpp:134] zb_cmd_default_resp_handler(): Received default response: from address(0x0), src_endpoint(1) to dst_endpoint(10), cluster(0x402) with status 0x0
[ 10892][V][Zigbee_Temperature_Sensor_test.ino:45] temp_sensor_value_update(): Temperature sensor value: 27.00°C
[ 10893][V][ZigbeeTempSensor.cpp:68] setTemperature(): Updating temperature sensor value...

@P-R-O-C-H-Y
Copy link
Member

P-R-O-C-H-Y commented Nov 21, 2024

Hi @michapr, yeah there is nothing more to see then the failure of the Zigbee stack:
[ 4724][E][ZigbeeCore.cpp:219] esp_zb_app_signal_handler(): Failed to initialize Zigbee stack (status: ESP_FAIL)

I am sometimes getting this error too, so that's why I added a reboot if this initialization fails.
I can't tell why it's sometimes happening. I get this like 1/10 reboots, and I am not using any delays.

I will try to discuss it with a colleague working the Zigbee stack.

@ggtimtom
Copy link

ggtimtom commented Nov 27, 2024

This example works. Attached the log from z2m:

info 2024-11-27 18:39:30zh:controller: Interview for '0x744dbdfffe60934d' started
info 2024-11-27 18:39:30z2m: Device '0x744dbdfffe60934d' joined
info 2024-11-27 18:39:31z2m: Starting interview of '0x744dbdfffe60934d'
info 2024-11-27 18:39:32z2m:mqtt: MQTT publish: topic 'zigbee2mqtt/bridge/event', payload '{"data":{"friendly_name":"0x744dbdfffe60934d","ieee_address":"0x744dbdfffe60934d"},"type":"device_joined"}'
info 2024-11-27 18:39:32z2m:mqtt: MQTT publish: topic 'zigbee2mqtt/bridge/event', payload '{"data":{"friendly_name":"0x744dbdfffe60934d","ieee_address":"0x744dbdfffe60934d","status":"started"},"type":"device_interview"}'
info 2024-11-27 18:39:32z2m:mqtt: MQTT publish: topic 'zigbee2mqtt/bridge/event', payload '{"data":{"friendly_name":"0x744dbdfffe60934d","ieee_address":"0x744dbdfffe60934d"},"type":"device_announce"}'
info 2024-11-27 18:39:32zh:controller: Succesfully interviewed '0x744dbdfffe60934d'
info 2024-11-27 18:39:32z2m: Successfully interviewed '0x744dbdfffe60934d', device has successfully been paired
info 2024-11-27 18:39:32z2m: Device '0x744dbdfffe60934d' is supported, identified as: Espressif Automatically generated definition (SleepyZigbeeTempSensorTest)
info 2024-11-27 18:39:33z2m: Configuring '0x744dbdfffe60934d'
info 2024-11-27 18:39:33z2m:mqtt: MQTT publish: topic 'zigbee2mqtt/bridge/event', payload '{"data":{"definition":{"description":"Automatically generated definition","exposes":[{"access":5,"description":"Measured temperature value","label":"Temperature","name":"temperature","property":"temperature","type":"numeric","unit":"°C"},{"access":5,"category":"diagnostic","description":"Remaining battery in %","label":"Battery","name":"battery","property":"battery","type":"numeric","unit":"%","value_max":100,"value_min":0},{"access":5,"description":"Measured relative humidity","label":"Humidity","name":"humidity","property":"humidity","type":"numeric","unit":"%"},{"access":1,"category":"diagnostic","description":"Link quality (signal strength)","label":"Linkquality","name":"linkquality","property":"linkquality","type":"numeric","unit":"lqi","value_max":255,"value_min":0}],"model":"SleepyZigbeeTempSensorTest","options":[{"access":2,"description":"Calibrates the temperature value (absolute offset), takes into effect on next report of device.","label":"Temperature calibration","name":"temperature_calibration","property":"temperature_calibration","type":"numeric"},{"access":2,"description":"Number of digits after decimal point for temperature, takes into effect on next report of device. This option can only decrease the precision, not increase it.","label":"Temperature precision","name":"temperature_precision","property":"temperature_precision","type":"numeric","value_max":3,"value_min":0},{"access":2,"description":"Calibrates the humidity value (absolute offset), takes into effect on next report of device.","label":"Humidity calibration","name":"humidity_calibration","property":"humidity_calibration","type":"numeric"},{"access":2,"description":"Number of digits after decimal point for humidity, takes into effect on next report of device. This option can only decrease the precision, not increase it.","label":"Humidity precision","name":"humidity_precision","property":"humidity_precision","type":"numeric","value_max":3,"value_min":0}],"supports_ota":false,"vendor":"Espressif"},"friendly_name":"0x744dbdfffe60934d","ieee_address":"0x744dbdfffe60934d","status":"successful","supported":true},"type":"device_interview"}'
info 2024-11-27 18:39:33z2m:mqtt: MQTT publish: topic 'zigbee2mqtt/0x744dbdfffe60934d', payload '{"linkquality":147,"temperature":25}'
error 2024-11-27 18:39:33z2m: Failed to configure '0x744dbdfffe60934d', attempt 1 (Error: Device 0x744dbdfffe60934d has no input cluster genPowerCfg at getEndpointsWithCluster (/opt/zigbee2mqtt/node_modules/zigbee-herdsman-converters/src/lib/modernExtend.ts:62:15) at setupAttributes (/opt/zigbee2mqtt/node_modules/zigbee-herdsman-converters/src/lib/modernExtend.ts:103:55) at configure (/opt/zigbee2mqtt/node_modules/zigbee-herdsman-converters/src/lib/modernExtend.ts:157:23) at Object.configure (/opt/zigbee2mqtt/node_modules/zigbee-herdsman-converters/src/index.ts:205:27) at Configure.configure (/opt/zigbee2mqtt/lib/extension/configure.ts:130:13) at EventEmitter.wrappedCallback (/opt/zigbee2mqtt/lib/eventBus.ts:206:17))
info 2024-11-27 18:39:43z2m: Configuring '0x744dbdfffe60934d'
info 2024-11-27 18:39:43z2m:mqtt: MQTT publish: topic 'zigbee2mqtt/0x744dbdfffe60934d', payload '{"linkquality":144,"temperature":25}'
error 2024-11-27 18:39:43z2m: Failed to configure '0x744dbdfffe60934d', attempt 2 (Error: Device 0x744dbdfffe60934d has no input cluster genPowerCfg at getEndpointsWithCluster (/opt/zigbee2mqtt/node_modules/zigbee-herdsman-converters/src/lib/modernExtend.ts:62:15) at setupAttributes (/opt/zigbee2mqtt/node_modules/zigbee-herdsman-converters/src/lib/modernExtend.ts:103:55) at configure (/opt/zigbee2mqtt/node_modules/zigbee-herdsman-converters/src/lib/modernExtend.ts:157:23) at Object.configure (/opt/zigbee2mqtt/node_modules/zigbee-herdsman-converters/src/index.ts:205:27) at Configure.configure (/opt/zigbee2mqtt/lib/extension/configure.ts:130:13) at EventEmitter.wrappedCallback (/opt/zigbee2mqtt/lib/eventBus.ts:206:17))
info 2024-11-27 18:39:53z2m: Configuring '0x744dbdfffe60934d'
info 2024-11-27 18:39:53z2m:mqtt: MQTT publish: topic 'zigbee2mqtt/0x744dbdfffe60934d', payload '{"linkquality":147,"temperature":25}'
error 2024-11-27 18:39:53z2m: Failed to configure '0x744dbdfffe60934d', attempt 3 (Error: Device 0x744dbdfffe60934d has no input cluster genPowerCfg at getEndpointsWithCluster (/opt/zigbee2mqtt/node_modules/zigbee-herdsman-converters/src/lib/modernExtend.ts:62:15) at setupAttributes (/opt/zigbee2mqtt/node_modules/zigbee-herdsman-converters/src/lib/modernExtend.ts:103:55) at configure (/opt/zigbee2mqtt/node_modules/zigbee-herdsman-converters/src/lib/modernExtend.ts:157:23) at Object.configure (/opt/zigbee2mqtt/node_modules/zigbee-herdsman-converters/src/index.ts:205:27) at Configure.configure (/opt/zigbee2mqtt/lib/extension/configure.ts:130:13) at EventEmitter.wrappedCallback (/opt/zigbee2mqtt/lib/eventBus.ts:206:17))
info 2024-11-27 18:40:03z2m:mqtt: MQTT publish: topic 'zigbee2mqtt/0x744dbdfffe60934d', payload '{"linkquality":144,"temperature":25}'
info 2024-11-27 18:41:20z2m:mqtt: MQTT publish: topic 'zigbee2mqtt/bridge/event', payload '{"data":{"friendly_name":"0x744dbdfffe60934d","ieee_address":"0x744dbdfffe60934d"},"type":"device_announce"}'
info 2024-11-27 18:41:31z2m:mqtt: MQTT publish: topic 'zigbee2mqtt/0x744dbdfffe60934d', payload '{"linkquality":141,"temperature":38}'
info 2024-11-27 18:41:32z2m:mqtt: MQTT publish: topic 'zigbee2mqtt/0x744dbdfffe60934d', payload '{"linkquality":141,"temperature":29}'
info 2024-11-27 18:41:35z2m:mqtt: MQTT publish: topic 'zigbee2mqtt/0x744dbdfffe60934d', payload '{"linkquality":141,"temperature":15}'
info 2024-11-27 18:41:36z2m:mqtt: MQTT publish: topic 'zigbee2mqtt/0x744dbdfffe60934d', payload '{"linkquality":141,"temperature":20}'
info 2024-11-27 18:41:37z2m:mqtt: MQTT publish: topic 'zigbee2mqtt/0x744dbdfffe60934d', payload '{"linkquality":138,"temperature":23}'
info 2024-11-27 18:41:39z2m:mqtt: MQTT publish: topic 'zigbee2mqtt/0x744dbdfffe60934d', payload '{"linkquality":141,"temperature":38}'
info 2024-11-27 18:42:23z2m:mqtt: MQTT publish: topic 'zigbee2mqtt/bridge/event', payload '{"data":{"friendly_name":"0x744dbdfffe60934d","ieee_address":"0x744dbdfffe60934d"},"type":"device_announce"}'

@ggtimtom
Copy link

ggtimtom commented Nov 27, 2024

On the Arduino IDE after starting the board there were some (6) errors with ESp_FAIL but it sends data to Z2M. At the moment no more errors. Even when i move away from the dongle.

[ 64184][V][ZigbeeTempSensor.cpp:68] setTemperature(): Updating temperature sensor value...
[ 64193][D][ZigbeeTempSensor.cpp:70] setTemperature(): Setting temperature to 2500
[ 64567][I][ZigbeeCore.cpp:257] esp_zb_app_signal_handler(): Network steering was not successful (status: ESP_FAIL)
[ 65200][V][Zigbee_Temperature_Sensor.ino:45] temp_sensor_value_update(): Temperature sensor value: 25.00°C
[ 65210][V][ZigbeeTempSensor.cpp:68] setTemperature(): Updating temperature sensor value...
[ 65219][D][ZigbeeTempSensor.cpp:70] setTemperature(): Setting temperature to 2500
[ 66226][V][Zigbee_Temperature_Sensor.ino:45] temp_sensor_value_update(): Temperature sensor value: 25.00°C
[ 66236][V][ZigbeeTempSensor.cpp:68] setTemperature(): Updating temperature sensor value...

@ggtimtom
Copy link

ggtimtom commented Nov 27, 2024

now sometimes:

 [ZigbeeTempSensor.cpp:70] setTemperature(): Setting temperature to 6400
 [ 56772][V][ZigbeeHandlers.cpp:134] zb_cmd_default_resp_handler(): Received default response: from address(0x0), src_endpoint(1) to dst_endpoint(10), cluster(0x402) with status 0x0
 [ 56990][V][Zigbee_Temperature_Sensor.ino:45] temp_sensor_value_update(): Temperature sensor value: 13.00°C
 [ 57000][V][ZigbeeTempSensor.cpp:68] setTemperature(): Updating temperature sensor value...
 [ 57008][D][ZigbeeTempSensor.cpp:70] setTemperature(): Setting temperature to 1300
 [ 58015][V][Zigbee_Temperature_Sensor.ino:45] temp_sensor_value_update(): Temperature sensor value: 60.00°C
> [ 58025][V][ZigbeeTempSensor.cpp:68] setTemperature(): Updating temperature sensor value...
 [ 58033][D][ZigbeeTempSensor.cpp:70] setTemperature(): Setting temperature to 6000

@ggtimtom
Copy link

I am no expert in this, but is it helpful to have a ti zigbee packet sniffer?

image

@Nawor3565
Copy link

@P-R-O-C-H-Y I was testing the new Seeed Studio C6 module and found something interesting. The Zigbee_Temperature_Sensor example script seems to work fine, and if I power off the module it can reconnect with no issues. The sleepy temp sensor example still doesn't work though. I'm not sure what the two scripts are doing differently, but maybe that can help your investigation.

@michapr
Copy link
Author

michapr commented Nov 28, 2024

@Nawor3565 - have you modified something in library? Like esp_zb_secur_network_min_join_lqi_set(0); ?
What software version you are using?

And, have you tried multiple off/on - also with longer off time? Never any reboot at first?

And - can you try to run it multiple hours? Will it stop to report in your setup after longer time?

@P-R-O-C-H-Y
Copy link
Member

@P-R-O-C-H-Y I was testing the new Seeed Studio C6 module and found something interesting. The Zigbee_Temperature_Sensor example script seems to work fine, and if I power off the module it can reconnect with no issues. The sleepy temp sensor example still doesn't work though. I'm not sure what the two scripts are doing differently, but maybe that can help your investigation.

@Nawor3565 Thank you for the test. Can you post a log from the Sleepy temp sensor example? Also use the Zigbee mode: End Device - Debug to have all the logs available :)

@Nawor3565
Copy link

@michapr I just tried using a fresh download of the RC-3.1.X branch with no changes to the library files. Haven't done any long term testing yet but will do that today.

@P-R-O-C-H-Y Here's the log. I also put the slightly modified Temperature Sensor example script below, I copy/pasted some stuff to enable deep sleep. It probably isn't the "right" way to add deep sleep support, but it appears to be working with my setup for now. The first few reconnects were unsuccessful, but then it started working reliably as far as I can tell:

Going to sleep now
=========== Before Setup Start ===========
Chip Info:
------------------------------------------
  Model             : ESP32-C6
  Package           : 1
  Revision          : 0.01
  Cores             : 1
  CPU Frequency     : 160 MHz
  XTAL Frequency    : 40 MHz
  Features Bitfield : 0x00000052
  Embedded Flash    : No
  Embedded PSRAM    : No
  2.4GHz WiFi       : Yes
  Classic BT        : No
  BT Low Energy     : Yes
  IEEE 802.15.4     : Yes
------------------------------------------
INTERNAL Memory Info:
------------------------------------------
  Total Size        :   444212 B ( 433.8 KB)
  Free Bytes        :   412748 B ( 403.1 KB)
  Allocated Bytes   :    24480 B (  23.9 KB)
  Minimum Free Bytes:   407936 B ( 398.4 KB)
  Largest Free Block:   376820 B ( 368.0 KB)
------------------------------------------
Flash Info:
------------------------------------------
  Chip Size         :  4194304 B (4 MB)
  Block Size        :    65536 B (  64.0 KB)
  Sector Size       :     4096 B (   4.0 KB)
  Page Size         :      256 B (   0.2 KB)
  Bus Speed         : 40 MHz
  Bus Mode          : QIO
------------------------------------------
Partitions Info:
------------------------------------------
                nvs : addr: 0x00009000, size:    20.0 KB, type: DATA, subtype: NVS
            otadata : addr: 0x0000E000, size:     8.0 KB, type: DATA, subtype: OTA
               app0 : addr: 0x00010000, size:  1280.0 KB, type:  APP, subtype: OTA_0
               app1 : addr: 0x00150000, size:  1280.0 KB, type:  APP, subtype: OTA_1
             spiffs : addr: 0x00290000, size:  1388.0 KB, type: DATA, subtype: SPIFFS
         zb_storage : addr: 0x003EB000, size:    16.0 KB, type: DATA, subtype: FAT
             zb_fct : addr: 0x003EF000, size:     4.0 KB, type: DATA, subtype: FAT
           coredump : addr: 0x003F0000, size:    64.0 KB, type: DATA, subtype: COREDUMP
------------------------------------------
Software Info:
------------------------------------------
  Compile Date/Time : Nov 28 2024 13:47:09
  Compile Host OS   : windows
  ESP-IDF Version   : v5.3.1-638-ga0f798cfc4-dirty
  Arduino Version   : 3.1.0
------------------------------------------
Board Info:
------------------------------------------
  Arduino Board     : XIAO_ESP32C6
  Arduino Variant   : XIAO_ESP32C6
  Arduino FQBN      : esp32:esp32:XIAO_ESP32C6:UploadSpeed=921600,CDCOnBoot=cdc,CPUFreq=160,FlashFreq=80,FlashMode=qio,FlashSize=4M,PartitionScheme=zigbee,DebugLevel=verbose,EraseFlash=all,JTAGAdapter=default,ZigbeeMode=ed_debug
============ Before Setup End ============
[   994][I][esp32-hal-periman.c:141] perimanSetPinBus(): Pin 12 already has type USB_DM (38) with bus 0x40811920
[   995][I][esp32-hal-periman.c:141] perimanSetPinBus(): Pin 13 already has type USB_DP (39) with bus 0x40811920
[   995][V][esp32-hal-periman.c:235] perimanSetBusDeinit(): Deinit function for type GPIO (1) successfully set to 0x420034a4
[   996][V][esp32-hal-periman.c:160] perimanSetPinBus(): Pin 9 successfully set to type GPIO (1) with bus 0xa
ZBOSS: zcl/zcl_common.c:215   >> zb_zcl_get_attribute_size: attr_type 0x42 attr_value 0x40819cb4
ZBOSS: zcl/zcl_common.c:348   << zb_zcl_get_attribute_size: result 10
ZBOSS: zcl/zcl_common.c:215   >> zb_zcl_get_attribute_size: attr_type 0x42 attr_value 0x40819cd0
ZBOSS: zcl/zcl_common.c:348   << zb_zcl_get_attribute_size: result 17
ZBOSS: zcl/zcl_common.c:215   >> zb_zcl_get_attribute_size: attr_type 0x29 attr_value 0x4081e7bc
ZBOSS: zcl/zcl_common.c:348   << zb_zcl_get_attribute_size: result 2
ZBOSS: zcl/zcl_common.c:215   >> zb_zcl_get_attribute_size: attr_type 0x29 attr_value 0x4081e7be
ZBOSS: zcl/zcl_common.c:348   << zb_zcl_get_attribute_size: result 2
ZBOSS: zcl/zcl_common.c:215   >> zb_zcl_get_attribute_size: attr_type 0x21 attr_value 0x4081e7be
ZBOSS: zcl/zcl_common.c:348   << zb_zcl_get_attribute_size: result 2
[  1100][D][ZigbeeCore.cpp:83] addEndpoint(): Endpoint: 10, Device ID: 0x0302
Starting Zigbee...
[  1100][D][ZigbeeCore.cpp:122] zigbeeInit(): Initialize Zigbee stack
ZBOSS: common/zb_init_default.c:181   ED build
ZBOSS: common/zb_init_default.c:187   sizes: g_zb 7576 sched 224 bpool 16 nwk 912 aps 3040 addr 284 zdo 840
ZBOSS: common/zb_init_default.c:196   sec 2
ZBOSS: common/zb_init_default.c:198   zcl 768
ZBOSS: common/zb_init_default.c:201   zll 960
ZBOSS: common/zb_init_default.c:207   nvram 140
ZBOSS: common/zb_init_default.c:210   buttons 200
ZBOSS: common/zb_init_default.c:212   err_ind 4
ZBOSS: common/zb_init_default.c:218   scheduler q size 80
ZBOSS: common/zb_init_default.c:221   g_mac 816 g_imac 28
ZBOSS: common/zb_init_default.c:225   Configurable mem build, use ZBOSS lib defaults = 0
ZBOSS: common/zb_init_default.c:231   ZB_IOBUF_POOL_SIZE 80 ZB_NWK_IN_Q_SIZE 40 ZB_MAC_PENDING_QUEUE_SIZE 20 ZB_APS_DST_BINDING_TABLE_SIZE 16 ZB_APS_BIND_TRANS_TABLE_SIZE 20 ZB_N_APS_RETRANS_ENTRIES 27
ZBOSS: common/zb_init_default.c:261   ZB_N_APS_KEY_PAIR_ARR_MAX_SIZE 8 ZB_IEEE_ADDR_TABLE_SIZE 64 ZB_NEIGHBOR_TABLE_SIZE 64 ZB_NWK_ROUTING_TABLE_SIZE 0 ZB_APS_DUPS_TABLE_SIZE 32
[  1121][D][ZigbeeCore.cpp:129] zigbeeInit(): Register all Zigbee EPs in list
ZBOSS: zdo/af_descriptor.c:357   ep_count 1
[  1123][I][ZigbeeCore.cpp:137] zigbeeInit(): List of registered Zigbee EPs:
[  1123][I][ZigbeeCore.cpp:139] zigbeeInit(): Device type: Temperature Sensor, Endpoint: 10, Device ID: 0x0302
ZBOSS: common/zb_nvram.c:3190   ds_ver == 2
ZBOSS: zdo/zdo_app_prod_conf.c:144   no production config block found
ZBOSS: zdo/zdo_app_prod_conf.c:781   no valid production configuration found, signaling to application
[  1137][V][ZigbeeCore.cpp:332] esp_zb_app_signal_handler(): ZDO signal: ZDO Config Ready (0x17), status: ESP_FAIL
[  1138][I][ZigbeeCore.cpp:218] esp_zb_app_signal_handler(): Zigbee stack initialized
ZBOSS: commissioning/bdb/zdo_commissioning_bdb.c:349   dev type 2, joined 1, ext_pan_id 1, authenticated 1, tclk_valid 1
ZBOSS: zdo/zdo_app_join.c:771   CONGRATULATIONS! joined status 0, addr 0x103c, iface_id 0, ch 25, rejoin 1
ZBOSS: zdo/zdo_app_join.c:773   xpanid bf:de:b3:e8:e6:a6:c9:f9
ZBOSS: commissioning/bdb/zdo_commissioning_bdb.c:549   COMMISSIONING_STOP: app signal 6 comm status 0
[  5462][I][ZigbeeCore.cpp:224] esp_zb_app_signal_handler(): Device started up in non factory-reset mode
[  5463][I][ZigbeeCore.cpp:237] esp_zb_app_signal_handler(): Device rebooted
Zigbee started successfully!
Connecting to network

Updated temperature sensor value to 32.00°C
[  5464][V][ZigbeeTempSensor.cpp:68] setTemperature(): Updating temperature sensor value...
[  5465][D][ZigbeeTempSensor.cpp:70] setTemperature(): Setting temperature to 3200
Updated temperature sensor value to 31.00°C
[  6465][V][ZigbeeTempSensor.cpp:68] setTemperature(): Updating temperature sensor value...
[  6466][D][ZigbeeTempSensor.cpp:70] setTemperature(): Setting temperature to 3100
Updated temperature sensor value to 32.00°C
[  7466][V][ZigbeeTempSensor.cpp:68] setTemperature(): Updating temperature sensor value...
[  7467][D][ZigbeeTempSensor.cpp:70] setTemperature(): Setting temperature to 3200
Updated temperature sensor value to 32.00°C
[  8467][V][ZigbeeTempSensor.cpp:68] setTemperature(): Updating temperature sensor value...
[  8468][D][ZigbeeTempSensor.cpp:70] setTemperature(): Setting temperature to 3200
Updated temperature sensor value to 32.00°C
[  9468][V][ZigbeeTempSensor.cpp:68] setTemperature(): Updating temperature sensor value...
[  9469][D][ZigbeeTempSensor.cpp:70] setTemperature(): Setting temperature to 3200
Updated temperature sensor value to 32.00°C
[ 10469][V][ZigbeeTempSensor.cpp:68] setTemperature(): Updating temperature sensor value...
[ 10470][D][ZigbeeTempSensor.cpp:70] setTemperature(): Setting temperature to 3200
=========== After Setup Start ============
INTERNAL Memory Info:
------------------------------------------
  Total Size        :   444212 B ( 433.8 KB)
  Free Bytes        :   383148 B ( 374.2 KB)
  Allocated Bytes   :    53248 B (  52.0 KB)
  Minimum Free Bytes:   383036 B ( 374.1 KB)
  Largest Free Block:   352244 B ( 344.0 KB)
------------------------------------------
GPIO Info:
------------------------------------------
  GPIO : BUS_TYPE[bus/unit][chan]
  --------------------------------------  
     3 : GPIO
     9 : GPIO
    12 : USB_DM
    13 : USB_DP
    14 : GPIO
    16 : UART_TX[0]
    17 : UART_RX[0]
============ After Setup End =============
Going to sleep now

Modified script:

// Copyright 2024 Espressif Systems (Shanghai) PTE LTD
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

/**
 * @brief This example demonstrates Zigbee temperature sensor.
 *
 * The example demonstrates how to use Zigbee library to create a end device temperature sensor.
 * The temperature sensor is a Zigbee end device, which is controlled by a Zigbee coordinator.
 *
 * Proper Zigbee mode must be selected in Tools->Zigbee mode
 * and also the correct partition scheme must be selected in Tools->Partition Scheme.
 *
 * Please check the README.md for instructions and more detailed description.
 *
 * Created by Jan Procházka (https://github.com/P-R-O-C-H-Y/)
 */

#ifndef ZIGBEE_MODE_ED
#error "Zigbee end device mode is not selected in Tools->Zigbee mode"
#endif

#include "Zigbee.h"

#define BUTTON_PIN                  9  //Boot button for C6/H2
#define TEMP_SENSOR_ENDPOINT_NUMBER 10

#define uS_TO_S_FACTOR 1000000ULL /* Conversion factor for micro seconds to seconds */
#define TIME_TO_SLEEP  15         /* Sleep for 55s will + 5s delay for establishing connection => data reported every 1 minute */

ZigbeeTempSensor zbTempSensor = ZigbeeTempSensor(TEMP_SENSOR_ENDPOINT_NUMBER);

/************************ Temp sensor *****************************/
static void temp_sensor_value_update(void *arg) {
  for (;;) {
    // Read temperature sensor value
    float tsens_value = temperatureRead();
    Serial.printf("Updated temperature sensor value to %.2f°C\r\n", tsens_value);
    // Update temperature value in Temperature sensor EP
    zbTempSensor.setTemperature(tsens_value);
    delay(1000);
  }
}

/********************* Arduino functions **************************/
void setup() {
  Serial.begin(115200);
  while (!Serial) {
    delay(10);
  }
  // Init button switch
  pinMode(BUTTON_PIN, INPUT_PULLUP);

  // Enable external antenna on Seeed Studio C6 board
  pinMode(3, OUTPUT); // pinMode(3, OUTPUT);
  digitalWrite(3, LOW); // digitalWrite(3, LOW); // Activate RF switch control
  delay(100);
  pinMode(14, OUTPUT); // pinMode(14, OUTPUT);
  digitalWrite(14, HIGH); // digitalWrite(14, HIGH); // Use external antenna

  // Optional: set Zigbee device name and model
  zbTempSensor.setManufacturerAndModel("Espressif", "ZigbeeTempSensor");

  // Set minimum and maximum temperature measurement value (10-50°C is default range for chip temperature measurement)
  zbTempSensor.setMinMaxValue(10, 50);

  // Set tolerance for temperature measurement in °C (lowest possible value is 0.01°C)
  zbTempSensor.setTolerance(1);

  // Add endpoint to Zigbee Core
  Zigbee.addEndpoint(&zbTempSensor);

  Serial.println("Starting Zigbee...");
  // When all EPs are registered, start Zigbee in End Device mode
  if (!Zigbee.begin()) {
    Serial.println("Zigbee failed to start!");
    Serial.println("Rebooting...");
    ESP.restart();
  } else {
    Serial.println("Zigbee started successfully!");
  }
  Serial.println("Connecting to network");
  while (!Zigbee.connected()) {
    Serial.print(".");
    delay(100);
  }
  Serial.println();

  // Start Temperature sensor reading task
  xTaskCreate(temp_sensor_value_update, "temp_sensor_update", 2048, NULL, 10, NULL);

  // Set reporting interval for temperature measurement in seconds, must be called after Zigbee.begin()
  // min_interval and max_interval in seconds, delta (temp change in °C)
  // if min = 1 and max = 0, reporting is sent only when temperature changes by delta
  // if min = 0 and max = 10, reporting is sent every 10 seconds or temperature changes by delta
  // if min = 0, max = 10 and delta = 0, reporting is sent every 10 seconds regardless of temperature change
  zbTempSensor.setReporting(1, 0, 1);

  esp_sleep_enable_timer_wakeup(TIME_TO_SLEEP * uS_TO_S_FACTOR);
  delay(5000);
}

void loop() {
  // Checking button for factory reset
  if (digitalRead(BUTTON_PIN) == LOW) {  // Push button pressed
    // Key debounce handling
    delay(100);
    int startTime = millis();
    while (digitalRead(BUTTON_PIN) == LOW) {
      delay(50);
      if ((millis() - startTime) > 3000) {
        // If key pressed for more than 3secs, factory reset Zigbee and reboot
        Serial.println("Resetting Zigbee to factory and rebooting in 1s.");
        delay(1000);
        Zigbee.factoryReset();
      }
    }
    zbTempSensor.reportTemperature();
  }
  
  Serial.println("Going to sleep now");
  esp_deep_sleep_start();
}

@P-R-O-C-H-Y
Copy link
Member

@michapr @Nawor3565 @ggtimtom
Hi folks, I was able to setup the Zigbee Sniffer using the ESP32-C6 and WireShark.
I have found out that the problem is in the HomeAssistant or the Coordinator side, as I was able to reproduce the same issue on SonOff Temperature/Humidity sensor device.

To describe what's happening.
When the end device is already joined to the network and we reset the device the Rejoin request is send.
I will attach multiple screenshots from the WireShark:

  1. Working case: device send the Rejoin Request and the Rejoin Response is send from the HA
Screenshot 2024-11-29 at 13 48 22
  1. Failure case: device send the Rejoin Request and no Rejoin Response from the HA for some time, so the rejoin request is sent again
Screenshot 2024-11-29 at 13 55 04

In screenshot 2 you can see, that on the 1st rejoin request there was no response form HA, at that time you get in the ESP log the:

ZBOSS: nwk/nwk_join.c:629   Rejoin failure: no dev with xpanid ef:5a:22:4b:08:65:f4:e8 or can't choose best parent
ZBOSS: commissioning/bdb/zdo_commissioning_bdb.c:549   COMMISSIONING_STOP: app signal 6 comm status 3
[ 10186][W][ZigbeeCore.cpp:249] esp_zb_app_signal_handler(): Commissioning failed, trying again...

I have discussed that with the colleague working on esp-zigbee-sdk, and they will add a feature to auto-restart this rejoin request if there is no reply. Now we are solving the issue with the last commits, as we start the commissioning again.

As I said, I was able to reproduce this behavior with the SonOff End device, and they do the same, if there is no reply in certain time, they send the Rejoin Request again.

I hope @Nawor3565 issue was solved by the new ESP32C6 devkit. I always use the Official Espressifs Devkits, so I can recommend them to you. But sure, you may need a smaller/specific ones for your projects.

I will try the Sleepy Temp Sensor example again, if I will be able to reproduce any issue.
Let me know your thoughts and Thank you again for a great feedback and assistance with testing!

@michapr
Copy link
Author

michapr commented Nov 29, 2024

@P-R-O-C-H-Y Yes, looks like the rejoin problem was reproduced, nice.... This we have seen in logs, that multiple tried were needed.
-> but what about the "low" lqi ?
-> And why device was/ is rebooting sometimes ONCE after starting up?

About the "long term" usage and the error that device is stopping send values - maybe open a new issue (maybe not related to the restart issue)

@Nawor3565
Copy link

Nawor3565 commented Nov 29, 2024

@P-R-O-C-H-Y I just found something interesting. I was copying parts of my original script into a modified Zigbee_Temperature_Sensor example, because that example seemed to be reconnecting fine, and it suddenly started failing to reconnect when I added the code for the battery level reporting. When I removed those lines, it started reconnecting again. So, I went back to my original modified Zigbee_Temp_Hum_Sensor_Sleepy script, and commented out just these lines (although the original example was missing the second two lines, so the battery percent was sent once and never updated):

//zbTempSensor.setPowerSource(ZB_POWER_SOURCE_BATTERY, capacitorPercent);
//zbTempSensor.setBatteryPercentage(capacitorPercent);
//zbTempSensor.reportBatteryPercentage();

After removing those lines so that there was nothing left to do with the battery level reporting, my original script seems to work fine, which I hadn't been able to get working on either ESP32 board or with any of the changes to the Zigbee config. Maybe you can test this out on your end and see if you can reproduce? You might need to add .setBatteryPercentage() and .reportBatteryPercentage() to the meausureAndSleep function in the Zigbee_Temp_Hum_Sensor_Sleepy example for it to actually cause the issues I've been seeing, but maybe not.

@P-R-O-C-H-Y
Copy link
Member

@michapr I will keep those issues written to be investigated and about the device is stopping send values, it would be nice to have it in a separate issue. If you can open it and add some logs etc. I will appreciate it. Thanks

@P-R-O-C-H-Y
Copy link
Member

@Nawor3565 I will try it and see if I am able to reproduce. Thanks for the feedback.

@P-R-O-C-H-Y
Copy link
Member

P-R-O-C-H-Y commented Dec 4, 2024

@michapr @Nawor3565
I caught the reboot issue on start up (caused by missing locks) by the Switch example. It should be fixed with this PR #10676. Will also retest for the temp sensor to see if there is something still missing. Check the PR description for more info :)
If you can retest your examples I would be happy to get any feedback if the issues persists. Thank you in advance

@ggtimtom
Copy link

ggtimtom commented Dec 6, 2024

@P-R-O-C-H-Y

im not shure what i have to do to get this updates. Do i have the wrong setup in the arduino IDE when i use https://espressif.github.io/arduino-esp32/package_esp32_dev_index.json in the Boards Manager?

@P-R-O-C-H-Y
Copy link
Member

@P-R-O-C-H-Y

im not shure what i have to do to get this updates. Do i have the wrong setup in the arduino IDE when i use https://espressif.github.io/arduino-esp32/package_esp32_dev_index.json in the Boards Manager?

@ggtimtom, the Fix will be included in next release. If you want to be able to use the latest changes without a release, you will need to use the Manual Install option, instead of using the Board Manager in the IDE. If you decide to, you need to be using the release/v3.1.x branch, and until the PR is merged, you may need to checkout that PR by git commands.
For more informations about this install option, follow this part of documentation and find your OS manual.

@michapr
Copy link
Author

michapr commented Dec 7, 2024

@P-R-O-C-H-Y H2 after reboot:

[07/12/24 - 11:58:49:881] =========== Before Setup Start ===========
[07/12/24 - 11:58:49:900] Chip Info:
[07/12/24 - 11:58:49:904] ------------------------------------------
[07/12/24 - 11:58:49:914]   Model             : ESP32-H2
[07/12/24 - 11:58:49:922]   Package           : 0
[07/12/24 - 11:58:49:927]   Revision          : 0.01
[07/12/24 - 11:58:49:933]   Cores             : 1
[07/12/24 - 11:58:49:941]   CPU Frequency     : 96 MHz
[07/12/24 - 11:58:49:947]   XTAL Frequency    : 32 Flash    : No
[07/12/24 - 11:58:49:982]   Embedded PSRAM    : No
[07/12/24 - 11:58:49:989]   2.4GHz WiFi       : No
[07/12/24 - 11:58:49:991]   Classic BT        : No
[07/12/24 - 11:58:49:993]   BT Low Energy     : Yes
[07/12/24 - 11:58:49:994]   IEEE 802.15.4     : Yes
[07/12/24 - 11:58:49:995] ------------------------------------------
[07/12/24 - 11:58:49:997] INTERNAL Memory Info:
[07/12/24 - 11:58:49:999] ------------------------------------------
[07/12/24 - 11:58:50:002]   Total Size        :   240976 B ( 235.3 KB)
[07/12/24 - 11:58:50:005]   Free Bytes        :   211716 B ( 206.8 KB)
[07/12/24 - 11:58:50:007]   Allocated Bytes   :    24108 B (  23.5 KB)
[07/12/24 - 11:58:50:017]   Minimum Free Bytes:   206728 B ( 201.9 KB)
[07/12/24 - 11:58:50:021]   Largest Free Block:   196596 B ( 192.0 KB)
[07/12/24 - 11:58:50:023] ------------------------------------------
[07/12/24 - 11:58:50:025] Flash Info:
[07/12/24 - 11:58:50:026] ------------------------------------------
[07/12/24 - 11:58:50:028]   Chip Size         :  4194304 B (4 MB)
[07/12/24 - 11:58:50:030]   Block Size        :    65536 B (  64.0 KB)
[07/12/24 - 11:58:50:033]   Sector Size       :     4096 B (   4.0 KB)
[07/12/24 - 11:58:50:035]   Page Size         :      256 B (   0.2 KB)
[07/12/24 - 11:58:50:037]   Bus Speed         : 64 MHz
[07/12/24 - 11:58:50:039]   Bus Mode          : QIO
[07/12/24 - 11:58:50:041] ------------------------------------------
[07/12/24 - 11:58:50:044] Partitions Info:
[07/12/24 - 11:58:50:044] ------------------------------------------
[07/12/24 - 11:58:50:047]                 nvs : addr: 0x00009000, size:    20.0 KB, type: DATA, subtype: NVS
[07/12/24 - 11:58:50:051]             otadata : addr: 0x0000E000, size:     8.0 KB, type: DATA, subtype: OTA
[07/12/24 - 11:58:50:062]                app0 : addr: 0x00010000, size:  1280.0 KB, type:  APP, subtype: OTA_0
[07/12/24 - 11:58:50:066]                app1 : addr: 0x00150000, size:  1280.0 KB, type:  APP, subtype: OTA_1
[07/12/24 - 11:58:50:072]              spiffs : addr: 0x00290000, size:  1388.0 KB, type: DATA, subtype: SPIFFS
[07/12/24 - 11:58:50:076]          zb_storage : addr: 0x003EB000, size:    16.0 KB, type: DATA, subtype: FAT
[07/12/24 - 11:58:50:081]              zb_fct : addr: 0x003EF000, size:     4.0 KB, type: DATA, subtype: FAT
[07/12/24 - 11:58:50:085]            coredump : addr: 0x003F0000, size:    64.0 KB, type: DATA, subtype: COREDUMP
[07/12/24 - 11:58:50:095] ------------------------------------------
[07/12/24 - 11:58:50:097] Software Info:
[07/12/24 - 11:58:50:097] ------------------------------------------
[07/12/24 - 11:58:50:102]   Compile Date/Time : Dec  7 2024 11:53:43
[07/12/24 - 11:58:50:105]   Compile Host OS   : windows
[07/12/24 - 11:58:50:105]   ESP-IDF Version   : v5.3.1-638-ga0f798cfc4-dirty
[07/12/24 - 11:58:50:107]   Arduino Version   : 3.1.0
[07/12/24 - 11:58:50:116] ------------------------------------------
[07/12/24 - 11:58:50:119] Board Info:
[07/12/24 - 11:58:50:119] ------------------------------------------
[07/12/24 - 11:58:50:121]   Arduino Board     : ESP32H2_DEV
[07/12/24 - 11:58:50:123]   Arduino Variant   : esp32h2
[07/12/24 - 11:58:50:125]   Arduino FQBN      : espressif:esp32:esp32h2:UploadSpeed=921600,CDCOnBoot=cdc,FlashFreq=64,FlashMode=qio,FlashSize=4M,PartitionScheme=zigbee,DebugL
[07/12/24 - 11:58:50:134] evel=verbose,EraseFlash=all,JTAGAdapter=default,ZigbeeMode=ed_debug
[07/12/24 - 11:58:50:138] ============ Before Setup End ============
[07/12/24 - 11:58:50:140] [  5272][I][esp32-hal-periman.c:141] perimanSetPinBus(): Pin 26 already has type USB_DM (38) with bus 0x4080fc70
[07/12/24 - 11:58:50:162] [  5273][I][esp32-hal-periman.c:141] perimanSetPinBus(): Pin 27 already has type USB_DP (39) with bus 0x4080fc70
[07/12/24 - 11:58:50:168] [  5274][V][esp32-hal-periman.c:235] perimanSetBusDeinit(): Deinit function for type GPIO (1) successfully set to 0x42003814
[07/12/24 - 11:58:50:191] [  5275][V][esp32-hal-periman.c:160] perimanSetPinBus(): Pin 9 successfully set to type GPIO (1) with bus 0xa
[07/12/24 - 11:58:50:197] ZBOSS: zcl/zcl_common.c:215   >> zb_zcl_get_attribute_size: attr_type 0x42 attr_value 0x40817f14
[07/12/24 - 11:58:50:214] ZBOSS: zcl/zcl_common.c:348   << zb_zcl_get_attribute_size: result 10
[07/12/24 - 11:58:50:223] ZBOSS: zcl/zcl_common.c:215   >> zb_zcl_get_attribute_size: attr_type 0x42 attr_value 0x40817f30
[07/12/24 - 11:58:50:229] ZBOSS: zcl/zcl_common.c:348   << zb_zcl_get_attribute_size: result 17
[07/12/24 - 11:58:50:234] ZBOSS: zcl/zcl_common.c:215   >> zb_zcl_get_attribute_size: attr_type 0x29 attr_value 0x4081c9cc
[07/12/24 - 11:58:50:254] ZBOSS: zcl/zcl_common.c:348   << zb_zcl_get_attribute_size: result 2
[07/12/24 - 11:58:50:257] ZBOSS: zcl/zcl_common.c:215   >> zb_zcl_get_attribute_size: attr_type 0x29 attr_value 0x4081c9ce
[07/12/24 - 11:58:50:264] ZBOSS: zcl/zcl_common.c:348   << zb_zcl_get_attribute_size: result 2
[07/12/24 - 11:58:50:279] ZBOSS: zcl/zcl_common.c:215   >> zb_zcl_get_attribute_size: attr_type 0x21 attr_value 0x4081c9ce
[07/12/24 - 11:58:50:287] ZBOSS: zcl/zcl_common.c:348   << zb_zcl_get_attribute_size: result 2
[07/12/24 - 11:58:50:290] [  5283][D][ZigbeeCore.cpp:83] addEndpoint(): Endpoint: 10, Device ID: 0x0302
[07/12/24 - 11:58:50:296] Starting Zigbee...
[07/12/24 - 11:58:50:304] [  5284][D][ZigbeeCore.cpp:122] zigbeeInit(): Initialize Zigbee stack
[07/12/24 - 11:58:50:316] ZBOSS: common/zb_init_default.c:181   ED build
[07/12/24 - 11:58:50:319] ZBOSS: common/zb_init_default.c:187   sizes: g_zb 7576 sched 224 bpool 16 nwk 912 aps 3040 addr 284 zdo 840
[07/12/24 - 11:58:50:326] ZBOSS: common/zb_init_default.c:196   sec 2
[07/12/24 - 11:58:50:328] ZBOSS: common/zb_init_default.c:198   zcl 768
[07/12/24 - 11:58:50:343] ZBOSS: common/zb_init_default.c:201   zll 960
[07/12/24 - 11:58:50:347] ZBOSS: common/zb_init_default.c:207   nvram 140
[07/12/24 - 11:58:50:350] ZBOSS: common/zb_init_default.c:210   buttons 200
[07/12/24 - 11:58:50:353] ZBOSS: common/zb_init_default.c:212   err_ind 4
[07/12/24 - 11:58:50:355] ZBOSS: common/zb_init_default.c:218   scheduler q size 80
[07/12/24 - 11:58:50:359] ZBOSS: common/zb_init_default.c:221   g_mac 816 g_imac 28
[07/12/24 - 11:58:50:376] ZBOSS: common/zb_init_default.c:225   Configurable mem build, use ZBOSS lib defaults = 0
[07/12/24 - 11:58:50:381] ZBOSS: common/zb_init_default.c:231   ZB_IOBUF_POOL_SIZE 80 ZB_NWK_IN_Q_SIZE 40 ZB_MAC_PENDING_QUEUE_SIZE 20 ZB_APS_DST_BINDING_TABLE_SIZE 16 ZB_APS
[07/12/24 - 11:58:50:398] _BIND_TRANS_TABLE_SIZE 20 ZB_N_APS_RETRANS_ENTRIES 27
[07/12/24 - 11:58:50:409] ZBOSS: common/zb_init_default.c:261   ZB_N_APS_KEY_PAIR_ARR_MAX_SIZE 8 ZB_IEEE_ADDR_TABLE_SIZE 64 ZB_NEIGHBOR_TABLE_SIZE 64 ZB_NWK_ROUTING_TABLE_SIZ
[07/12/24 - 11:58:50:417] E 0 ZB_APS_DUPS_TABLE_SIZE 32
[07/12/24 - 11:58:50:419] [  5315][D][ZigbeeCore.cpp:129] zigbeeInit(): Register all Zigbee EPs in list
[07/12/24 - 11:58:50:434] ZBOSS: zdo/af_descriptor.c:357   ep_count 1
[07/12/24 - 11:58:50:445] [  5318][I][ZigbeeCore.cpp:137] zigbeeInit(): List of registered Zigbee EPs:
[07/12/24 - 11:58:50:455] [  5319][I][ZigbeeCore.cpp:139] zigbeeInit(): Device type: Temperature Sensor, Endpoint: 10, Device ID: 0x0302
[07/12/24 - 11:58:50:461] ZBOSS: common/zb_nvram.c:3190   ds_ver == 2
[07/12/24 - 11:58:50:464] ZBOSS: zdo/zdo_app_prod_conf.c:144   no production config block found
[07/12/24 - 11:58:50:467] ZBOSS: zdo/zdo_app_prod_conf.c:781   no valid production configuration found, signaling to application
[07/12/24 - 11:58:50:480] [  5335][V][ZigbeeCore.cpp:332] esp_zb_app_signal_handler(): ZDO signal: ZDO Config Ready (0x17), status: ESP_FAIL
[07/12/24 - 11:58:50:489] [  5336][I][ZigbeeCore.cpp:218] esp_zb_app_signal_handler(): Zigbee stack initialized
[07/12/24 - 11:58:50:493] ZBOSS: commissioning/bdb/zdo_commissioning_bdb.c:349   dev type 2, joined 1, ext_pan_id 1, authenticated 1, tclk_valid 1
[07/12/24 - 11:58:54:333] ZBOSS: nwk/nwk_join.c:629   Rejoin failure: no dev with xpanid 3a:63:5d:94:1c:56:10:7e or can't choose best parent
[07/12/24 - 11:58:54:340] ZBOSS: commissioning/bdb/zdo_commissioning_bdb.c:549   COMMISSIONING_STOP: app signal 6 comm status 3
[07/12/24 - 11:58:54:345] [  9638][W][ZigbeeCore.cpp:250] esp_zb_app_signal_handler(): Commissioning failed, trying again...
[07/12/24 - 11:58:54:840] ZBOSS: commissioning/bdb/zdo_commissioning_bdb.c:349   dev type 2, joined 1, ext_pan_id 1, authenticated 1, tclk_valid 1
[07/12/24 - 11:58:59:135] ZBOSS: nwk/nwk_join.c:629   Rejoin failure: no dev with xpanid 3a:63:5d:94:1c:56:10:7e or can't choose best parent
[07/12/24 - 11:58:59:153] ZBOSS: commissioning/bdb/zdo_commissioning_bdb.c:549   COMMISSIONING_STOP: app signal 6 comm status 3
[07/12/24 - 11:58:59:165] [ 14440][W][ZigbeeCore.cpp:250] esp_zb_app_signal_handler(): Commissioning failed, trying again...
[07/12/24 - 11:58:59:642] ZBOSS: commissioning/bdb/zdo_commissioning_bdb.c:349   dev type 2, joined 1, ext_pan_id 1, authenticated 1, tclk_valid 1
[07/12/24 - 11:59:03:937] ZBOSS: nwk/nwk_join.c:629   Rejoin failure: no dev with xpanid 3a:63:5d:94:1c:56:10:7e or can't choose best parent
[07/12/24 - 11:59:03:944] ZBOSS: commissioning/bdb/zdo_commissioning_bdb.c:549   COMMISSIONING_STOP: app signal 6 comm status 3
[07/12/24 - 11:59:03:949] [ 19242][W][ZigbeeCore.cpp:250] esp_zb_app_signal_handler(): Commissioning failed, trying again...
[07/12/24 - 11:59:04:444] ZBOSS: commissioning/bdb/zdo_commissioning_bdb.c:349   dev type 2, joined 1, ext_pan_id 1, authenticated 1, tclk_valid 1
[07/12/24 - 11:59:08:775] ZBOSS: zdo/zdo_app_join.c:771   CONGRATULATIONS! joined status 0, addr 0x8481, iface_id 0, ch 11, rejoin 1
[07/12/24 - 11:59:08:781] ZBOSS: zdo/zdo_app_join.c:773   xpanid 3a:63:5d:94:1c:56:10:7e
[07/12/24 - 11:59:08:800] ZBOSS: zdo/zdo_app_join.c:771   CONGRATULATIONS! joined status 0, addr 0x8481, iface_id 0, ch 11, rejoin 1
[07/12/24 - 11:59:08:813] ZBOSS: zdo/zdo_app_join.c:773   xpanid 3a:63:5d:94:1c:56:10:7e
[07/12/24 - 11:59:08:817] ZBOSS: commissioning/bdb/zdo_commissioning_bdb.c:549   COMMISSIONING_STOP: app signal 6 comm status 0
[07/12/24 - 11:59:08:822] [ 24114][I][ZigbeeCore.cpp:224] esp_zb_app_signal_handler(): Device started up in non factory-reset mode
[07/12/24 - 11:59:08:827] [ 24115][I][ZigbeeCore.cpp:237] esp_zb_app_signal_handler(): Device rebooted
[07/12/24 - 11:59:08:836] [ 24116][D][ZigbeeCore.cpp:454] searchBindings(): Requesting binding table for address 0x8481
[07/12/24 - 11:59:08:841] [ 24119][D][ZigbeeCore.cpp:400] bindingTableCb(): Binding table callback for address 0x8481 with status 0
[07/12/24 - 11:59:08:848] [ 24120][D][ZigbeeCore.cpp:403] bindingTableCb(): Binding table info: total 1, index 0, count 1
[07/12/24 - 11:59:08:852] [ 24121][D][ZigbeeCore.cpp:413] bindingTableCb(): Binding table record: src_endp 10, dst_endp 1, cluster_id 0x0402, dst_addr_mode 3
[07/12/24 - 11:59:08:859] [ 24122][D][ZigbeeCore.cpp:427] bindingTableCb(): Device bound to EP 10 -> device endpoint: 1, short addr: 0x0000, ieee addr: 94:34:69:FF:FE:0D:65:A9
[07/12/24 - 11:59:08:874] [ 24124][D][ZigbeeCore.cpp:445] bindingTableCb(): Filling bounded devices finished
[07/12/24 - 11:59:08:879] Zigbee started successfully!
[07/12/24 - 11:59:08:880] Connecting to network
[07/12/24 - 11:59:08:881] Updated temperature sensor value to 28.00°C
[07/12/24 - 11:59:08:883] [ 24127][V][ZigbeeTempSensor.cpp:70] setTemperature(): Updating temperature sensor value...
[07/12/24 - 11:59:08:887] [ 24128][D][ZigbeeTempSensor.cpp:72] setTemperature(): Setting temperature to 2800
[07/12/24 - 11:59:08:891] [ 24139][V][ZigbeeCore.cpp:332] esp_zb_app_signal_handler(): ZDO signal: NLME Status Indication (0x32), status: ESP_OK
[07/12/24 - 11:59:08:905] ZBOSS: commissioning/bdb/zdo_commissioning_bdb.c:549   COMMISSIONING_STOP: app signal 6 comm status 14
[07/12/24 - 11:59:08:912] [ 24141][W][ZigbeeCore.cpp:250] esp_zb_app_signal_handler(): Commissioning failed, trying again...
[07/12/24 - 11:59:08:917] =========== After Setup Start ============
[07/12/24 - 11:59:08:918] INTERNAL Memory Info:
[07/12/24 - 11:59:08:919] ------------------------------------------
[07/12/24 - 11:59:08:927]   Total Size        :   240976 B ( 235.3 KB)
[07/12/24 - 11:59:08:930]   Free Bytes        :   182068 B ( 177.8 KB)
[07/12/24 - 11:59:08:932]   Allocated Bytes   :    52892 B (  51.7 KB)
[07/12/24 - 11:59:08:934]   Minimum Free Bytes:   181956 B ( 177.7 KB)
[07/12/24 - 11:59:08:936]   Largest Free Block:   172020 B ( 168.0 KB)
[07/12/24 - 11:59:08:939] ------------------------------------------
[07/12/24 - 11:59:08:941] GPIO Info:
[07/12/24 - 11:59:08:941] ------------------------------------------
[07/12/24 - 11:59:08:943]   GPIO : BUS_TYPE[bus/unit][chan]
[07/12/24 - 11:59:08:945]   --------------------------------------  
[07/12/24 - 11:59:08:946]      9 : GPIO
[07/12/24 - 11:59:08:947]     23 : UART_RX[0]
[07/12/24 - 11:59:08:947]     24 : UART_TX[0]
[07/12/24 - 11:59:08:949]     26 : USB_DM
[07/12/24 - 11:59:08:950]     27 : USB_DP
[07/12/24 - 11:59:08:951] [ 24164][V][ZigbeeCore.cpp:332] esp_zb_app_signal_handler(): ZDO signal: NLME Status Indication (0x32), status: ESP_OK
[07/12/24 - 11:59:08:965] 
[07/12/24 - 11:59:08:965] ZBOSS: commissioning/bdb/zdo_commissioning_bdb.c:349   dev type 2, joined 1, ext_pan_id 1, authenticated 1, tclk_valid 1
[07/12/24 - 11:59:08:970] ============ After Setup End =============
[07/12/24 - 11:59:09:339] 0
[07/12/24 - 11:59:09:339] ;
[07/12/24 - 11:59:09:339] 3
[07/12/24 - 11:59:09:340] 1
[07/12/24 - 11:59:09:340] m
[07/12/24 - 11:59:09:341] E (25090) ESP_ZIGBEE_CORE: In BDB commissioning, an error occurred (for example: the device has already been running)�[0m
[07/12/24 - 11:59:09:346] ESP_ERROR_CHECK failed: esp_err_t 0xffffffff (ESP_FAIL) at 0x420009b2
[07/12/24 - 11:59:09:350] file: "D:\Projekte\Arduino20\hardware\espressif\esp32\libraries\Zigbee\src\ZigbeeCore.cpp" line 204
[07/12/24 - 11:59:09:355] func: void bdb_start_top_level_commissioning_cb(uint8_t)
[07/12/24 - 11:59:09:357] expression: esp_zb_bdb_start_top_level_commissioning(mode_m
[07/12/24 - 11:59:09:695] abort() was called at PC 0x40806b0b on core 0
[07/12/24 - 11:59:09:697] Core  0 register dump:
[07/12/24 - 11:59:09:699] MEPC    : 0x408015c8  RA      : 0x40806b16  SP      : 0x408225c0  GP      : 0x4080e304  
[07/12/24 - 11:59:09:703] TP      : 0x40822700  T0      : 0x37363534  T1      : 0x7271706f  T2      : 0x33323130  
[07/12/24 - 11:59:09:709] S0/FP   : 0x408225ec  S1      : 0x408225ec  A0      : 0x408225f8  A1      : 0x408225da  
[07/12/24 - 11:59:09:713] A2      : 0x00000000  A3      : 0x40822625  A4      : 0x00000001  A5      : 0x40815000  
[07/12/24 - 11:59:09:717] A6      : 0x00000000  A7      : 0x76757473  S2      : 0x01780519  S3      : 0x00000001  
[07/12/24 - 11:59:09:723] S4      : 0x00000000  S5      : 0x00000049  S6      : 0x00000000  S7      : 0x00000000  
[07/12/24 - 11:59:09:732] S8      : 0x00000000  S9      : 0x00000000  S10     : 0x00000000  S11     : 0x00000000  
[07/12/24 - 11:59:09:736] T3      : 0x6e6d6c6b  T4      : 0x6a696867  T5      : 0x66656463  T6      : 0x62613938  
[07/12/24 - 11:59:09:743] MSTATUS : 0x00001881  MTVEC   : 0x40800001  MCAUSE  : 0x00000007  MTVAL   : 0x00000000  
[07/12/24 - 11:59:09:746] MHARTID : 0x00000000  
[07/12/24 - 11:59:09:748] 
[07/12/24 - 11:59:09:748] Stack memory:
[07/12/24 - 11:59:09:748] 408225c0: 0x00000000 0x00000000 0x408225d8 0x4080c992 0x00000000 0x00000049 0x00000030 0x4080f6d8
[07/12/24 - 11:59:09:753] 408225e0: 0x408225ec 0x4080f6f4 0x408225d8 0x30383034 0x62306236 0x42000900 0x726f6261 0x20292874
[07/12/24 - 11:59:09:765] 40822600: 0x20736177 0x6c6c6163 0x61206465 0x43502074 0x34783020 0x36303830 0x20623062 0x63206e6f
[07/12/24 - 11:59:09:769] 40822620: 0x2065726f 0x00000030 0x00000000 0xc67159fc 0x420b0720 0x00000049 0x40820807 0x40806b0e
[07/12/24 - 11:59:09:776] 40822640: 0x00000000 0x0000004b 0x40820807 0x420009b6 0x00000000 0x00000000 0x00000000 0x42028768
[07/12/24 - 11:59:09:780] 40822660: 0x00000000 0x00000000 0x40821134 0x4080779c 0x42000988 0x01780418 0x00000000 0xff4f4e00
[07/12/24 - 11:59:09:785] 40822680: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x42055ec4
[07/12/24 - 11:59:09:796] 408226a0: 0x40815000 0x00000001 0x40815000 0x420099ac 0x00000000 0x00000000 0x00000000 0x420099ba
[07/12/24 - 11:59:09:800] 408226c0: 0x00000000 0x00000000 0x00000000 0x40807dd2 0x00000000 0x00000000 0x00000000 0x00000000
[07/12/24 - 11:59:09:807] 408226e0: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5
[07/12/24 - 11:59:09:811] 40822700: 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 0xbaad5678 0x0000080c 0xabba1234 0x00000800
[07/12/24 - 11:59:09:815] 40822720: 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5
[07/12/24 - 11:59:09:820] 40822740: 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5
[07/12/24 - 11:59:09:831] 40822760: 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5
[07/12/24 - 11:59:09:835] 40822780: 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5
[07/12/24 - 11:59:09:841] 408227a0: 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5
[07/12/24 - 11:59:09:845] 408227c0: 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 0x403c0000 0x00000000 0x00000000 0x4000af90
[07/12/24 - 11:59:09:850] 408227e0: 0x40816670 0x40850000 0x40815190 0x4000b06c 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 0x4000af90
[07/12/24 - 11:59:09:854] 40822800: 0x403c0000 0x00000000 0x00000000 0x4000af90 0x40823094 0x40850000 0x40815190 0x4000b06c
[07/12/24 - 11:59:09:866] 40822820: 0xa5a5a5a5 0x00001800 0x0000001c 0x4000af90 0x40815190 0x00000018 0x4082309c 0x4080b92e
[07/12/24 - 11:59:09:870] 40822840: 0x40815000 0x00000003 0x40815878 0x40801e3c 0x00000002 0x00001800 0x00000018 0x00000004
[07/12/24 - 11:59:09:875] 40822860: 0x40815190 0x3ff73dd2 0x00000000 0xffffffff 0x00001800 0x00000018 0x00000000 0x40801ba4
[07/12/24 - 11:59:09:879] 40822880: 0x00000001 0x00000000 0x00000000 0x4080cb1e 0xa5a5a5a5 0x00000000 0x00000000 0x00000002
[07/12/24 - 11:59:09:884] 408228a0: 0x00000000 0x4082309f 0x00000009 0xfffff9c0 0x3fefffff 0x00000001 0x4082309c 0x4209def6
[07/12/24 - 11:59:09:889] 408228c0: 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 0x40822f94 0x00000003 0xa5a5a5a5 0x40816678 0x00000003
[07/12/24 - 11:59:09:893] 408228e0: 0x00000000 0x00000002 0x40822a18 0x00000001 0x42097c88 0x420988e4 0x40822970 0x4080e304
[07/12/24 - 11:59:09:897] 40822900: 0x40822f10 0x4000af8c 0x20000000 0xe0000000 0x00000000 0x40822acc 0x00000000 0x00000000
[07/12/24 - 11:59:09:901] 40822920: 0x00000000 0xffffffff 0x00000080 0x00000000 0xa0000000 0x0000000a 0x00000000 0x00000000
[07/12/24 - 11:59:09:913] 40822940: 0x00000005 0x00000000 0x00000064 0x00000004 0x40822a34 0x420b1919 0x00000004 0x00000000
[07/12/24 - 11:59:09:917] 40822960: 0x00000000 0x420b1917 0x00000002 0x420990b6 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 0x40822f94
[07/12/24 - 11:59:09:924] 40822980: 0x40822d98 0x420b1917 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000001
[07/12/24 - 11:59:09:928] 408229a0: 0x00000054 0x00000004 0x00000000 0x420d59e8 0x00000000 0xa5a5a5a5 0x00000000 0x00000000
[07/12/24 - 11:59:09:932] 
[07/12/24 - 11:59:09:932] 
[07/12/24 - 11:59:09:932] ELF file SHA256: 34732f6fa
[07/12/24 - 11:59:09:934] 
[07/12/24 - 11:59:09:934] Rebooting...
[07/12/24 - 11:59:09:935] ESP-ROM:esp32h2-20221101
[07/12/24 - 11:59:09:936] Build:Nov  1 2022
[07/12/24 - 11:59:09:937] rst:0xc (SW_CPU),boot:0x8 (SPI_FAST_FLASH_BOOT)
[07/12/24 - 11:59:09:946] Saved PC:0x400031b6
[07/12/24 - 11:59:09:947] SPIWP:0xee
[07/12/24 - 11:59:09:948] mode:DIO, clock div:1
[07/12/24 - 11:59:09:949] load:0x408460e0,len:0x112c
[07/12/24 - 11:59:09:950] load:0x4083cad0,len:0xe18
[07/12/24 - 11:59:09:951] load:0x4083efd0,len:0x2d04
[07/12/24 - 11:59:09:952] entry 0x4083cad0
[07/12/24 - 11:59:09:953] 
[07/12/24 - 11:59:10:198] [     1][V][esp32-hal-periman.c:235] perimanSetBusDeinit(): Deinit function for type UART_RX (2) successfully set to 0x420060c6
[07/12/24 - 11:59:10:214] [    12][V][esp32-hal-periman.c:235] perimanSetBusDeinit(): Deinit function for type UART_TX (3) successfully set to 0x4200608a
[07/12/24 - 11:59:10:220] [    24][V][esp32-hal-periman.c:235] perimanSetBusDeinit(): Deinit function for type UART_CTS (4) successfully set to 0x4200604e
[07/12/24 - 11:59:10:233] [    35][V][esp32-hal-periman.c:235] perimanSetBusDeinit(): Deinit function for type UART_RTS (5) successfully set to 0x42006012
[07/12/24 - 11:59:10:244] [    47][V][esp32-hal-periman.c:235] perimanSetBusDeinit(): Deinit function for type UART_RX (2) successfully set to 0x420060c6
[07/12/24 - 11:59:10:259] [    58][V][esp32-hal-periman.c:235] perimanSetBusDeinit(): Deinit function for type UART_TX (3) successfully set to 0x4200608a
[07/12/24 - 11:59:10:266] [    69][V][esp32-hal-periman.c:235] perimanSetBusDeinit(): Deinit function for type UART_CTS (4) successfully set to 0x4200604e
[07/12/24 - 11:59:10:278] [    81][V][esp32-hal-periman.c:235] perimanSetBusDeinit(): Deinit function for type UART_RTS (5) successfully set to 0x42006012
[07/12/24 - 11:59:10:291] [    92][V][esp32-hal-periman.c:235] perimanSetBusDeinit(): Deinit function for type USB_DM (38) successfully set to 0x420028f6
[07/12/24 - 11:59:10:301] [   104][V][esp32-hal-periman.c:235] perimanSetBusDeinit(): Deinit function for type USB_DP (39) successfully set to 0x420028f6
[07/12/24 - 11:59:10:311] [   115][V][ZigbeeEP.cpp:20] ZigbeeEP(): Endpoint: 10
[07/12/24 - 11:59:10:323] 
[07/12/24 - 11:59:10:323] ZBOSS: zcl/zcl_common.c:215   >> zb_zcl_get_attribute_size: attr_type 0x20 attr_value 0x4084ef0f
[07/12/24 - 11:59:10:327] ZBOSS: zcl/zcl_common.c:348   << zb_zcl_get_attribute_size: result 1
[07/12/24 - 11:59:10:330] ZBOSS: zcl/zcl_common.c:215   >> zb_zcl_get_attribute_size: attr_type 0x30 attr_value 0x4084ef0e
[07/12/24 - 11:59:10:335] ZBOSS: zcl/zcl_common.c:348   << zb_zcl_get_attribute_size: result 1
[07/12/24 - 11:59:10:342] ZBOSS: zcl/zcl_common.c:215   >> zb_zcl_get_attribute_size: attr_type 0x21 attr_value 0x4084ef0e
[07/12/24 - 11:59:10:353] ZBOSS: zcl/zcl_common.c:348   << zb_zcl_get_attribute_size: result 2
[07/12/24 - 11:59:10:357] ZBOSS: zcl/zcl_common.c:215   >> zb_zcl_get_attribute_size: attr_type 0x29 attr_value 0x4084ef0e
[07/12/24 - 11:59:10:362] ZBOSS: zcl/zcl_common.c:348   << zb_zcl_get_attribute_size: result 2
[07/12/24 - 11:59:10:371] ZBOSS: zcl/zcl_common.c:215   >> zb_zcl_get_attribute_size: attr_type 0x29 attr_value 0x4084ef0c
[07/12/24 - 11:59:10:377] ZBOSS: zcl/zcl_common.c:348   << zb_zcl_get_attribute_size: result 2
[07/12/24 - 11:59:10:385] ZBOSS: zcl/zcl_common.c:215   >> zb_zcl_get_attribute_size: attr_type 0x29 attr_value 0x4084ef0a
[07/12/24 - 11:59:10:392] ZBOSS: zcl/zcl_common.c:348   << zb_zcl_get_attribute_size: result 2
[07/12/24 - 11:59:10:395] 
[07/12/24 - 11:59:10:411] [   215][V][esp32-hal-periman.c:160] perimanSetPinBus(): Pin 23 successfully set to type UART_RX (2) with bus 0x4080dce0
[07/12/24 - 11:59:10:422] [   226][V][esp32-hal-periman.c:160] perimanSetPinBus(): Pin 24 successfully set to type UART_TX (3) with bus 0x4080dce0
[07/12/24 - 11:59:10:433] [   236][V][esp32-hal-periman.c:160] perimanSetPinBus(): Pin 26 successfully set to type USB_DM (38) with bus 0x4080fc70
[07/12/24 - 11:59:10:444] [   247][V][esp32-hal-periman.c:160] perimanSetPinBus(): Pin 27 successfully set to type USB_DP (39) with bus 0x4080fc70
[07/12/24 - 11:59:10:450] 
[07/12/24 - 11:59:10:454] =========== Before Setup Start ===========
[07/12/24 - 11:59:10:457] Chip Info:
[07/12/24 - 11:59:10:457] ------------------------------------------
[07/12/24 - 11:59:10:460]   Model             : ESP32-H2
[07/12/24 - 11:59:10:461]   Package           : 0
[07/12/24 - 11:59:10:463]   Revision          : 0.01
[07/12/24 - 11:59:10:464]   Cores             : 1
[07/12/24 - 11:59:10:465]   CPU Frequency     : 96 MHz
[07/12/24 - 11:59:10:466]   XTAL Frequency    : 32 MHz
[07/12/24 - 11:59:10:468]   Features Bitfield : 0x00000050
[07/12/24 - 11:59:10:470]   Embedded Flash    : No
[07/12/24 - 11:59:10:471]   Embedded PSRAM    : No
[07/12/24 - 11:59:10:477]   2.4GHz WiFi       : No
[07/12/24 - 11:59:10:478]   Classic BT        : No
[07/12/24 - 11:59:10:479]   BT Low Energy     : Yes
[07/12/24 - 11:59:10:480]   IEEE 802.15.4     : Yes
[07/12/24 - 11:59:10:481] ------------------------------------------
[07/12/24 - 11:59:10:483] INTERNAL Memory Info:
[07/12/24 - 11:59:10:484] ------------------------------------------
[07/12/24 - 11:59:10:486]   Total Size        :   240976 B ( 235.3 KB)
[07/12/24 - 11:59:10:489]   Free Bytes        :   206728 B ( 201.9 KB)
[07/12/24 - 11:59:10:492]   Allocated Bytes   :    29064 B (  28.4 KB)
[07/12/24 - 11:59:10:493]   Minimum Free Bytes:   206728 B ( 201.9 KB)
[07/12/24 - 11:59:10:495]   Largest Free Block:   196596 B ( 192.0 KB)
[07/12/24 - 11:59:10:497] ------------------------------------------
[07/12/24 - 11:59:10:499] Flash Info:
[07/12/24 - 11:59:10:499] ------------------------------------------
[07/12/24 - 11:59:10:502]   Chip Size         :  4194304 B (4 MB)
[07/12/24 - 11:59:10:511]   Block Size        :    65536 B (  64.0 KB)
[07/12/24 - 11:59:10:513]   Sector Size       :     4096 B (   4.0 KB)
[07/12/24 - 11:59:10:515]   Page Size         :      256 B (   0.2 KB)
[07/12/24 - 11:59:10:516]   Bus Speed         : 64 MHz
[07/12/24 - 11:59:10:518]   Bus Mode          : QIO
[07/12/24 - 11:59:10:519] ------------------------------------------
[07/12/24 - 11:59:10:522] Partitions Info:
[07/12/24 - 11:59:10:522] ------------------------------------------
[07/12/24 - 11:59:10:524]                 nvs : addr: 0x00009000, size:    20.0 KB, type: DATA, subtype: NVS
[07/12/24 - 11:59:10:527]             otadata : addr: 0x0000E000, size:     8.0 KB, type: DATA, subtype: OTA
[07/12/24 - 11:59:10:532]                app0 : addr: 0x00010000, size:  1280.0 KB, type:  APP, subtype: OTA_0
[07/12/24 - 11:59:10:543]                app1 : addr: 0x00150000, size:  1280.0 KB, type:  APP, subtype: OTA_1
[07/12/24 - 11:59:10:547]              spiffs : addr: 0x00290000, size:  1388.0 KB, type: DATA, subtype: SPIFFS
[07/12/24 - 11:59:10:552]          zb_storage : addr: 0x003EB000, size:    16.0 KB, type: DATA, subtype: FAT
[07/12/24 - 11:59:10:556]              zb_fct : addr: 0x003EF000, size:     4.0 KB, type: DATA, subtype: FAT
[07/12/24 - 11:59:10:560]            coredump : addr: 0x003F0000, size:    64.0 KB, type: DATA, subtype: COREDUMP
[07/12/24 - 11:59:10:564] ------------------------------------------
[07/12/24 - 11:59:10:566] Software Info:
[07/12/24 - 11:59:10:572] ------------------------------------------
[07/12/24 - 11:59:10:574]   Compile Date/Time : Dec  7 2024 11:53:43
[07/12/24 - 11:59:10:577]   Compile Host OS   : windows
[07/12/24 - 11:59:10:579]   ESP-IDF Version   : v5.3.1-638-ga0f798cfc4-dirty
[07/12/24 - 11:59:10:583]   Arduino Version   : 3.1.0
[07/12/24 - 11:59:10:585] ------------------------------------------
[07/12/24 - 11:59:10:587] Board Info:
[07/12/24 - 11:59:10:589] ------------------------------------------
[07/12/24 - 11:59:10:591]   Arduino Board     : ESP32H2_DEV
[07/12/24 - 11:59:10:593]   Arduino Variant   : esp32h2
[07/12/24 - 11:59:10:595]   Arduino FQBN      : espressif:esp32:esp32h2:UploadSpeed=921600,CDCOnBoot=cdc,FlashFreq=64,FlashMode=qio,FlashSize=4M,PartitionScheme=zigbee,DebugL
[07/12/24 - 11:59:10:611] evel=verbose,EraseFlash=all,JTAGAdapter=default,ZigbeeMode=ed_debug
[07/12/24 - 11:59:10:616] ============ Before Setup End ============
[07/12/24 - 11:59:10:618] [   381][I][esp32-hal-periman.c:141] perimanSetPinBus(): Pin 26 already has type USB_DM (38) with bus 0x4080fc70
[07/12/24 - 11:59:10:624] [   382][I][esp32-hal-periman.c:141] perimanSetPinBus(): Pin 27 already has type USB_DP (39) with bus 0x4080fc70
[07/12/24 - 11:59:10:636] [   383][V][esp32-hal-periman.c:235] perimanSetBusDeinit(): Deinit function for type GPIO (1) successfully set to 0x42003814
[07/12/24 - 11:59:10:644] [   384][V][esp32-hal-periman.c:160] perimanSetPinBus(): Pin 9 successfully set to type GPIO (1) with bus 0xa
[07/12/24 - 11:59:10:649] 
[07/12/24 - 11:59:10:649] ZBOSS: zcl/zcl_common.c:215   >> zb_zcl_get_attribute_size: attr_type 0x42 attr_value 0x40817ebc
[07/12/24 - 11:59:10:654] ZBOSS: zcl/zcl_common.c:348   << zb_zcl_get_attribute_size: result 10
[07/12/24 - 11:59:10:664] ZBOSS: zcl/zcl_common.c:215   >> zb_zcl_get_attribute_size: attr_type 0x42 attr_value 0x40817ed8
[07/12/24 - 11:59:10:667] ZBOSS: zcl/zcl_common.c:348   << zb_zcl_get_attribute_size: result 17
[07/12/24 - 11:59:10:671] ZBOSS: zcl/zcl_common.c:215   >> zb_zcl_get_attribute_size: attr_type 0x29 attr_value 0x4081c9cc
[07/12/24 - 11:59:10:677] ZBOSS: zcl/zcl_common.c:348   << zb_zcl_get_attribute_size: result 2
[07/12/24 - 11:59:10:680] ZBOSS: zcl/zcl_common.c:215   >> zb_zcl_get_attribute_size: attr_type 0x29 attr_value 0x4081c9ce
[07/12/24 - 11:59:10:684] ZBOSS: zcl/zcl_common.c:348   << zb_zcl_get_attribute_size: result 2
[07/12/24 - 11:59:10:687] ZBOSS: zcl/zcl_common.c:215   >> zb_zcl_get_attribute_size: attr_type 0x21 attr_value 0x4081c9ce
[07/12/24 - 11:59:10:697] ZBOSS: zcl/zcl_common.c:348   << zb_zcl_get_attribute_size: result 2
[07/12/24 - 11:59:10:701] [   392][D][ZigbeeCore.cpp:83] addEndpoint(): Endpoint: 10, Device ID: 0x0302
[07/12/24 - 11:59:10:705] 
[07/12/24 - 11:59:10:705] Starting Zigbee...
[07/12/24 - 11:59:10:706] 
[07/12/24 - 11:59:10:706] [   393][D][ZigbeeCore.cpp:122] zigbeeInit(): Initialize Zigbee stack
[07/12/24 - 11:59:10:710] 
[07/12/24 - 11:59:10:710] ZBOSS: common/zb_init_default.c:181   ED build
[07/12/24 - 11:59:10:712] ZBOSS: common/zb_init_default.c:187   sizes: g_zb 7576 sched 224 bpool 16 nwk 912 aps 3040 addr 284 zdo 840
[07/12/24 - 11:59:10:716] ZBOSS: common/zb_init_default.c:196   sec 2
[07/12/24 - 11:59:10:719] ZBOSS: common/zb_init_default.c:198   zcl 768
[07/12/24 - 11:59:10:721] ZBOSS: common/zb_init_default.c:201   zll 960
[07/12/24 - 11:59:10:729] ZBOSS: common/zb_init_default.c:207   nvram 140
[07/12/24 - 11:59:10:731] ZBOSS: common/zb_init_default.c:210   buttons 200
[07/12/24 - 11:59:10:733] ZBOSS: common/zb_init_default.c:212   err_ind 4
[07/12/24 - 11:59:10:735] ZBOSS: common/zb_init_default.c:218   scheduler q size 80
[07/12/24 - 11:59:10:739] ZBOSS: common/zb_init_default.c:221   g_mac 816 g_imac 28
[07/12/24 - 11:59:10:742] ZBOSS: common/zb_init_default.c:225   Configurable mem build, use ZBOSS lib defaults = 0
[07/12/24 - 11:59:10:745] ZBOSS: common/zb_init_default.c:231   ZB_IOBUF_POOL_SIZE 80 ZB_NWK_IN_Q_SIZE 40 ZB_MAC_PENDING_QUEUE_SIZE 20 ZB_APS_DST_BINDING_TABLE_SIZE 16 ZB_APS
[07/12/24 - 11:59:10:752] _BIND_TRANS_TABLE_SIZE 20 ZB_N_APS_RETRANS_ENTRIES 27
[07/12/24 - 11:59:10:760] ZBOSS: common/zb_init_default.c:261   ZB_N_APS_KEY_PAIR_ARR_MAX_SIZE 8 ZB_IEEE_ADDR_TABLE_SIZE 64 ZB_NEIGHBOR_TABLE_SIZE 64 ZB_NWK_ROUTING_TABLE_SIZ
[07/12/24 - 11:59:10:767] E 0 ZB_APS_DUPS_TABLE_SIZE 32
[07/12/24 - 11:59:10:769] [   415][D][ZigbeeCore.cpp:129] zigbeeInit(): Register all Zigbee EPs in list
[07/12/24 - 11:59:10:773] ZBOSS: zdo/af_descriptor.c:357   ep_count 1
[07/12/24 - 11:59:10:775] [   418][I][ZigbeeCore.cpp:137] zigbeeInit(): List of registered Zigbee EPs:
[07/12/24 - 11:59:10:779] [   419][I][ZigbeeCore.cpp:139] zigbeeInit(): Device type: Temperature Sensor, Endpoint: 10, Device ID: 0x0302
[07/12/24 - 11:59:10:791] ZBOSS: common/zb_nvram.c:3190   ds_ver == 2
[07/12/24 - 11:59:10:793] ZBOSS: zdo/zdo_app_prod_conf.c:144   no production config block found
[07/12/24 - 11:59:10:796] ZBOSS: zdo/zdo_app_prod_conf.c:781   no valid production configuration found, signaling to application
[07/12/24 - 11:59:10:802] [   436][V][ZigbeeCore.cpp:332] esp_zb_app_signal_handler(): ZDO signal: ZDO Config Ready (0x17), status: ESP_FAIL
[07/12/24 - 11:59:10:808] [   438][I][ZigbeeCore.cpp:218] esp_zb_app_signal_handler(): Zigbee stack initialized
[07/12/24 - 11:59:10:812] ZBOSS: commissioning/bdb/zdo_commissioning_bdb.c:349   dev type 2, joined 1, ext_pan_id 1, authenticated 1, tclk_valid 1
[07/12/24 - 11:59:14:934] ZBOSS: nwk/nwk_join.c:186   low lqi 0
[07/12/24 - 11:59:14:936] ZBOSS: nwk/nwk_join.c:186   low lqi 0
[07/12/24 - 11:59:14:938] ZBOSS: nwk/nwk_join.c:186   low lqi 0
[07/12/24 - 11:59:14:939] ZBOSS: nwk/nwk_join.c:186   low lqi 0
[07/12/24 - 11:59:14:957] ZBOSS: zdo/zdo_app_join.c:771   CONGRATULATIONS! joined status 0, addr 0x8481, iface_id 0, ch 11, rejoin 1
[07/12/24 - 11:59:14:970] ZBOSS: zdo/zdo_app_join.c:773   xpanid 3a:63:5d:94:1c:56:10:7e
[07/12/24 - 11:59:14:973] ZBOSS: commissioning/bdb/zdo_commissioning_bdb.c:549   COMMISSIONING_STOP: app signal 6 comm status 0
[07/12/24 - 11:59:14:979] [  4775][I][ZigbeeCore.cpp:224] esp_zb_app_signal_handler(): Device started up in non factory-reset mode
[07/12/24 - 11:59:14:985] [  4776][I][ZigbeeCore.cpp:237] esp_zb_app_signal_handler(): Device rebooted
[07/12/24 - 11:59:14:989] [  4777][D][ZigbeeCore.cpp:454] searchBindings(): Requesting binding table for address 0x8481
[07/12/24 - 11:59:14:993] [  4780][D][ZigbeeCore.cpp:400] bindingTableCb(): Binding table callback for address 0x8481 with status 0
[07/12/24 - 11:59:15:006] [  4781][D][ZigbeeCore.cpp:403] bindingTableCb(): Binding table info: total 1, index 0, count 1
[07/12/24 - 11:59:15:011] [  4782][D][ZigbeeCore.cpp:413] bindingTableCb(): Binding table record: src_endp 10, dst_endp 1, cluster_id 0x0402, dst_addr_mode 3
[07/12/24 - 11:59:15:017] [  4783][D][ZigbeeCore.cpp:427] bindingTableCb(): Device bound to EP 10 -> device endpoint: 1, short addr: 0x0000, ieee addr: 94:34:69:FF:FE:0D:65:A9
[07/12/24 - 11:59:15:025] [  4784][D][ZigbeeCore.cpp:445] bindingTableCb(): Filling bounded devices finished
[07/12/24 - 11:59:15:029] 
[07/12/24 - 11:59:15:029] Zigbee started successfully!
[07/12/24 - 11:59:15:038] 
[07/12/24 - 11:59:15:038] Connecting to network
[07/12/24 - 11:59:15:039] 
[07/12/24 - 11:59:15:039] Updated temperature sensor value to 28.00°C
[07/12/24 - 11:59:15:040] [  4787][V][ZigbeeTempSensor.cpp:70] setTemperature(): Updating temperature sensor value...
[07/12/24 - 11:59:15:046] [  4788][D][ZigbeeTempSensor.cpp:72] setTemperature(): Setting temperature to 2800
[07/12/24 - 11:59:15:049] 
[07/12/24 - 11:59:15:049] =========== After Setup Start ============
[07/12/24 - 11:59:15:051] INTERNAL Memory Info:
[07/12/24 - 11:59:15:052] ------------------------------------------
[07/12/24 - 11:59:15:054]   Total Size        :   240976 B ( 235.3 KB)
[07/12/24 - 11:59:15:056]   Free Bytes        :   182072 B ( 177.8 KB)
[07/12/24 - 11:59:15:057]   Allocated Bytes   :    52888 B (  51.6 KB)
[07/12/24 - 11:59:15:060]   Minimum Free Bytes:   181960 B ( 177.7 KB)
[07/12/24 - 11:59:15:069]   Largest Free Block:   172020 B ( 168.0 KB)
[07/12/24 - 11:59:15:071] ------------------------------------------
[07/12/24 - 11:59:15:073] GPIO Info:
[07/12/24 - 11:59:15:074] ------------------------------------------
[07/12/24 - 11:59:15:076]   GPIO : BUS_TYPE[bus/unit][chan]
[07/12/24 - 11:59:15:077]   --------------------------------------  
[07/12/24 - 11:59:15:079]      9 : GPIO
[07/12/24 - 11:59:15:079]     23 : UART_RX[0]
[07/12/24 - 11:59:15:080]     24 : UART_TX[0]
[07/12/24 - 11:59:15:081]     26 : USB_DM
[07/12/24 - 11:59:15:082]     27 : USB_DP
[07/12/24 - 11:59:15:082] ============ After Setup End =============
[07/12/24 - 11:59:15:985] Updated temperature sensor value to 28.00°C
[07/12/24 - 11:59:15:993] 
[07/12/24 - 11:59:15:993] [  5790][V][ZigbeeTempSensor.cpp:70] setTemperature(): Updating temperature sensor value...
[07/12/24 - 11:59:15:998] [  5790][D][ZigbeeTempSensor.cpp:72] setTemperature(): Setting temperature to 2800
[07/12/24 - 11:59:16:044] [  5848][V][ZigbeeHandlers.cpp:134] zb_cmd_default_resp_handler(): Received default response: from address(0x0), src_endpoint(1) to dst_endpoint(10)
[07/12/24 - 11:59:16:054] , cluster(0x402) with status 0x0
[07/12/24 - 11:59:16:988] Updated temperature sensor value to 28.00°C
[07/12/24 - 11:59:16:991] [  6792][V][ZigbeeTempSensor.cpp:70] setTemperature(): Updating temperature sensor value...
[07/12/24 - 11:59:16:996] [  6792][D][ZigbeeTempSensor.cpp:72] setTemperature(): Setting temperature to 2800
[07/12/24 - 11:59:17:989] Updated temperature sensor value to 28.00°C
[07/12/24 - 11:59:18:005] [  7794][V][ZigbeeTempSensor.cpp:70] setTemperature(): Updating temperature sensor value...
[07/12/24 - 11:59:18:012] [  7794][D][ZigbeeTempSensor.cpp:72] setTemperature(): Setting temperature to 2800
[07/12/24 - 11:59:18:991] Updated temperature sensor value to 28.00°C
[07/12/24 - 11:59:18:999] [  8796][V][ZigbeeTempSensor.cpp:70] setTemperature(): Updating temperature sensor value...
[07/12/24 - 11:59:19:003] [  8796][D][ZigbeeTempSensor.cpp:72] setTemperature(): Setting temperature to 2800
[07/12/24 - 11:59:19:993] Updated temperature sensor value to 28.00°C
[07/12/24 - 11:59:19:996] [  9798][V][ZigbeeTempSensor.cpp:70] setTemperature(): Updating temperature sensor value...
[07/12/24 - 11:59:20:001] [  9798][D][ZigbeeTempSensor.cpp:72] setTemperature(): Setting temperature to 2800
[07/12/24 - 11:59:20:995] Updated temperature sensor value to 28.00°C
[07/12/24 - 11:59:20:998] [ 10800][V][ZigbeeTempSensor.cpp:70] setTemperature(): Updating temperature sensor value...
[07/12/24 - 11:59:21:005] [ 10801][D][ZigbeeTempSensor.cpp:72] setTemperature(): Setting temperature to 2800
[07/12/24 - 11:59:21:997] Updated temperature sensor value to 28.00°C
[07/12/24 - 11:59:22:002] [ 11802][V][ZigbeeTempSensor.cpp:70] setTemperature(): Updating temperature sensor value...
[07/12/24 - 11:59:22:006] [ 11802][D][ZigbeeTempSensor.cpp:72] setTemperature(): Setting temperature to 2800
[07/12/24 - 11:59:22:999] Updated temperature sensor value to 28.00°C
[07/12/24 - 11:59:23:003] [ 12804][V][ZigbeeTempSensor.cpp:70] setTemperature(): Updating temperature sensor value...
[07/12/24 - 11:59:23:007] [ 12804][D][ZigbeeTempSensor.cpp:72] setTemperature(): Setting temperature to 2800
[07/12/24 - 11:59:24:001] Updated temperature sensor value to 28.00°C
[07/12/24 - 11:59:24:005] [ 13806][V][ZigbeeTempSensor.cpp:70] setTemperature(): Updating temperature sensor value...
[07/12/24 - 11:59:24:010] [ 13806][D][ZigbeeTempSensor.cpp:72] setTemperature(): Setting temperature to 2800
[07/12/24 - 11:59:25:003] Updated temperature sensor value to 28.00°C
[07/12/24 - 11:59:25:006] [ 14808][V][ZigbeeTempSensor.cpp:70] setTemperature(): Updating temperature sensor value...
[07/12/24 - 11:59:25:011] [ 14809][D][ZigbeeTempSensor.cpp:72] setTemperature(): Setting temperature to 2800
[07/12/24 - 11:59:26:005] Updated temperature sensor value to 28.00°C
[07/12/24 - 11:59:26:008] [ 15810][V][ZigbeeTempSensor.cpp:70] setTemperature(): Updating temperature sensor value...
[07/12/24 - 11:59:26:012] [ 15810][D][ZigbeeTempSensor.cpp:72] setTemperature(): Setting temperature to 2800
[07/12/24 - 11:59:27:006] Updated temperature sensor value to 28.00°C
[07/12/24 - 11:59:27:011] [ 16812][V][ZigbeeTempSensor.cpp:70] setTemperature(): Updating temperature sensor value...
[07/12/24 - 11:59:27:017] [ 16812][D][ZigbeeTempSensor.cpp:72] setTemperature(): Setting temperature to 2800
[07/12/24 - 11:59:28:009] Updated temperature sensor value to 28.00°C
[07/12/24 - 11:59:28:013] [ 17814][V][ZigbeeTempSensor.cpp:70] setTemperature(): Updating temperature sensor value...
[07/12/24 - 11:59:28:022] [ 17815][D][ZigbeeTempSensor.cpp:72] setTemperature(): Setting temperature to 2800
[07/12/24 - 11:59:29:011] Updated temperature sensor value to 27.00°C
[07/12/24 - 11:59:29:015] [ 18816][V][ZigbeeTempSensor.cpp:70] setTemperature(): Updating temperature sensor value...
[07/12/24 - 11:59:29:019] [ 18817][D][ZigbeeTempSensor.cpp:72] setTemperature(): Setting temperature to 2700
[07/12/24 - 11:59:29:063] [ 18868][V][ZigbeeHandlers.cpp:134] zb_cmd_default_resp_handler(): Received default response: from address(0x0), src_endpoint(1) to dst_endpoint(10)
[07/12/24 - 11:59:29:074] , cluster(0x402) with status 0x0
[07/12/24 - 11:59:30:013] Updated temperature sensor value to 28.00°C
[07/12/24 - 11:59:30:016] [ 19818][V][ZigbeeTempSensor.cpp:70] setTemperature(): Updating temperature sensor value...
[07/12/24 - 11:59:30:022] [ 19818][D][ZigbeeTempSensor.cpp:72] setTemperature(): Setting temperature to 2800
[07/12/24 - 11:59:30:099] [ 19904][V][ZigbeeHandlers.cpp:134] zb_cmd_default_resp_handler(): Received default response: from address(0x0), src_endpoint(1) to dst_endpoint(10)
[07/12/24 - 11:59:30:108] , cluster(0x402) with status 0x0
[07/12/24 - 11:59:31:015] Updated temperature sensor value to 28.00°C

@P-R-O-C-H-Y
Copy link
Member

P-R-O-C-H-Y commented Dec 9, 2024

@michapr Does this happened only once or you can reproduce it? I have never saw this error.
One more question, with the changes from PR, is the issue with battery powered devices gone @Nawor3565? Were you able to test?

@michapr
Copy link
Author

michapr commented Dec 11, 2024

@michapr Does this happened only once or you can reproduce it? I have never saw this error.

Yes, could reproduce sometimes.

Will make next tests with latest PR, my latest sketch with changed lib was working stable.

@michapr
Copy link
Author

michapr commented Dec 11, 2024

Sleeping sample is working now fine, power on/off is working too.

I have added to the sleeping sketch a missing definition:
#define BOOT_PIN 9 //Boot button for C6/H2

Additional have added

#include <rom/rtc.h>
...

  // Delay approx 1s (may be adjusted) to allow establishing proper connection with coordinator, needed for sleepy devices
  //  delay(1000);
   if ( (int)rtc_get_reset_reason(0) != 5 )  {   //  SW_CPU_RESET=12 ,  POWERON_RESET=1 , DEEPSLEEP_RESET=5
     delay(20000);
   }

For Zigbee2MQTT the time is not enough for configure the sensor - so it will never report the values.
With the code for all cases will make the delay, but not for deep sleep reboot.
This is working fine for me since yesterday.
So no more problems here in this time.

Additional: the live time is now much shorter, about 2,5 seconds only ;) THANKS!

@michapr
Copy link
Author

michapr commented Dec 12, 2024

Have tested with H2 and C6 - sleeping device is working stable now for me.

A good idea maybe to add a delay after reporting before sleep, so that device have a chance to finish reporting.
I have seen before in Zigbee2MQTT that humidity reporting was missing in most cases.

  // Report temperature and humidity values
  zbTempSensor.reportTemperature();
  zbTempSensor.reportHumidity();
  delay(100);

@P-R-O-C-H-Y
Copy link
Member

Sleeping sample is working now fine, power on/off is working too.

I have added to the sleeping sketch a missing definition: #define BOOT_PIN 9 //Boot button for C6/H2

Additional have added

#include <rom/rtc.h>
...

  // Delay approx 1s (may be adjusted) to allow establishing proper connection with coordinator, needed for sleepy devices
  //  delay(1000);
   if ( (int)rtc_get_reset_reason(0) != 5 )  {   //  SW_CPU_RESET=12 ,  POWERON_RESET=1 , DEEPSLEEP_RESET=5
     delay(20000);
   }

For Zigbee2MQTT the time is not enough for configure the sensor - so it will never report the values. With the code for all cases will make the delay, but not for deep sleep reboot. This is working fine for me since yesterday. So no more problems here in this time.

Additional: the live time is now much shorter, about 2,5 seconds only ;) THANKS!

BOOT_PIN is declared in esp32-hal.h file for every SoC. No need for adding that :)

#if CONFIG_IDF_TARGET_ESP32 || CONFIG_IDF_TARGET_ESP32S2 || CONFIG_IDF_TARGET_ESP32S3

@P-R-O-C-H-Y
Copy link
Member

I am happy that it's now working also for you. I will add the delay after sending the last report. That sounds reasonable :)
Thank you very much @michapr for testing/debudding with me.

@michapr
Copy link
Author

michapr commented Dec 12, 2024

BOOT_PIN is declared in esp32-hal.h file for every SoC. No need for adding that :)

Strange,... I have got an error for H2 :)

So I can close this issue?

@P-R-O-C-H-Y
Copy link
Member

P-R-O-C-H-Y commented Dec 12, 2024

BOOT_PIN is declared in esp32-hal.h file for every SoC. No need for adding that :)

Strange,... I have got an error for H2 :)

So I can close this issue?

Idk its there:

#elif CONFIG_IDF_TARGET_ESP32C2 || CONFIG_IDF_TARGET_ESP32C3 || CONFIG_IDF_TARGET_ESP32C6 || CONFIG_IDF_TARGET_ESP32H2 || CONFIG_IDF_TARGET_ESP32C61
static const uint8_t BOOT_PIN = 9;

But this was added recently. Maybe you did not have that synced yet?

Anyway yes we can close this issue and maybe also the other one. If it's all fine now.
If anyone have any issue on this topic feel free to reopen on just comment. I will be following this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Zigbee Issues and Feature Request about Zigbee Chip: ESP32-C6 Issue is related to support of ESP32-C6 Chip Status: In Progress Issue is in progress
Projects
None yet
Development

No branches or pull requests

7 participants