Description
Board
Adafruit Feather ESP32-C6
Device Description
Occasionally, my Deep Sleep Zigbee apps crash during the Zigbee.begin() call. I finally caught the error in a log
I'm using library 3.2.1, but the error also occurred when using 3.2.0 .
This may occur anytime from 30 minutes to a few days. The app wakes up every 180 seconds and checks the temperature and attempts a Zigbee connection every 3 to 15 minutes, depending on the temperature value. I'm using the analog endpoint.
'''
2025-07-04 10:38:27 [ 3779][V][ESP32_C6H2_DeepSleep_Temperature_Sensor_V5.ino:365] initializeZigbee():
2025-07-04 10:38:27 Model: Temp Sensor V5 Jul 3 2025
2025-07-04 10:38:27
2025-07-04 10:38:27 [ 3790][V][ESP32_C6H2_DeepSleep_Temperature_Sensor_V5.ino:381] initializeZigbee(): Add Endpoints
2025-07-04 10:38:27
2025-07-04 10:38:27 [ 3801][D][ZigbeeCore.cpp:100] addEndpoint(): Endpoint: 1, Device ID: 0x000c
2025-07-04 10:38:27 [ 3808][D][ZigbeeCore.cpp:100] addEndpoint(): Endpoint: 2, Device ID: 0x000c
2025-07-04 10:38:27 [ 3815][D][ZigbeeCore.cpp:100] addEndpoint(): Endpoint: 3, Device ID: 0x000c
2025-07-04 10:38:27 [ 3822][D][ZigbeeCore.cpp:100] addEndpoint(): Endpoint: 4, Device ID: 0x000c
2025-07-04 10:38:27 [ 3829][D][ZigbeeCore.cpp:100] addEndpoint(): Endpoint: 5, Device ID: 0x000c
2025-07-04 10:38:27 [ 3836][D][ZigbeeCore.cpp:100] addEndpoint(): Endpoint: 6, Device ID: 0x000c
2025-07-04 10:38:27 [ 3844][D][ZigbeeCore.cpp:100] addEndpoint(): Endpoint: 8, Device ID: 0x000c
2025-07-04 10:38:27 [ 3851][V][ESP32_C6H2_DeepSleep_Temperature_Sensor_V5.ino:438] initializeZigbee(): Begin Zigbee
2025-07-04 10:38:27
2025-07-04 10:38:27 [ 3864][D][ZigbeeCore.cpp:148] zigbeeInit(): Initialize Zigbee stack
2025-07-04 10:38:27 [ 3887][D][ZigbeeCore.cpp:155] zigbeeInit(): Register all Zigbee EPs in list
2025-07-04 10:38:27 [ 3901][I][ZigbeeCore.cpp:163] zigbeeInit(): List of registered Zigbee EPs:
2025-07-04 10:38:27 [ 3908][I][ZigbeeCore.cpp:165] zigbeeInit(): Device type: Simple Sensor device, Endpoint: 1, Device ID: 0x000c
2025-07-04 10:38:27 [ 3918][I][ZigbeeCore.cpp:165] zigbeeInit(): Device type: Simple Sensor device, Endpoint: 2, Device ID: 0x000c
2025-07-04 10:38:27 [ 3928][I][ZigbeeCore.cpp:165] zigbeeInit(): Device type: Simple Sensor device, Endpoint: 3, Device ID: 0x000c
2025-07-04 10:38:27 [ 3938][I][ZigbeeCore.cpp:165] zigbeeInit(): Device type: Simple Sensor device, Endpoint: 4, Device ID: 0x000c
2025-07-04 10:38:28 [ 3948][I][ZigbeeCore.cpp:165] zigbeeInit(): Device type: Simple Sensor device, Endpoint: 5, Device ID: 0x000c
2025-07-04 10:38:28 [ 3958][I][ZigbeeCore.cpp:165] zigbeeInit(): Device type: Simple Sensor device, Endpoint: 6, Device ID: 0x000c
2025-07-04 10:38:28 [ 3968][I][ZigbeeCore.cpp:165] zigbeeInit(): Device type: Simple Sensor device, Endpoint: 8, Device ID: 0x000c
2025-07-04 10:38:28 [ 3997][V][ZigbeeCore.cpp:444] esp_zb_app_signal_handler(): ZDO signal: ZDO Config Ready (0x17), status: ESP_FAIL
2025-07-04 10:38:28 [ 4007][I][ZigbeeCore.cpp:257] esp_zb_app_signal_handler(): Zigbee stack initialized
2025-07-04 10:38:28 [ 4015][D][ZigbeeCore.cpp:258] esp_zb_app_signal_handler(): Zigbee channel mask: 0x02000000
2025-07-04 10:38:28 [ 4326][V][ZigbeeCore.cpp:444] esp_zb_app_signal_handler(): ZDO signal: NLME Status Indication (0x32), status: ESP_OK
2025-07-04 10:38:28 [ 4337][W][ZigbeeCore.cpp:292] esp_zb_app_signal_handler(): Commissioning failed, trying again...
2025-07-04 10:38:28 [ 4598][W][ZigbeeCore.cpp:292] esp_zb_app_signal_handler(): Commissioning failed, trying again...
2025-07-04 10:38:29 ESP_ERROR_CHECK failed: esp_err_t 0xffffffff (ESP_FAIL) at 0x42001772
file: "C:\Users\occam\AppData\Local\Arduino15\packages\esp32\hardware\esp32\3.2.1\libraries\Zigbee\src\ZigbeeCore.cpp" line 240
func: void bdb_start_top_level_commissioning_cb(uint8_t)
expression: esp_zb_bdb_start_top_level_commissioning(mode_mask)
ESP-ROM:esp32c6-20220919
2025-07-04 10:38:29 Build:Sep 19 2022
2025-07-04 10:38:29 rst:0xc (SW_CPU),boot:0x8 (SPI_FAST_FLASH_BOOT)
2025-07-04 10:38:29 Saved PC:0x4001975a
2025-07-04 10:38:29 SPIWP:0xee
2025-07-04 10:38:29 mode:DIO, clock div:2
2025-07-04 10:38:29 load:0x40875720,len:0x1260
2025-07-04 10:38:29 load:0x4086c110,len:0xdd0
2025-07-04 10:38:29 load:0x4086e610,len:0x3030
2025-07-04 10:38:29 entry 0x4086c110
2025-07-04 10:38:27 [ 3779][V][ESP32_C6H2_DeepSleep_Temperature_Sensor_V5.ino:365] initializeZigbee():
2025-07-04 10:38:27 Model: Temp Sensor V5 Jul 3 2025
2025-07-04 10:38:27
2025-07-04 10:38:27 [ 3790][V][ESP32_C6H2_DeepSleep_Temperature_Sensor_V5.ino:381] initializeZigbee(): Add Endpoints
2025-07-04 10:38:27
2025-07-04 10:38:27 [ 3801][D][ZigbeeCore.cpp:100] addEndpoint(): Endpoint: 1, Device ID: 0x000c
2025-07-04 10:38:27 [ 3808][D][ZigbeeCore.cpp:100] addEndpoint(): Endpoint: 2, Device ID: 0x000c
2025-07-04 10:38:27 [ 3815][D][ZigbeeCore.cpp:100] addEndpoint(): Endpoint: 3, Device ID: 0x000c
2025-07-04 10:38:27 [ 3822][D][ZigbeeCore.cpp:100] addEndpoint(): Endpoint: 4, Device ID: 0x000c
2025-07-04 10:38:27 [ 3829][D][ZigbeeCore.cpp:100] addEndpoint(): Endpoint: 5, Device ID: 0x000c
2025-07-04 10:38:27 [ 3836][D][ZigbeeCore.cpp:100] addEndpoint(): Endpoint: 6, Device ID: 0x000c
2025-07-04 10:38:27 [ 3844][D][ZigbeeCore.cpp:100] addEndpoint(): Endpoint: 8, Device ID: 0x000c
2025-07-04 10:38:27 [ 3851][V][ESP32_C6H2_DeepSleep_Temperature_Sensor_V5.ino:438] initializeZigbee(): Begin Zigbee
2025-07-04 10:38:27
2025-07-04 10:38:27 [ 3864][D][ZigbeeCore.cpp:148] zigbeeInit(): Initialize Zigbee stack
2025-07-04 10:38:27 [ 3887][D][ZigbeeCore.cpp:155] zigbeeInit(): Register all Zigbee EPs in list
2025-07-04 10:38:27 [ 3901][I][ZigbeeCore.cpp:163] zigbeeInit(): List of registered Zigbee EPs:
2025-07-04 10:38:27 [ 3908][I][ZigbeeCore.cpp:165] zigbeeInit(): Device type: Simple Sensor device, Endpoint: 1, Device ID: 0x000c
2025-07-04 10:38:27 [ 3918][I][ZigbeeCore.cpp:165] zigbeeInit(): Device type: Simple Sensor device, Endpoint: 2, Device ID: 0x000c
2025-07-04 10:38:27 [ 3928][I][ZigbeeCore.cpp:165] zigbeeInit(): Device type: Simple Sensor device, Endpoint: 3, Device ID: 0x000c
2025-07-04 10:38:27 [ 3938][I][ZigbeeCore.cpp:165] zigbeeInit(): Device type: Simple Sensor device, Endpoint: 4, Device ID: 0x000c
2025-07-04 10:38:28 [ 3948][I][ZigbeeCore.cpp:165] zigbeeInit(): Device type: Simple Sensor device, Endpoint: 5, Device ID: 0x000c
2025-07-04 10:38:28 [ 3958][I][ZigbeeCore.cpp:165] zigbeeInit(): Device type: Simple Sensor device, Endpoint: 6, Device ID: 0x000c
2025-07-04 10:38:28 [ 3968][I][ZigbeeCore.cpp:165] zigbeeInit(): Device type: Simple Sensor device, Endpoint: 8, Device ID: 0x000c
2025-07-04 10:38:28 [ 3997][V][ZigbeeCore.cpp:444] esp_zb_app_signal_handler(): ZDO signal: ZDO Config Ready (0x17), status: ESP_FAIL
2025-07-04 10:38:28 [ 4007][I][ZigbeeCore.cpp:257] esp_zb_app_signal_handler(): Zigbee stack initialized
2025-07-04 10:38:28 [ 4015][D][ZigbeeCore.cpp:258] esp_zb_app_signal_handler(): Zigbee channel mask: 0x02000000
2025-07-04 10:38:28 [ 4326][V][ZigbeeCore.cpp:444] esp_zb_app_signal_handler(): ZDO signal: NLME Status Indication (0x32), status: ESP_OK
2025-07-04 10:38:28 [ 4337][W][ZigbeeCore.cpp:292] esp_zb_app_signal_handler(): Commissioning failed, trying again...
2025-07-04 10:38:28 [ 4598][W][ZigbeeCore.cpp:292] esp_zb_app_signal_handler(): Commissioning failed, trying again...
2025-07-04 10:38:29 ESP_ERROR_CHECK failed: esp_err_t 0xffffffff (ESP_FAIL) at 0x42001772
file: "C:\Users\occam\AppData\Local\Arduino15\packages\esp32\hardware\esp32\3.2.1\libraries\Zigbee\src\ZigbeeCore.cpp" line 240
func: void bdb_start_top_level_commissioning_cb(uint8_t)
expression: esp_zb_bdb_start_top_level_commissioning(mode_mask)
ESP-ROM:esp32c6-20220919
2025-07-04 10:38:29 Build:Sep 19 2022
2025-07-04 10:38:29 rst:0xc (SW_CPU),boot:0x8 (SPI_FAST_FLASH_BOOT)
2025-07-04 10:38:29 Saved PC:0x4001975a
2025-07-04 10:38:29 SPIWP:0xee
2025-07-04 10:38:29 mode:DIO, clock div:2
2025-07-04 10:38:29 load:0x40875720,len:0x1260
2025-07-04 10:38:29 load:0x4086c110,len:0xdd0
2025-07-04 10:38:29 load:0x4086e610,len:0x3030
2025-07-04 10:38:29 entry 0x4086c110
'''
Hardware Configuration
DS1820B ... but error occurs on boards with nothing attached
Version
v3.2.1
IDE Name
Arduino IDE
Operating System
Windows 11
Flash frequency
80 Mhz
PSRAM enabled
no
Upload speed
921600
Description
Occurred: Zigbee library error during Zigbee.begin() results in SW_CPU restart due to ambiguous ESP_FAIL error
Sketch
bool initializeZigbee(bool doFactoryReset) {
//Start Zigbee and Connnect
#if defined(LOG_LOCATION)
logLocation(8);
#endif
preferences.begin("Zigbee", false); // Save Factory Reset status in flash so
bool enrolled = preferences.getBool("ENROLLED"); // after the next restart it goes to persistent sleep
preferences.end();
esp_task_wdt_reset();
// Optional: set Zigbee device name and model
log_v("\r\nModel: %s\r\n",model);
zbAnalogDevice.setManufacturerAndModel("Occam", model);
// Set minimum and maximum temperature measurement value (10-50°C is default range for chip temperature measurement)
//zbTempSensor.setMinMaxValue(-30,80); // NB. If the temperature value is lower than the set minimum, a garbage is reported
// Set tolerance for temperature measurement in °C (lowest possible value is 0.01°C)
//zbTempSensor.setTolerance(0.01);
//Set Power Source
zbAnalogDevice.setPowerSource(ZB_POWER_SOURCE_BATTERY, 100);
// Add humidity cluster to the temperature sensor device with min, max and tolerance values
//zbTempSensor.addHumiditySensor(0, 101, 0.01);
// Add endpoint to Zigbee Core
log_v("Add Endpoints\r\n");
//Zigbee.addEndpoint(&zbTempSensor);
zbAnalogDevice.addAnalogInput();
zbAnalogDevice.setAnalogInputApplication(ESP_ZB_ZCL_AI_TEMPERATURE_OTHER);
zbAnalogDevice.setAnalogInputDescription("Temperature");
zbAnalogDevice.setAnalogInputResolution(0.01);
zbLookupBatteryPct.addAnalogInput();
zbLookupBatteryPct.setAnalogInputApplication(ESP_ZB_ZCL_AI_PERCENTAGE_OTHER);
zbLookupBatteryPct.setAnalogInputDescription("Battery Lookup Percent");
zbLookupBatteryPct.setAnalogInputResolution(0.01);
zbBatteryVoltage.addAnalogInput();
zbBatteryVoltage.setAnalogInputApplication(ESP_ZB_ZCL_AI_PERCENTAGE_OTHER);
zbBatteryVoltage.setAnalogInputDescription("Wake Count");
zbBatteryVoltage.setAnalogInputResolution(0.01);
zbBatteryPct.addAnalogInput();
zbBatteryPct.setAnalogInputApplication(ESP_ZB_ZCL_AI_PERCENTAGE_OTHER);
zbBatteryPct.setAnalogInputDescription("Cycle Count");
zbBatteryPct.setAnalogInputResolution(0.01);
zblastLocation.addAnalogInput();
zblastLocation.setAnalogInputApplication(ESP_ZB_ZCL_AI_PERCENTAGE_OTHER);
zblastLocation.setAnalogInputDescription("Last Location");
zblastLocation.setAnalogInputResolution(0.01);
zbstartTime.addAnalogInput();
zbstartTime.setAnalogInputApplication(ESP_ZB_ZCL_AI_PERCENTAGE_OTHER);
zbstartTime.setAnalogInputDescription("Start Time");
zbstartTime.setAnalogInputResolution(0.01);
Zigbee.addEndpoint(&zbAnalogDevice);
Zigbee.addEndpoint(&zbLookupBatteryPct);
Zigbee.addEndpoint(&zbBatteryVoltage);
Zigbee.addEndpoint(&zbBatteryPct);
Zigbee.addEndpoint(&zblastLocation);
Zigbee.addEndpoint(&zbstartTime);
zbElectricalMeasurement.addACMeasurement(ZIGBEE_AC_MEASUREMENT_TYPE_VOLTAGE, ZIGBEE_AC_PHASE_TYPE_A);
zbElectricalMeasurement.setACMultiplierDivisor(ZIGBEE_AC_MEASUREMENT_TYPE_VOLTAGE, 1, 1000);
Zigbee.addEndpoint(&zbElectricalMeasurement);
// Create a custom Zigbee configuration for End Device with keep alive 10s to avoid interference with reporting data
esp_zb_cfg_t zigbeeConfig = ZIGBEE_DEFAULT_ED_CONFIG();
zigbeeConfig.nwk_cfg.zed_cfg.keep_alive = 15000;
// For battery powered devices, it can be better to set timeout for Zigbee Begin to lower value to save battery
// If the timeout has been reached, the network channel mask will be reset and the device will try to connect again after reset (scanning all channels)
Zigbee.setTimeout(15000); // Set timeout for Zigbee Begin to 10s (default is 30s)
esp_task_wdt_reset();
startTime = millis();
log_v("Begin Zigbee\r\n");
// When all EPs are registered, start Zigbee in End Device mode
#if defined(LOG_LOCATION)
logLocation(9);
#endif
if (!Zigbee.begin(&zigbeeConfig, false)) {
#if defined(LOG_LOCATION)
logLocation(10);
#endif
#if defined(SERIAL_LOG)
log_w("Zigbee failed to start @ cycle: %d\r\n",cycleCount);
#endif
#if defined(LOG)
myLog.print("Failed to start @ cycle: " ); myLog.println(cycleCount);
#endif
...
Debug Message
see above
Other Steps to Reproduce
No response
I have checked existing issues, online documentation and the Troubleshooting Guide
- I confirm I have checked existing issues, online documentation and Troubleshooting guide.