pdf-icon

Product Guide

Real-Time AI Voice Assistant

Offline Voice Recognition

Thread

Module Gateway H2

IoT Tools

IoT Cloud

Ethernet Camera

LoRa & LoRaWAN

Module LoRa868 v1.2

Module LoRa868/433 v1.1

Develop Tools

ディップスイッチ使用ガイド

Module ExtPort For Core2

ESP Zigbee NCP

This tutorial will guide you on how to run the ESP Zigbee Host/NCP example program using the Unit Gateway H2 paired with the CoreS3 main controller. ESP Zigbee NCP (Network Co-Processor) is a network co-processor mode that runs the Zigbee protocol stack on a separate processor, communicating with the main processor via a serial interface. This architecture allows the main processor to focus on application-layer logic while offloading Zigbee network-related processing to the co-processor. Follow the tutorial below to flash the ESP Zigbee NCP firmware onto the Unit Gateway H2 and the ESP Zigbee Host firmware onto the CoreS3 to create a Coordinator node.

1. Preparations

ESP-IDF version
It is recommended to use ESP-IDF version v5.3.1 for compiling this example.
git clone --recursive https://github.com/espressif/esp-idf.git
cd esp-idf
git checkout v5.3.1 # recommend
./install.sh
. ./export.sh
  • 2. Clone the ESP-Zigbee-SDK Repository: Use the Git command clone recursive to clone the ESP-Zigbee-SDK repository.
git clone --recursive https://github.com/espressif/esp-zigbee-sdk.git
cd esp-zigbee-sdk

  • 4. IDF.py Commands: All subsequent tutorial commands using idf.py depend on ESP-IDF. Before running the commands, execute . ./export.sh in ESP-IDF to activate the relevant environment variables. For detailed instructions, refer to the ESP-IDF - ESP32S3 Getting Started Guide .

2. Compile NCP Firmware

  • 1. Navigate to the NCP Firmware Directory: Use the following commands to enter the corresponding NCP firmware directory and set the compilation target to esp32h2.
cd examples/esp_zigbee_ncp
idf.py set-target esp32h2
idf.py menuconfig
  • 2. Configure Pin Information: Use idf.py menuconfig to enter the configuration page. Configure the device pin information under Component config -> Zigbee Network Co-processor.
- Component config → Zigbee Network Co-processor
  - UART RX Pin: 23
  - UART TX Pin: 24
- Component config → ESP Zigbee → Configure the Zigbee device type
  - Zigbee Coordinator or Router device # or Zigbee End Device
  • 3. Compile the NCP Firmware: After completing the configuration, execute the following command to compile the NCP firmware.
idf.py build
  • 4. Flash the Firmware: Open the Unit Gateway H2 case, press the boot button, and then connect the USB power supply to enter download mode. Execute the following command to flash the firmware. Note: Before flashing, it is recommended to use the command idf.py erase_flash to erase the flash.
idf.py erase_flash
idf.py flash

3. Compile HOST Firmware

  • 1. Navigate to the HOST Firmware Directory: Use the following commands to enter the corresponding HOST firmware directory and set the compilation target to esp32s3.
cd examples/esp_zigbee_host
idf.py set-target esp32s3 # Use CoreS3
idf.py menuconfig
  • 2. Configure Pin Information: Use idf.py menuconfig to enter the configuration page. Configure the device pin information under Component config -> Zigbee NCP Host.
- Component config → Zigbee NCP Host
  - UART RX Pin: 18
  - UART TX Pin: 17
idf.py build
idf.py flash

4. Start Running

  • Connect the CoreS3 to the Unit Gateway H2.
  • Connect the CoreS3 to your computer.
  • Use idf.py monitor or other serial debugging tools to view the running logs at 115200bps.

Normal Running Log Content:

  • NCP side shows successful initialization of the Zigbee protocol stack.
  • Host side shows successful connection to the NCP.
  • Zigbee network creation successful (Coordinator mode).
On This Page