Skip to content

Zigbee Pressure EP crashes on report() #11189

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

Closed
1 task done
DarkShortie opened this issue Mar 27, 2025 · 2 comments
Closed
1 task done

Zigbee Pressure EP crashes on report() #11189

DarkShortie opened this issue Mar 27, 2025 · 2 comments
Assignees
Labels
Area: Zigbee Issues and Feature Request about Zigbee Resolution: Unable to reproduce With given information issue is unable to reproduce

Comments

@DarkShortie
Copy link

Board

ESP32-C6-WROOM-1

Device Description

ESP32-C6-DevKitC-1

Hardware Configuration

i2c sensors planned but removed for testing

Version

other

IDE Name

VSCode

Operating System

Arch Linux

Flash frequency

40 Mhz

PSRAM enabled

no

Upload speed

115200

Description

I'm trying to create a Zigbee ED with different sensors and endpoints. Temperature and humidity worked fine, but when I tried to add a new endpoint for Pressure it started to crash on zbPressureSensor.report().

The provided sketch is stripped down to the bare minimum to reproduce the issue. So all sensors are removed from the DevKit and also from the code and a static value is used.

Sketch

#ifndef ZIGBEE_MODE_ED
#error "Zigbee end device mode is not selected in platformio.ini"
#endif

#include <Arduino.h>
#include <Zigbee.h>

#define FACTORY_RESET_PIN BOOT_PIN

// Zigbee endpoints
#define PRESSURE_SENSOR_ENDPOINT_NUMBER 10

ZigbeePressureSensor zbPressureSensor = ZigbeePressureSensor(PRESSURE_SENSOR_ENDPOINT_NUMBER);

static int16_t zb_float_to_s16(float temp) {
  return (int16_t)(temp * 100);
}

void measureAndSleep() {
  int measure_start = millis();

  zbPressureSensor.setPressure(1014);
  zbPressureSensor.report();

  Serial.println(String("Measurement took ") + (millis() - measure_start));
}

void setup() {

  // Init Factory reset button
  pinMode(FACTORY_RESET_PIN, INPUT_PULLUP);

  // BME280: 300Pa to 1100 hPa (±1 hPa accuracy)
  zbPressureSensor.setMinMaxValue(300, 1100);
  zbPressureSensor.setTolerance(1);

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

  // 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 = 10000;

  // When all EPs are registered, start Zigbee in End Device mode
  if (!Zigbee.begin(&zigbeeConfig, false)) {
    Serial.println("Zigbee failed to start!");
    Serial.println("Rebooting...");
    ESP.restart(); // If Zigbee failed to start, reboot the device and try again
  }

  Serial.println("Connecting to network");
  while (!Zigbee.connected()) {
    Serial.print(".");
    delay(100);
  }
  Serial.println();
  Serial.println("Successfully connected to Zigbee network");
}

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

  // Call the function to measure temperature and put the device to sleep
  int measure_start = millis();
  measureAndSleep();
  Serial.println(String("Measurement took ") + (millis() - measure_start) + "ms");
  delay(5000); // Sleep for 1 minute
}

Debug Message

Rebooting...
ESP-ROM:esp32c6-20220919
Build:Sep 19 2022
rst:0xc (SW_CPU),boot:0x1c (SPI_FAST_FLASH_BOOT)
Saved PC:0x4001975a
SPIWP:0xee
mode:DIO, clock div:2
load:0x40875720,len:0x1228
load:0x4086c110,len:0xd9c
load:0x4086e610,len:0x2f74
entry 0x4086c110
[     0][V][esp32-hal-periman.c:235] perimanSetBusDeinit(): Deinit function for type UART_RX (2) successfully set to 0x42006d5a
[    12][V][esp32-hal-periman.c:235] perimanSetBusDeinit(): Deinit function for type UART_TX (3) successfully set to 0x42006d1e
[    23][V][esp32-hal-periman.c:235] perimanSetBusDeinit(): Deinit function for type UART_CTS (4) successfully set to 0x42006ce2
[    34][V][esp32-hal-periman.c:235] perimanSetBusDeinit(): Deinit function for type UART_RTS (5) successfully set to 0x42006ca6
[    46][V][esp32-hal-periman.c:235] perimanSetBusDeinit(): Deinit function for type UART_RX (2) successfully set to 0x42006d5a
[    57][V][esp32-hal-periman.c:235] perimanSetBusDeinit(): Deinit function for type UART_TX (3) successfully set to 0x42006d1e
[    68][V][esp32-hal-periman.c:235] perimanSetBusDeinit(): Deinit function for type UART_CTS (4) successfully set to 0x42006ce2
[    80][V][esp32-hal-periman.c:235] perimanSetBusDeinit(): Deinit function for type UART_RTS (5) successfully set to 0x42006ca6
[    91][V][esp32-hal-periman.c:235] perimanSetBusDeinit(): Deinit function for type USB_DM (38) successfully set to 0x420036ae
[   102][V][esp32-hal-periman.c:235] perimanSetBusDeinit(): Deinit function for type USB_DP (39) successfully set to 0x420036ae
[   114][V][ZigbeeEP.cpp:18] ZigbeeEP(): Endpoint: 10
[   128][V][esp32-hal-periman.c:160] perimanSetPinBus(): Pin 17 successfully set to type UART_RX (2) with bus 0x4080f300
[   139][V][esp32-hal-periman.c:160] perimanSetPinBus(): Pin 16 successfully set to type UART_TX (3) with bus 0x4080f300
[   150][V][esp32-hal-periman.c:160] perimanSetPinBus(): Pin 12 successfully set to type USB_DM (38) with bus 0x40811894
[   161][V][esp32-hal-periman.c:160] perimanSetPinBus(): Pin 13 successfully set to type USB_DP (39) with bus 0x40811894
=========== Before Setup Start ===========
Chip Info:
------------------------------------------
  Model             : ESP32-C6
  Package           : 0
  Revision          : 0.00
  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        :   445548 B ( 435.1 KB)
  Free Bytes        :   405208 B ( 395.7 KB)
  Allocated Bytes   :    33420 B (  32.6 KB)
  Minimum Free Bytes:   405152 B ( 395.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 : Mar 27 2025 15:50:43
  ESP-IDF Version   : v5.3.2-584-g489d7a2b3a-dirty
  Arduino Version   : 3.1.3
------------------------------------------
Board Info:
------------------------------------------
  Arduino Board     : Espressif ESP32-C6-DevKitM-1
  Arduino Variant   : esp32c6
  Core Debug Level  : 5
  Arduino Runs Core : 0
  Arduino Events on : 0
  Arduino USB Mode  : 1
  CDC On Boot       : 1
============ Before Setup End ============
[   284][V][esp32-hal-periman.c:235] perimanSetBusDeinit(): Deinit function for type GPIO (1) successfully set to 0x42004642
[   285][V][esp32-hal-periman.c:160] perimanSetPinBus(): Pin 9 successfully set to type GPIO (1) with bus 0xa
[   285][D][ZigbeeCore.cpp:97] addEndpoint(): Endpoint: 10, Device ID: 0x000c
[   286][D][ZigbeeCore.cpp:140] zigbeeInit(): Initialize Zigbee stack
[   323][D][ZigbeeCore.cpp:147] zigbeeInit(): Register all Zigbee EPs in list
[   324][I][ZigbeeCore.cpp:155] zigbeeInit(): List of registered Zigbee EPs:
[   324][I][ZigbeeCore.cpp:157] zigbeeInit(): Device type: Simple Sensor device, Endpoint: 10, Device ID: 0x000c
[   332][V][ZigbeeCore.cpp:374] esp_zb_app_signal_handler(): ZDO signal: ZDO Config Ready (0x17), status: ESP_FAIL
[   333][I][ZigbeeCore.cpp:236] esp_zb_app_signal_handler(): Zigbee stack initialized
[   333][D][ZigbeeCore.cpp:237] esp_zb_app_signal_handler(): Zigbee channel mask: 0x00008000
[   601][I][ZigbeeCore.cpp:243] esp_zb_app_signal_handler(): Device started up in non factory-reset mode
[   602][I][ZigbeeCore.cpp:256] esp_zb_app_signal_handler(): Device rebooted
[   603][V][ZigbeeCore.cpp:516] setNVRAMChannelMask(): Channel mask set to 0x00008000
[   604][D][ZigbeeCore.cpp:501] searchBindings(): Requesting binding table for address 0x8784
[   605][D][ZigbeeCore.cpp:441] bindingTableCb(): Binding table callback for address 0x8784 with status 0
[   605][D][ZigbeeCore.cpp:444] bindingTableCb(): Binding table info: total 2, index 0, count 2
[   606][D][ZigbeeCore.cpp:454] bindingTableCb(): Binding table record: src_endp 10, dst_endp 1, cluster_id 0x0402, dst_addr_mode 3
[   607][D][ZigbeeCore.cpp:471] bindingTableCb(): Device bound to EP 10 -> device endpoint: 1, short addr: 0x0000, ieee addr: 08:B9:5F:FF:FE:BA:66:7D
[   607][D][ZigbeeCore.cpp:454] bindingTableCb(): Binding table record: src_endp 10, dst_endp 1, cluster_id 0x0405, dst_addr_mode 3
[   608][D][ZigbeeCore.cpp:471] bindingTableCb(): Device bound to EP 10 -> device endpoint: 1, short addr: 0x0000, ieee addr: 08:B9:5F:FF:FE:BA:66:7D
[   609][D][ZigbeeCore.cpp:492] bindingTableCb(): Filling bounded devices finished
Connecting to network

Successfully connected to Zigbee network
=========== After Setup Start ============
INTERNAL Memory Info:
------------------------------------------
  Total Size        :   445548 B ( 435.1 KB)
  Free Bytes        :   379116 B ( 370.2 KB)
  Allocated Bytes   :    58760 B (  57.4 KB)
  Minimum Free Bytes:   379116 B ( 370.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 =============
[   634][V][ZigbeePressureSensor.cpp:60] setPressure(): Updating pressure sensor value...
[   635][D][ZigbeePressureSensor.cpp:62] setPressure(): Setting pressure to 1014 hPa
Zigbee stack assertion failed /builds/thread_zigbee/esp-zboss/components/esp_zb_sdk/src/esp_zigbee_zcl_command.c:340

abort() was called at PC 0x4201458b on core 0
Core  0 register dump:
MEPC    : 0x40801b52  RA      : 0x408080ae  SP      : 0x4081f160  GP      : 0x4080f9d4  
TP      : 0x4081f350  T0      : 0x37363534  T1      : 0x7271706f  T2      : 0x33323130  
S0/FP   : 0x4081f18c  S1      : 0x4081f18c  A0      : 0x4081f198  A1      : 0x4081f17a  
A2      : 0x00000000  A3      : 0x4081f1c5  A4      : 0x00000001  A5      : 0x40816000  
A6      : 0x00000000  A7      : 0x76757473  S2      : 0x00000001  S3      : 0x00000000  
S4      : 0x00000000  S5      : 0x40823bd4  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:
4081f160: 0x00000000 0x00000000 0x4081f178 0x4080e058 0x00000000 0x40823bd4 0x00000030 0x408110f8
4081f180: 0x4081f18c 0x40811114 0x4081f178 0x31303234 0x62383534 0x00000000 0x726f6261 0x20292874
4081f1a0: 0x20736177 0x6c6c6163 0x61206465 0x43502074 0x34783020 0x34313032 0x20623835 0x63206e6f
4081f1c0: 0x2065726f 0x00000030 0x00000000 0xe3b14b38 0x0000002f 0x4081f264 0x42074cb4 0x4201458e
4081f1e0: 0x00000000 0x4081f26e 0x00000001 0x00000154 0x00000001 0x4081f264 0x40823e7c 0x4200a716
4081f200: 0x00000000 0x00000000 0x00000000 0x00000000 0x40816000 0x00000000 0x40823968 0x40808d34
4081f220: 0x0009b157 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
4081f240: 0x40816000 0x40816000 0x0000027a 0x420034a8 0x42072280 0x42072267 0x408117c0 0x42003452
4081f260: 0x0000001b 0x000003f6 0x00000000 0x03f60a00 0x00000000 0x00040403 0x0000ffff 0xe3b14b38
4081f280: 0x40811000 0x40816000 0x0000027a 0x42000096 0x4081f350 0x40018ea2 0x40816000 0x00000000
4081f2a0: 0x00000000 0x40816000 0x00000009 0x420048ba 0x40816000 0x40816000 0x420077a0 0xe3b14b38
4081f2c0: 0x00000000 0x40816000 0x0000027a 0x42000230 0x00000000 0x00000000 0x00000000 0x00000000
4081f2e0: 0x00000000 0x00000000 0x420077a0 0x4200493c 0x40816000 0x00000001 0x40816000 0xe3b14b38
4081f300: 0x00000000 0x40816000 0x420077a0 0x4200745a 0x00000000 0x00000000 0x00000000 0x4080936a
4081f320: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
4081f340: 0x00000000 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 0xbaad5678
4081f360: 0x00000168 0xabba1234 0x0000015c 0x4081f0a0 0x000001fd 0x40814784 0x40814784 0x4081f36c
4081f380: 0x4081477c 0x00000018 0x40817a28 0x40817a28 0x4081f36c 0x00000000 0x00000001 0x4081d35c
4081f3a0: 0x706f6f6c 0x6b736154 0x00000000 0x00000000 0x4081f350 0x00000005 0x00000000 0x00000001
4081f3c0: 0x00000001 0x00000000 0x00000000 0x00018e37 0x00000000 0x40817464 0x408174cc 0x40817534
4081f3e0: 0x00000000 0x00000000 0x00000001 0x00000000 0x00000000 0x4081f874 0x4204949c 0x00000000
4081f400: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
4081f420: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
4081f440: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
4081f460: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
4081f480: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
4081f4a0: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
4081f4c0: 0x00000000 0x00000000 0xbaad5678 0x00000068 0xabba1234 0x0000005c 0x00000000 0x4081f4d8
4081f4e0: 0x00000000 0x00000000 0x00000000 0x4081f4f0 0xffffffff 0x4081f4f0 0x4081f4f0 0x00000000
4081f500: 0x4081f504 0xffffffff 0x4081f504 0x4081f504 0x00000001 0x00000001 0x00000000 0x6600ffff
4081f520: 0x00000000 0x74657320 0x206f7401 0x65707974 0x52415520 0xbaad5678 0x00000168 0xabba1234
4081f540: 0x0000015c 0x4081f5a0 0x4081f5a0 0x4081f6a0 0x4081f69f 0x00000000 0x4081f55c 0xffffffff



ELF file SHA256: 8bccbf631

Rebooting...

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.
@DarkShortie DarkShortie added the Status: Awaiting triage Issue is waiting for triage label Mar 27, 2025
@P-R-O-C-H-Y
Copy link
Member

@DarkShortie What version of Arduino ESP32 Core are you using? You choose "other" in the issue description.

@P-R-O-C-H-Y P-R-O-C-H-Y self-assigned this Mar 27, 2025
@P-R-O-C-H-Y P-R-O-C-H-Y added the Area: Zigbee Issues and Feature Request about Zigbee label Mar 27, 2025
@P-R-O-C-H-Y
Copy link
Member

I did test the example you provided in the description and I am not able to reproduce the crash. Can you update to latest dev version 3.2.0-rc2 or wait a bit for 3.2.0 stable release. This issue is already fixed.

@P-R-O-C-H-Y P-R-O-C-H-Y added Resolution: Unable to reproduce With given information issue is unable to reproduce and removed Status: Awaiting triage Issue is waiting for triage labels Mar 27, 2025
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 Resolution: Unable to reproduce With given information issue is unable to reproduce
Projects
None yet
Development

No branches or pull requests

2 participants