Open phelicksg opened 3 months ago
Had the same issue, but worked for me after Erasing Flash
I just ran off.py erase-flash again, switched off power to devboard. Followed by IDF.pt flash and powered off.devboard again. Powered on followed by idf.py monitor. Same behaviour, unfortunately, still does not work. Built on 5.2.1
I have the same problem, I tried modifying the code, but without success. The network remains closed.
@phelicksg @cy-lhe @MeryaneF ,
In this example, the Zigbee network will be closed when the device is not factory reset. This means that if the device is on a network and reboots, the network is closed by default. You can call esp_zb_bdb_open_network()
to open the network again.
case ESP_ZB_BDB_SIGNAL_DEVICE_FIRST_START:
case ESP_ZB_BDB_SIGNAL_DEVICE_REBOOT:
if (err_status == ESP_OK) {
ESP_LOGI(TAG, "Deferred driver initialization %s", deferred_driver_init() ? "failed" : "successful");
ESP_LOGI(TAG, "Device started up in %s factory-reset mode", esp_zb_bdb_is_factory_new() ? "" : "non");
if (esp_zb_bdb_is_factory_new()) {
ESP_LOGI(TAG, "Start network formation");
esp_zb_bdb_start_top_level_commissioning(ESP_ZB_BDB_MODE_NETWORK_FORMATION);
} else {
esp_zb_bdb_open_network(180); // Open network 180s
ESP_LOGI(TAG, "Device rebooted");
}
} else {
ESP_LOGE(TAG, "Failed to initialize Zigbee stack (status: %s)", esp_err_to_name(err_status));
}
break;
By the way, the above logic will be added to these examples in the future.
Answers checklist.
IDF version.
v5.2.1
Espressif SoC revision.
Chip is ESP32-H2 (revision v0.1)
Operating System used.
Windows
How did you build your project?
Command line with idf.py
If you are using Windows, please specify command line type.
CMD
Development Kit.
ESP32-H2-DevKitM-1
Power Supply used.
USB
What is the expected behavior?
According to the example (I just xcopied the HA_on_off_switch without any modifications), this is what I expected (part of the README.md): This is the expected behaviour as given in the README.md from the standard Zigbee HA_on_off_switch example that comes with ESP-IDF 5.2.1 (stable):
I (388) main_task: Calling app_main() I (398) gpio: GPIO[9]| InputEn: 1| OutputEn: 0| OpenDrain: 0| Pullup: 1| Pulldown: 0| Intr:2 I (398) phy_init: phy_version 220,2dbbbe7,Sep 25 2023,20:39:25 I (478) phy: libbtbb version: 90c587c, Sep 25 2023, 20:39:57 I (488) ESP_ZB_ON_OFF_SWITCH: ZDO signal: ZDO Config Ready (0x17), status: ESP_FAIL I (488) ESP_ZB_ON_OFF_SWITCH: Zigbee stack initialized I (488) ESP_ZB_ON_OFF_SWITCH: Start network formation I (498) main_task: Returned from app_main() I (998) ESP_ZB_ON_OFF_SWITCH: ZDO signal: NWK Permit Join (0x36), status: ESP_OK I (998) ESP_ZB_ON_OFF_SWITCH: Formed network successfully (Extended PAN ID: 60:55:f9:00:00:f6:07:b4, PAN ID: 0x2a74, Channel:13) I (1468) ESP_ZB_ON_OFF_SWITCH: ZDO signal: NWK Permit Join (0x36), status: ESP_OK I (1468) ESP_ZB_ON_OFF_SWITCH: Network steering started I (14228) ESP_ZB_ON_OFF_SWITCH: ZDO signal: NWK Device Associated (0x12), status: ESP_OK I (14728) ESP_ZB_ON_OFF_SWITCH: ZDO signal: ZDO Device Update (0x30), status: ESP_OK I (14788) ESP_ZB_ON_OFF_SWITCH: New device commissioned or rejoined (short: 0xe399) I (14858) ESP_ZB_ON_OFF_SWITCH: Found light I (14858) ESP_ZB_ON_OFF_SWITCH: Try to bind On/Off I (14858) ESP_ZB_ON_OFF_SWITCH: Bound successfully! I (14858) ESP_ZB_ON_OFF_SWITCH: The light originating from address(0xe399) on endpoint(10) I (15338) ESP_ZB_ON_OFF_SWITCH: ZDO signal: ZDO Device Authorized (0x2f), status: ESP_OK I (15408) ESP_ZB_ON_OFF_SWITCH: ZDO signal: NWK Permit Join (0x36), status: ESP_OK I (35838) ESP_ZB_ON_OFF_SWITCH: ZDO signal: NLME Status Indication (0x32), status: ESP_OK I (38548) ESP_ZB_ON_OFF_SWITCH: Send 'on_off toggle' command I (39598) ESP_ZB_ON_OFF_SWITCH: Send 'on_off toggle' command I (41148) ESP_ZB_ON_OFF_SWITCH: Send 'on_off toggle' command
What is the actual behavior?
The example builds, and I can flash it. When I do idf.py monitor, the program does not behave as indicated in the README.md from the example. Instead it renders errors:
W (509) ESP_ZB_ON_OFF_SWITCH: Network(0x9e84) closed, devices joining not allowed. I (519) ESP_ZB_ON_OFF_SWITCH: Device started up in non factory-reset mode I (519) ESP_ZB_ON_OFF_SWITCH: Device rebooted
I also tried rebooting the devboard several times (and even power-cycled it) - same behaviour. See full logs below in debug logs.
Steps to reproduce.
Downloaded esp-idf 5.2.1 (stable) using the Windows installer. Standard install. Also installed the support for ESP32-H2 and ESP32-C6. mkdir HA_on_off_switch xcopy /e /i %IDF_PATH%\examples\bee\light_sample\HA_on_off_switch HA_on_off_switch cd HA_on_off_switch idf.py set-target esp32h2 idf.py menuconfig (did not change anything) idf.py build idf.py erase-flash idf.py flash idf.py monitor
Debug Logs.
More Information.
I have tried the same on a different devkit: ESP32-C6-DevKitM-1. The same problem occurs as well using that set-up. Of course I have done idf.py set-target esp32c6, idf.py menuconfig, idf.py build, idf.py erase-flash, idf.py flash, idf.py monitor and I have also power-cycled the devkit. I am using USB UART bridge (not sure this makes any difference).