Skip to content

ESP crashes when trying to connect to zigbee network #11354

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

Open
1 task done
vatsake opened this issue May 13, 2025 · 14 comments
Open
1 task done

ESP crashes when trying to connect to zigbee network #11354

vatsake opened this issue May 13, 2025 · 14 comments
Assignees
Labels
Area: Zigbee Issues and Feature Request about Zigbee

Comments

@vatsake
Copy link

vatsake commented May 13, 2025

Board

ESP32-H2-MINI-1

Device Description

Plain module

Hardware Configuration

No, just USB-C.

Version

latest stable Release (if not listed below)

IDE Name

Arduino IDE

Operating System

Win 11

Flash frequency

64Mhz

PSRAM enabled

yes

Upload speed

115200

Description

I've created a zigbee network with Aruba APs.
Using the scan networks example, it finds the network.
09:36:32.411 -> Nr | PAN ID | CH | Permit Joining | Router Capacity | End Device Capacity | Extended PAN ID
09:36:32.411 -> 1 | 0xa177 | 13 | Yes | Yes | Yes | 28:de:65...
09:36:32.411 -> 2 | 0xa177 | 11 | Yes | Yes | Yes | 28:de:65...
09:36:32.450 -> 3 | 0xa177 | 19 | Yes | Yes | Yes | 28:de:65...
09:36:32.450 -> 4 | 0xa177 | 11 | Yes | Yes | Yes | 28:de:65...
09:36:32.450 -> 5 | 0xa177 | 14 | Yes | Yes | Yes | 28:de:65...
09:36:32.450 -> 6 | 0xa177 | 20 | Yes | Yes | Yes | 28:de:65...

Sketch

// 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"

/* Zigbee temperature sensor configuration */
#define TEMP_SENSOR_ENDPOINT_NUMBER 10
uint8_t button = BOOT_PIN;

// Optional Time cluster variables
struct tm timeinfo;
struct tm *localTime;
int32_t timezone;

ZigbeeTempSensor zbTempSensor = ZigbeeTempSensor(TEMP_SENSOR_ENDPOINT_NUMBER);


/********************* Arduino functions **************************/
void setup() {
  Serial.begin(115200);

  // Init button switch
  pinMode(button, INPUT_PULLUP);

  // 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);

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

  // Optional: Time cluster configuration (default params, as this device will revieve time from coordinator)
  zbTempSensor.addTimeCluster();

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

    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);

  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("Connected");

  // Optional: If time cluster is added, time can be read from the coordinator
  timeinfo = zbTempSensor.getTime();
  timezone = zbTempSensor.getTimezone();

  Serial.println("UTC time:");
  Serial.println(&timeinfo, "%A, %B %d %Y %H:%M:%S");

  time_t local = mktime(&timeinfo) + timezone;
  localTime = localtime(&local);

  Serial.println("Local time with timezone:");
  Serial.println(localTime, "%A, %B %d %Y %H:%M:%S");

  // 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 0,1 °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);
}

void loop() {
  // Checking button for factory reset
  if (digitalRead(button) == LOW) {  // Push button pressed
    // Key debounce handling
    delay(100);
    int startTime = millis();
    while (digitalRead(button) == 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();
  }
  delay(100);
}

Debug Message

09:33:07.461 -> ESP-ROM:esp32h2-20221101
09:33:07.504 -> Build:Nov  1 2022
09:33:07.504 -> rst:0xc (SW_CPU),boot:0xc (SPI_FAST_FLASH_BOOT)
09:33:07.504 -> Saved PC:0x400031b6
09:33:07.504 -> SPIWP:0xee
09:33:07.504 -> mode:DIO, clock div:1
09:33:07.504 -> load:0x408460e0,len:0x11fc
09:33:07.504 -> load:0x4083cad0,len:0xe00
09:33:07.504 -> load:0x4083efd0,len:0x2ea8
09:33:07.504 -> entry 0x4083cad0
09:33:07.969 -> Updated temperature sensor value to 19.00°C
09:33:07.969 -> �[0;31mE (475) ZB OSIF: Zigbee lock is not ready!�[0m
09:33:08.014 -> ZB_TRACE_LOG[0]: common/zb_debug.c:64    Assertion failed /builds/thread_zigbee/esp-zboss/components/zboss_stack/zboss/zcl/zcl_general_commands.c:608
09:33:08.014 -> Zigbee stack assertion failed zcl/zcl_general_commands.c:608
09:33:08.014 -> 
09:33:08.387 -> abort() was called at PC 0x4201eb0f on core 0
09:33:08.387 -> Core  0 register dump:
09:33:08.387 -> MEPC    : 0x4080163a  RA      : 0x40806066  SP      : 0x4081c230  GP      : 0x4080d354  
09:33:08.387 -> TP      : 0x4081c460  T0      : 0x37363534  T1      : 0x7271706f  T2      : 0x33323130  
09:33:08.387 -> S0/FP   : 0x4081c25c  S1      : 0x4081c25c  A0      : 0x4081c268  A1      : 0x4081c24a  
09:33:08.387 -> A2      : 0x00000000  A3      : 0x4081c295  A4      : 0x00000001  A5      : 0x40814000  
09:33:08.387 -> A6      : 0x00000000  A7      : 0x76757473  S2      : 0x0000ffff  S3      : 0x00000402  
09:33:08.387 -> S4      : 0x00000001  S5      : 0x0000000a  S6      : 0x00000001  S7      : 0x4081c37e  
09:33:08.387 -> S8      : 0x00000000  S9      : 0x00000000  S10     : 0x00000000  S11     : 0x00000000  
09:33:08.387 -> T3      : 0x6e6d6c6b  T4      : 0x6a696867  T5      : 0x66656463  T6      : 0x62613938  
09:33:08.387 -> MSTATUS : 0x00001881  MTVEC   : 0x40800001  MCAUSE  : 0x00000002  MTVAL   : 0x00000000  
09:33:08.387 -> MHARTID : 0x00000000  
09:33:08.387 -> 
09:33:08.387 -> Stack memory:
09:33:08.387 -> 4081c230: 0x00000000 0x00000000 0x4081c248 0x4080ba1a 0x00000001 0x0000000a 0x00000030 0x4080e790
09:33:08.387 -> 4081c250: 0x4081c25c 0x4080e7ac 0x4081c248 0x31303234 0x66306265 0x00000000 0x726f6261 0x20292874
09:33:08.387 -> 4081c270: 0x20736177 0x6c6c6163 0x61206465 0x43502074 0x34783020 0x65313032 0x20663062 0x63206e6f
09:33:08.387 -> 4081c290: 0x2065726f 0x00000030 0x00000000 0xebd36353 0x0000002f 0x00000260 0x420c95fd 0x4201eb12
09:33:08.387 -> 4081c2b0: 0x00000260 0x0000000a 0x00000001 0x00000402 0x0000ffff 0x00000000 0x0000000a 0x420457b0
09:33:08.387 -> 4081c2d0: 0x00000402 0x00000000 0x0000ffff 0x42073d64 0x00000000 0x00000000 0x00000000 0x00000402
09:33:08.387 -> 4081c2f0: 0x420c8000 0x00000000 0x4080f000 0x420457cc 0x20646574 0x706d6574 0x74617265 0x4204255c
09:33:08.387 -> 4081c310: 0x0000000a 0x00000001 0x00000402 0x00000000 0x302e3931 0x43b0c230 0x40814000 0x00000000
09:33:08.387 -> 4081c330: 0x00000000 0x00000000 0x41980000 0x420e3000 0x4080f000 0x4080ea30 0x4080f000 0x420075ee
09:33:08.387 -> 4081c350: 0x4080f000 0x4080ea30 0x4080f000 0x42002a26 0x4080f000 0x4080ea9c 0x0000000c 0x4081c388
09:33:08.387 -> 4081c370: 0x4080f000 0x4080ea9c 0x4080ea30 0x076c017a 0x0000000a 0x00000032 0x41980000 0x420e3000
09:33:08.387 -> 4081c390: 0x4080f000 0x4080f000 0x4080f000 0x42000184 0x00000000 0x00000000 0x00000000 0x00000000
09:33:08.387 -> 4081c3b0: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x4080cd98 0x00000001 0x4200593c
09:33:08.387 -> 4081c3d0: 0x4081c460 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
09:33:08.387 -> 4081c3f0: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
09:33:08.387 -> 4081c410: 0x00000000 0x00000000 0x00000000 0x420064a8 0x00000000 0x00000000 0x00000000 0x40806e8c
09:33:08.387 -> 4081c430: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
09:33:08.387 -> 4081c450: 0x00000000 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 0xbaad5678
09:33:08.387 -> 4081c470: 0x00000168 0xabba1234 0x0000015c 0x4081c120 0x00000000 0x40811afc 0x40811afc 0x4081c47c
09:33:08.387 -> 4081c490: 0x40811af4 0x00000018 0x00000000 0x00000000 0x4081c47c 0x00000000 0x00000001 0x4081a46c
09:33:08.387 -> 4081c4b0: 0x706f6f6c 0x6b736154 0x00000000 0x00000000 0x4081c460 0x00000005 0x00000000 0x00000001
09:33:08.387 -> 4081c4d0: 0x00000000 0x00000000 0x00000000 0x0000027d 0x00000000 0x408147a4 0x4081480c 0x40814874
09:33:08.387 -> 4081c4f0: 0x00000000 0x00000000 0x00000001 0x00000000 0x00000000 0x4081d234 0x40011484 0x00000000
09:33:08.387 -> 4081c510: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
09:33:08.387 -> 4081c530: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
09:33:08.387 -> 4081c550: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
09:33:08.387 -> 4081c570: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
09:33:08.387 -> 4081c590: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
09:33:08.387 -> 4081c5b0: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
09:33:08.387 -> 4081c5d0: 0x00000000 0x00000000 0xbaad5678 0x00000068 0xabba1234 0x0000005c 0x00000000 0x4081c5e8
09:33:08.387 -> 4081c5f0: 0x00000000 0x00000000 0x00000000 0x4081c600 0xffffffff 0x4081c600 0x4081c600 0x00000000
09:33:08.387 -> 4081c610: 0x4081c614 0xffffffff 0x4081c614 0x4081c614 0x00000001 0x00000001 0x00000000 0xf400ffff
09:33:08.387 -> 
09:33:08.387 -> 
09:33:08.387 -> 
09:33:08.387 -> ELF file SHA256: 005cb3076
09:33:08.387 -> 
09:33:08.513 -> Rebooting...
09:33:08.513 -> ESP-ROM:esp32h2-20221101
09:33:08.513 -> Build:Nov  1 2022
09:33:08.513 -> rst:0xc (SW_CPU),boot:0xc (SPI_FAST_FLASH_BOOT)
09:33:08.513 -> Saved PC:0x400031b6
09:33:08.513 -> SPIWP:0xee
09:33:08.513 -> mode:DIO, clock div:1
09:33:08.513 -> load:0x408460e0,len:0x11fc
09:33:08.513 -> load:0x4083cad0,len:0xe00
09:33:08.513 -> load:0x4083efd0,len:0x2ea8
09:33:08.513 -> entry 0x4083cad0

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.
@vatsake vatsake added the Status: Awaiting triage Issue is waiting for triage label May 13, 2025
@SuGlider SuGlider added the Area: Zigbee Issues and Feature Request about Zigbee label May 13, 2025
@P-R-O-C-H-Y P-R-O-C-H-Y self-assigned this May 14, 2025
@P-R-O-C-H-Y
Copy link
Member

@vatsake You cannot set the temp when the device is not connected. Please move:

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);

After Zigbee.begin() or better after Zigbee.connected().
You can take a look to the examples to see how to do that correct way.

@P-R-O-C-H-Y P-R-O-C-H-Y removed the Status: Awaiting triage Issue is waiting for triage label May 14, 2025
@vatsake
Copy link
Author

vatsake commented May 14, 2025

@P-R-O-C-H-Y Thanks for the reply, I moved them after zigbee is connected, but nothing changed.
Serial doesn't print "Connected" (which is after the while loop), so it crashes during connection.

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

Can you set:
Core Debug level -> Verbose
Zigbee mode -> Zigbee ED (end device) - Debug
and post a new log please?

@vatsake
Copy link
Author

vatsake commented May 14, 2025

========== Before Setup Start ===========
Chip Info:
------------------------------------------
  Model             : ESP32-H2
  Package           : 0
  Revision          : 0.01
  Cores             : 1
  CPU Frequency     : 96 MHz
  XTAL Frequency    : 32 MHz
  Features Bitfield : 0x00000050
  Embedded Flash    : No
  Embedded PSRAM    : No
  2.4GHz WiFi       : No
  Classic BT        : No
  BT Low Energy     : Yes
  IEEE 802.15.4     : Yes
------------------------------------------
INTERNAL Memory Info:
------------------------------------------
  Total Size        :   250120 B ( 244.3 KB)
  Free Bytes        :   211448 B ( 206.5 KB)
  Allocated Bytes   :    31832 B (  31.1 KB)
  Minimum Free Bytes:   211448 B ( 206.5 KB)
  Largest Free Block:   196596 B ( 192.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         : 64 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 : May 14 2025 10:54:42
  Compile Host OS   : windows
  ESP-IDF Version   : v5.4.1-1-g2f7dcd862a-dirty
  Arduino Version   : 3.2.0
------------------------------------------
Board Info:
------------------------------------------
  Arduino Board     : ESP32H2_DEV
  Arduino Variant   : esp32h2
  Arduino FQBN      : esp32:esp32:esp32h2:UploadSpeed=921600,CDCOnBoot=default,FlashFreq=64,FlashMode=qio,FlashSize=4M,PartitionScheme=zigbee,DebugLevel=verbose,EraseFlash=none,JTAGAdapter=default,ZigbeeMode=ed_debug
============ Before Setup End ============
[   469][V][esp32-hal-uart.c:552] uartBegin(): UART0 baud(115200) Mode(800001c) rxPin(23) txPin(24)
[   478][V][esp32-hal-uart.c:650] uartBegin(): UART0 not installed. Starting installation
[   486][V][esp32-hal-uart.c:660] uartBegin(): UART0 RX FIFO full threshold set to 120 (value requested: 120 || FIFO Max = 128)
[   497][V][esp32-hal-uart.c:677] uartBegin(): Setting UART0 to use XTAL clock
[   505][V][esp32-hal-uart.c:732] uartBegin(): UART0 initialization done.
[   512][V][esp32-hal-uart.c:783] uartSetRxFIFOFull(): UART0 RX FIFO Full value set to 120 from a requested value of 120
[   522][V][esp32-hal-periman.c:235] perimanSetBusDeinit(): Deinit function for type GPIO (1) successfully set to 0x420054aa
[   534][V][esp32-hal-periman.c:160] perimanSetPinBus(): Pin 9 successfully set to type GPIO (1) with bus 0xa
[   544][D][ZigbeeCore.cpp:97] addEndpoint(): Endpoint: 10, Device ID: 0x0302
Starting Zigbee...
[   551][D][ZigbeeCore.cpp:145] zigbeeInit(): Initialize Zigbee stack
[   570][D][ZigbeeCore.cpp:152] zigbeeInit(): Register all Zigbee EPs in list
[   579][I][ZigbeeCore.cpp:160] zigbeeInit(): List of registered Zigbee EPs:
[   586][I][ZigbeeCore.cpp:162] zigbeeInit(): Device type: Temperature Sensor, Endpoint: 10, Device ID: 0x0302
[   624][V][ZigbeeCore.cpp:379] esp_zb_app_signal_handler(): ZDO signal: ZDO Config Ready (0x17), status: ESP_FAIL
[   635][I][ZigbeeCore.cpp:241] esp_zb_app_signal_handler(): Zigbee stack initialized
[   642][D][ZigbeeCore.cpp:242] esp_zb_app_signal_handler(): Zigbee channel mask: 0x07fff800
[   655][I][ZigbeeCore.cpp:248] esp_zb_app_signal_handler(): Device started up in  factory-reset mode
[   664][I][ZigbeeCore.cpp:255] esp_zb_app_signal_handler(): Start network steering
Zigbee started successfully!
Connecting to network
....................ZB_TRACE_LOG[0]: mac/mac.c:1045    Oops - error beacon payload is too small buf_sz 13 - drop it
...ZB_TRACE_LOG[0]: nwk/nwk_join.c:186    low lqi 20
ZB_TRACE_LOG[0]: nwk/nwk_join.c:186    low lqi 15
ZB_TRACE_LOG[0]: nwk/nwk_join.c:186    low lqi 0
.....ZB_TRACE_LOG[0]: mac/mac_data.c:835    polling during association error: 217
ZB_TRACE_LOG[0]: nwk/nwk_join.c:186    low lqi 20
ZB_TRACE_LOG[0]: nwk/nwk_join.c:186    low lqi 15
ZB_TRACE_LOG[0]: nwk/nwk_join.c:186    low lqi 0
ZB_TRACE_LOG[0]: nwk/nwk_join.c:251    No dev for join
ZB_TRACE_LOG[0]: nwk/nwk_join.c:186    low lqi 20
ZB_TRACE_LOG[0]: nwk/nwk_join.c:186    low lqi 15
ZB_TRACE_LOG[0]: nwk/nwk_join.c:186    low lqi 0
ZB_TRACE_LOG[0]: nwk/nwk_join.c:251    No dev for join
ZB_TRACE_LOG[0]: nwk/nwk_join.c:186    low lqi 20
ZB_TRACE_LOG[0]: nwk/nwk_join.c:186    low lqi 15
ZB_TRACE_LOG[0]: nwk/nwk_join.c:186    low lqi 0
ZB_TRACE_LOG[0]: nwk/nwk_join.c:251    No dev for join
ZB_TRACE_LOG[0]: nwk/nwk_join.c:186    low lqi 20
ZB_TRACE_LOG[0]: nwk/nwk_join.c:186    low lqi 15
ZB_TRACE_LOG[0]: nwk/nwk_join.c:186    low lqi 0
ZB_TRACE_LOG[0]: nwk/nwk_join.c:251    No dev for join
ZB_TRACE_LOG[0]: nwk/nwk_join.c:186    low lqi 20
ZB_TRACE_LOG[0]: nwk/nwk_join.c:186    low lqi 15
ZB_TRACE_LOG[0]: nwk/nwk_join.c:186    low lqi 0
ZB_TRACE_LOG[0]: nwk/nwk_join.c:251    No dev for join
ZB_TRACE_LOG[0]: nwk/nwk_join.c:186    low lqi 20
ZB_TRACE_LOG[0]: nwk/nwk_join.c:186    low lqi 15
ZB_TRACE_LOG[0]: nwk/nwk_join.c:186    low lqi 0
ZB_TRACE_LOG[0]: nwk/nwk_join.c:251    No dev for join
ZB_TRACE_LOG[0]: mac/mac.c:2273    got unexpected association resp
ZB_TRACE_LOG[0]: nwk/nwk_join.c:186    low lqi 20
ZB_TRACE_LOG[0]: nwk/nwk_join.c:186    low lqi 15
ZB_TRACE_LOG[0]: nwk/nwk_join.c:186    low lqi 0
ZB_TRACE_LOG[0]: nwk/nwk_join.c:251    No dev for join
ZB_TRACE_LOG[0]: nwk/nwk_join.c:186    low lqi 20
ZB_TRACE_LOG[0]: nwk/nwk_join.c:186    low lqi 15
ZB_TRACE_LOG[0]: nwk/nwk_join.c:186    low lqi 0
ZB_TRACE_LOG[0]: nwk/nwk_join.c:251    No dev for join
ZB_TRACE_LOG[0]: nwk/nwk_join.c:186    low lqi 20
ZB_TRACE_LOG[0]: nwk/nwk_join.c:251    No dev for join
ZB_TRACE_LOG[0]: zdo/zdo_commissioning.c:212    Can't find PAN to join to! param 0
[  3667][I][ZigbeeCore.cpp:317] esp_zb_app_signal_handler(): Network steering was not successful (status: ESP_FAIL)
.................................ZB_TRACE_LOG[0]: nwk/nwk_join.c:186    low lqi 0
ZB_TRACE_LOG[0]: nwk/nwk_join.c:186    low lqi 0
ZB_TRACE_LOG[0]: nwk/nwk_join.c:186    low lqi 0
.....ZB_TRACE_LOG[0]: mac/mac_data.c:835    polling during association error: 233
ZB_TRACE_LOG[0]: nwk/nwk_join.c:186    low lqi 0
ZB_TRACE_LOG[0]: nwk/nwk_join.c:186    low lqi 0
ZB_TRACE_LOG[0]: nwk/nwk_join.c:186    low lqi 0
.....ZB_TRACE_LOG[0]: common/zb_debug.c:64    Assertion failed /builds/thread_zigbee/esp-zboss/components/zboss_stack/zboss/nwk/nwk_join.c:448
Zigbee stack assertion failed nwk/nwk_join.c:448
abort() was called at PC 0x42020d05 on core 0
Core  0 register dump:
MEPC    : 0x4080163a  RA      : 0x40806066  SP      : 0x40823870  GP      : 0x4080d354  
TP      : 0x40823a20  T0      : 0x37363534  T1      : 0x7271706f  T2      : 0x33323130  
S0/FP   : 0x4082389c  S1      : 0x4082389c  A0      : 0x408238a8  A1      : 0x4082388a  
A2      : 0x00000000  A3      : 0x408238d5  A4      : 0x00000001  A5      : 0x40814000  
A6      : 0x00000000  A7      : 0x76757473  S2      : 0x00000007  S3      : 0x00000001  
S4      : 0x40820a32  S5      : 0x00000037  S6      : 0x00000000  S7      : 0x00000038  
S8      : 0x00000000  S9      : 0x00000000  S10     : 0x00000000  S11     : 0x00000000  
T3      : 0x6e6d6c6b  T4      : 0x6a696867  T5      : 0x66656463  T6      : 0x62613938  
MSTATUS : 0x00001881  MTVEC   : 0x40800001  MCAUSE  : 0x00000002  MTVAL   : 0x00000000  
MHARTID : 0x00000000  
Stack memory:
40823870: 0x00000000 0x00000000 0x40823888 0x4080ba1a 0x00000000 0x00000037 0x40820030 0x4080e790
40823890: 0x4082389c 0x4080e7ac 0x40823888 0x32303234 0x35306430 0x00000000 0x726f6261 0x20292874
408238b0: 0x20736177 0x6c6c6163 0x61206465 0x43502074 0x34783020 0x30323032 0x20353064 0x63206e6f
408238d0: 0x2065726f 0x00000030 0x00000000 0x3b5249f1 0x0000002f 0x000001c0 0x420c3a89 0x42020d08
408238f0: 0x000001c0 0x00000037 0x40820a32 0x00000001 0x00000007 0x00000000 0x4081cbd4 0x42033ae8
40823910: 0x00000028 0x000000de 0x00000065 0x000000ff 0x000000fe 0x000000f0 0x0000003d 0x0000002f
40823930: 0x00000001 0x00000000 0x00000007 0x00075f68 0x40820a32 0xfef03d2f 0x28de65ff 0x0082396c
40823950: 0xfef03d2f 0x00000000 0x004b7906 0x42033616 0x00000001 0x00000000 0x00000007 0x420292a6
40823970: 0x00000007 0x00000038 0x00000000 0x00000000 0x42033616 0x00070000 0x40821300 0x40806d06
40823990: 0x00000000 0x408181d0 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
408239b0: 0x00000000 0x00000000 0x00000000 0x4205abc4 0x00000000 0x00000000 0x40814000 0x4200b762
408239d0: 0x00000000 0x00000000 0x00000000 0x4200b770 0x00000000 0x00000000 0x00000000 0x40806e8c
408239f0: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
40823a10: 0x00000000 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 0xbaad5678 0x00029951 0x40813dc4
40823a30: 0x40813dc4 0xdffffebe 0x000c10a1 0x03510254 0xfbfbd9ee 0xf9d77caf 0x1848908f 0xa840b0cf
40823a50: 0x9fa3ebe7 0xef7fbf9f 0x24a00144 0x91904402 0xb5626f5a 0xf53d739e 0x10298c80 0x20910000
40823a70: 0x7f5f6db5 0x4fb6bdff 0x98642419 0x3490674d 0x5b2ff76e 0xbf7eb63d 0x92001d81 0x4a905500
40823a90: 0x3b97ff79 0x5a7ffbaf 0x3401d005 0x00800648 0xebff3edf 0xbebb7feb 0x03d09092 0x08c0840c
40823ab0: 0x9f7eeaf7 0xff41e875 0x0b1a08c9 0x080a1203 0xf76173ff 0xfd5afaff 0x14005143 0x145ac408
40823ad0: 0xef95fcf6 0x65f68ffe 0x26f801b4 0x8039050c 0x7eff68de 0x77feb7e7 0x002485a2 0x31350126
40823af0: 0xfee95fba 0x5f7b4dfa 0x2820505e 0xc2128a06 0x3b1fbff6 0x5fedebf4 0x04c04100 0x10881204
40823b10: 0xfdfde6b7 0xdbdf6ebf 0x0c52a905 0x218f066a 0xa6fea3ff 0xdfabdfdf 0x7cca2802 0x000b6083
40823b30: 0xb3cc7a77 0xebfb2ebc 0x694020a3 0x6c4b0143 0xdbfd3b9f 0xcff5fffa 0x30900021 0x00814022
40823b50: 0xffffbfff 0x781dbdbe 0x40001780 0x1204400c 0x9da4d7a6 0xc19efe7f 0x812e5eea 0x80001e02
40823b70: 0xb4fd72b9 0xdc6ecbbb 0x9d20446f 0x43010430 0xf2fa3a45 0xb6dfbb5f 0x92127846 0x09340204
40823b90: 0x7b7cfbba 0xefe5b6fc 0x06c9d182 0x245e1241 0xdbcbfbbd 0xc3fbfb54 0x01a04a36 0x20231608
40823bb0: 0xd7f37f76 0xdad2525f 0x00c2ad61 0x0cb0800c 0xbebc773d 0xfaf4fe38 0x08810400 0x04040899
40823bd0: 0xd7fa87d9 0x9dcf6f15 0x0d1610c9 0xc2216218 0xffd7b7ce 0xe6ae2fed 0x8203527e 0x5180b42a
40823bf0: 0xbdae6a3e 0xf3b6d7d7 0x04442340 0x08885361 0x93ef3fef 0xfd39adbf 0x164a8e91 0xca84c044
40823c10: 0xe71b754f 0xdfff54dd 0x2c1460e4 0x1002c010 0xf3fbc3ff 0xfffcffa9 0x88880748 0xa4704136
40823c30: 0xfad7bf14 0xf9bd1ff6 0x64203002 0xeba45201 0x7edcc77f 0xcf7feb77 0x045a1456 0x1b042376
40823c50: 0xdf9d77ae 0xc5ddd6d4 0x01082200 0x800088c0 0x9dff9de7 0x92f5ff5b 0x24080285 0x2242b88c



ELF file SHA256: 4289fd766

Rebooting...
ESP-ROM:esp32h2-20221101
Build:Nov  1 2022
rst:0xc (SW_CPU),boot:0xc (SPI_FAST_FLASH_BOOT)
Saved PC:0x400031b6
SPIWP:0xee
mode:DIO, clock div:1

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

I see the board does not want to connect due to low LQI, can you try to more the board closer to the Coordinator?

@vatsake
Copy link
Author

vatsake commented May 14, 2025

They are quite close, 2m diff.

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

Also it fail here in getting the right address. This does not happened to me or anyone using Zigbee Arduino.

/* association request was sent to the short address, got response
 * from the long address - can update address translation table */

It might be related to Aruba APs

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

Can you send me a link to the product page of the Aruba AP you use?

@vatsake
Copy link
Author

vatsake commented May 14, 2025

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

Its says just "Zigbee support" but nothing about the version etc..
Do you have any other Zigbee devices connected to this device without any issues?

I also don't get why it runs multiple Zigbee networks on different channels with same PAN ID

09:36:32.411 -> Nr | PAN ID | CH | Permit Joining | Router Capacity | End Device Capacity | Extended PAN ID
09:36:32.411 -> 1 | 0xa177 | 13 | Yes | Yes | Yes | 28:de:65...
09:36:32.411 -> 2 | 0xa177 | 11 | Yes | Yes | Yes | 28:de:65...
09:36:32.450 -> 3 | 0xa177 | 19 | Yes | Yes | Yes | 28:de:65...
09:36:32.450 -> 4 | 0xa177 | 11 | Yes | Yes | Yes | 28:de:65...
09:36:32.450 -> 5 | 0xa177 | 14 | Yes | Yes | Yes | 28:de:65...
09:36:32.450 -> 6 | 0xa177 | 20 | Yes | Yes | Yes | 28:de:65...

@vatsake
Copy link
Author

vatsake commented May 14, 2025

Sadly I don't have any other zigbee devices.
I can set the PAN ID myself.
Image

I've set it to automatic, I think now the error is a bit different?

Connecting to network
.......................ZB_TRACE_LOG[0]: nwk/nwk_join.c:186    low lqi 30
ZB_TRACE_LOG[0]: nwk/nwk_join.c:186    low lqi 0
ZB_TRACE_LOG[0]: nwk/nwk_join.c:186    low lqi 0
ZB_TRACE_LOG[0]: nwk/nwk_join.c:186    low lqi 0
.........................................................................................................ZB_TRACE_LOG[0]: zdo/zdo_app.c:602    Have not got nwk key - authentication failed
ZB_TRACE_LOG[0]: nwk/nwk_main.c:4511    zb_nwk_do_leave param 8 rejoin 0
ZB_TRACE_LOG[0]: common/zb_address.c:1138    zb_address_delete ref 58
ZB_TRACE_LOG[0]: common/zb_address.c:1138    zb_address_delete ref 58
ZB_TRACE_LOG[0]: common/zb_address.c:1146    zb_address_delete error: entry is not used
ZB_TRACE_LOG[0]: common/zb_address.c:1138    zb_address_delete ref 0
[ 13440][V][ZigbeeCore.cpp:385] factoryReset(): Factory resetting Zigbee stack, device will reboot
.ESP-ROM:esp32h2-20221101
Build:Nov  1 2022
rst:0xc (SW_CPU),boot:0xc (SPI_FAST_FLASH_BOOT)
Saved PC:0x400031b6
SPIWP:0xee
mode:DIO, clock div:1

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

@xieqinan Do you have any idea?

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

@vatsake, I got a helping hand from @xieqinan, I just updated his reply to match the Arduino way of doing that.

There are three crashing issues on the Zigbee device, but they appear to occur randomly. Please follow the steps below to help reproduce and diagnose the issue. If a crash occurs, kindly copy and share the full log here:

  1. Reset the Aruba APs, then form and open a Zigbee network.
  2. Erase the ESP chip -> Select Erase before upload to Enabled in the Arduino IDE.
  3. Before calling esp_zb_start(), add the following function call:
    esp_zb_secur_network_min_join_lqi_set(1);
    Add this line to the ZigbeeCore.cpp file on line 118, just before the esp_zb_start()
  4. Rebuild and flash the firmware to the device.
  5. If the crash still happens, please copy and share the complete log output here.

@vatsake
Copy link
Author

vatsake commented May 14, 2025

Had no difference.

14:24:31.095 -> =========== Before Setup Start ===========
14:24:31.095 -> Chip Info:
14:24:31.095 -> ------------------------------------------
14:24:31.095 ->   Model             : ESP32-H2
14:24:31.095 ->   Package           : 0
14:24:31.235 ->   Revision          : 0.01
14:24:31.235 ->   Cores             : 1
14:24:31.235 ->   CPU Frequency     : 96 MHz
14:24:31.235 ->   XTAL Frequency    : 32 MHz
14:24:31.235 ->   Features Bitfield : 0x00000050
14:24:31.235 ->   Embedded Flash    : No
14:24:31.235 ->   Embedded PSRAM    : No
14:24:31.235 ->   2.4GHz WiFi       : No
14:24:31.235 ->   Classic BT        : No
14:24:31.235 ->   BT Low Energy     : Yes
14:24:31.235 ->   IEEE 802.15.4     : Yes
14:24:31.235 -> ------------------------------------------
14:24:31.235 -> INTERNAL Memory Info:
14:24:31.235 -> ------------------------------------------
14:24:31.235 ->   Total Size        :   250120 B ( 244.3 KB)
14:24:31.235 ->   Free Bytes        :   211448 B ( 206.5 KB)
14:24:31.235 ->   Allocated Bytes   :    31832 B (  31.1 KB)
14:24:31.235 ->   Minimum Free Bytes:   211448 B ( 206.5 KB)
14:24:31.235 ->   Largest Free Block:   196596 B ( 192.0 KB)
14:24:31.235 -> ------------------------------------------
14:24:31.235 -> Flash Info:
14:24:31.235 -> ------------------------------------------
14:24:31.235 ->   Chip Size         :  4194304 B (4 MB)
14:24:31.235 ->   Block Size        :    65536 B (  64.0 KB)
14:24:31.235 ->   Sector Size       :     4096 B (   4.0 KB)
14:24:31.235 ->   Page Size         :      256 B (   0.2 KB)
14:24:31.235 ->   Bus Speed         : 64 MHz
14:24:31.235 ->   Bus Mode          : QIO
14:24:31.235 -> ------------------------------------------
14:24:31.235 -> Partitions Info:
14:24:31.235 -> ------------------------------------------
14:24:31.235 ->                 nvs : addr: 0x00009000, size:    20.0 KB, type: DATA, subtype: NVS
14:24:31.235 ->             otadata : addr: 0x0000E000, size:     8.0 KB, type: DATA, subtype: OTA
14:24:31.235 ->                app0 : addr: 0x00010000, size:  1280.0 KB, type:  APP, subtype: OTA_0
14:24:31.235 ->                app1 : addr: 0x00150000, size:  1280.0 KB, type:  APP, subtype: OTA_1
14:24:31.235 ->              spiffs : addr: 0x00290000, size:  1388.0 KB, type: DATA, subtype: SPIFFS
14:24:31.235 ->          zb_storage : addr: 0x003EB000, size:    16.0 KB, type: DATA, subtype: FAT
14:24:31.328 ->              zb_fct : addr: 0x003EF000, size:     4.0 KB, type: DATA, subtype: FAT
14:24:31.328 ->            coredump : addr: 0x003F0000, size:    64.0 KB, type: DATA, subtype: COREDUMP
14:24:31.328 -> ------------------------------------------
14:24:31.328 -> Software Info:
14:24:31.328 -> ------------------------------------------
14:24:31.328 ->   Compile Date/Time : May 14 2025 14:23:24
14:24:31.328 ->   Compile Host OS   : windows
14:24:31.328 ->   ESP-IDF Version   : v5.4.1-1-g2f7dcd862a-dirty
14:24:31.328 ->            coredump : addr: 0x003F0000, size:    64.0 KB, type: DATA, subtype: COREDUMP
14:24:31.328 -> ------------------------------------------
14:24:31.328 -> Software Info:
14:24:31.328 -> ------------------------------------------
14:24:31.328 ->   Compile Date/Time : May 14 2025 14:23:24
14:24:31.328 ->   Compile Host OS   : windows
14:24:31.328 ->   ESP-IDF Version   : v5.4.1-1-g2f7dcd862a-dirty
14:24:31.328 ->   Arduino Version   : 3.2.0
14:24:31.328 -> ------------------------------------------
14:24:31.328 -> Board Info:
14:24:31.328 -> ------------------------------------------
14:24:31.328 ->   Arduino Board     : ESP32H2_DEV
14:24:31.328 ->   Arduino Variant   : esp32h2
14:24:31.328 ->   Arduino FQBN      : esp32:esp32:esp32h2:UploadSpeed=921600,CDCOnBoot=default,FlashFreq=64,FlashMode=qio,FlashSize=4M,PartitionScheme=zigbee,DebugLevel=verbose,EraseFlash=all,JTAGAdapter=default,ZigbeeMode=ed_debug
14:24:31.328 -> ============ Before Setup End ============
14:24:31.420 -> [   469][V][esp32-hal-uart.c:552] uartBegin(): UART0 baud(115200) Mode(800001c) rxPin(23) txPin(24)
14:24:31.420 -> [   478][V][esp32-hal-uart.c:650] uartBegin(): UART0 not installed. Starting installation
14:24:31.420 -> [   486][V][esp32-hal-uart.c:660] uartBegin(): UART0 RX FIFO full threshold set to 120 (value requested: 120 || FIFO Max = 128)
14:24:31.420 -> [   497][V][esp32-hal-uart.c:677] uartBegin(): Setting UART0 to use XTAL clock
14:24:31.459 -> [   505][V][esp32-hal-uart.c:732] uartBegin(): UART0 initialization done.
14:24:31.459 -> [   512][V][esp32-hal-uart.c:783] uartSetRxFIFOFull(): UART0 RX FIFO Full value set to 120 from a requested value of 120
14:24:31.459 -> [   522][V][esp32-hal-periman.c:235] perimanSetBusDeinit(): Deinit function for type GPIO (1) successfully set to 0x420054b0
14:24:31.459 -> [   534][V][esp32-hal-periman.c:160] perimanSetPinBus(): Pin 9 successfully set to type GPIO (1) with bus 0xa
14:24:31.495 -> [   544][D][ZigbeeCore.cpp:112] addEndpoint(): Endpoint: 10, Device ID: 0x0302
14:24:31.495 -> Starting Zigbee...
14:24:31.495 -> [   551][D][ZigbeeCore.cpp:170] zigbeeInit(): Initialize Zigbee stack
14:24:31.495 -> [   571][D][ZigbeeCore.cpp:180] zigbeeInit(): Register all Zigbee EPs in list
14:24:31.529 -> [   580][I][ZigbeeCore.cpp:189] zigbeeInit(): List of registered Zigbee EPs:
14:24:31.529 -> [   587][I][ZigbeeCore.cpp:192] zigbeeInit(): Device type: Temperature Sensor, Endpoint: 10, Device ID: 0x0302
14:24:31.568 -> [   605][V][ZigbeeCore.cpp:459] esp_zb_app_signal_handler(): ZDO signal: ZDO Config Ready (0x17), status: ESP_FAIL
14:24:31.568 -> [   616][I][ZigbeeCore.cpp:287] esp_zb_app_signal_handler(): Zigbee stack initialized
14:24:31.568 -> [   623][D][ZigbeeCore.cpp:288] esp_zb_app_signal_handler(): Zigbee channel mask: 0x07fff800
14:24:31.568 -> [   636][I][ZigbeeCore.cpp:295] esp_zb_app_signal_handler(): Device started up in  factory-reset mode
14:24:31.568 -> [   645][I][ZigbeeCore.cpp:306] esp_zb_app_signal_handler(): Start network steering
14:24:31.608 -> Zigbee started successfully!
14:24:31.608 -> .................................ZB_TRACE_LOG[0]: mac/mac_data.c:835    polling during association error: 233
14:24:34.859 -> ZB_TRACE_LOG[0]: nwk/nwk_join.c:251    No dev for join
14:24:34.859 -> ZB_TRACE_LOG[0]: nwk/nwk_join.c:251    No dev for join
14:24:34.906 -> .....ZB_TRACE_LOG[0]: common/zb_debug.c:64    Assertion failed /builds/thread_zigbee/esp-zboss/components/zboss_stack/zboss/nwk/nwk_join.c:448
14:24:35.344 -> Zigbee stack assertion failed nwk/nwk_join.c:448
14:24:35.344 -> 
14:24:35.758 -> abort() was called at PC 0x42020d19 on core 0
14:24:35.758 -> Core  0 register dump:
14:24:35.758 -> MEPC    : 0x4080163a  RA      : 0x40806066  SP      : 0x40823870  GP      : 0x4080d354  
14:24:35.758 -> TP      : 0x40823a20  T0      : 0x37363534  T1      : 0x7271706f  T2      : 0x33323130  
14:24:35.758 -> S0/FP   : 0x4082389c  S1      : 0x4082389c  A0      : 0x408238a8  A1      : 0x4082388a  
14:24:35.758 -> A2      : 0x00000000  A3      : 0x408238d5  A4      : 0x00000001  A5      : 0x40814000  
14:24:35.758 -> A6      : 0x00000000  A7      : 0x76757473  S2      : 0x00000004  S3      : 0x00000001  
14:24:35.758 -> S4      : 0x40820a32  S5      : 0x00000036  S6      : 0x00000000  S7      : 0x00000037  
14:24:35.758 -> S8      : 0x00000000  S9      : 0x00000000  S10     : 0x00000000  S11     : 0x00000000  
14:24:35.758 -> T3      : 0x6e6d6c6b  T4      : 0x6a696867  T5      : 0x66656463  T6      : 0x62613938  
14:24:35.758 -> MSTATUS : 0x00001881  MTVEC   : 0x40800001  MCAUSE  : 0x00000002  MTVAL   : 0x00000000  
14:24:35.758 -> MHARTID : 0x00000000  
14:24:35.758 -> 

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
Projects
None yet
Development

No branches or pull requests

3 participants