pdf-icon

Product Guide

Real-Time AI Voice Assistant

Zigbee

Thread

Module Gateway H2

IoT Tools

IoT Cloud

Ethernet Camera

Develop Tools

Smart Home

M5Paper

ESP Zigbee NCP

This tutorial introduces how to use the Module Gateway H2 together with the CoreS3 controller to run the ESP Zigbee Host/NCP example program. ESP Zigbee NCP (Network Co-Processor) is a network co-processor mode that runs the Zigbee protocol stack on a separate processor and communicates with the main processor via a serial port. This architecture allows the main processor to focus on application-layer logic while delegating Zigbee network-related processing to the co-processor. Refer to the tutorial below to flash the ESP Zigbee NCP firmware to the Module Gateway H2 and the ESP Zigbee Host firmware to the CoreS3, thereby creating a Coordinator node.

1. Preparations

2. Compiling the NCP Firmware

  • 1.Refer to the commands below to navigate to the corresponding NCP firmware directory and set the build target to esp32h2.

    cd examples/esp_zigbee_ncp
    idf.py set-target esp32h2
    idf.py menuconfig
    
  • 2.Use idf.py menuconfig to enter the configuration menu. In menuconfig, configure the device pin settings under:
    Component configZigbee Network Co-processor

    - Component config → Zigbee Network Co-processor
      - UART TX Pin: 24
      - UART RX Pin: 23
    - Component config → ESP Zigbee → Configure the Zigbee device type
      - Zigbee Coordinator or Router device # or Zigbee End Device
    
  • 3.Execute the following commands to build, erase flash, and flash the NCP firmware:

    idf.py build
    idf.py erase_flash
    idf.py flash # modify according to your actual port
    

3. Compiling the HOST Firmware

  • 1.Refer to the commands below to navigate to the corresponding HOST firmware directory and set the build target to esp32s3.

    cd examples/esp_zigbee_host
    idf.py set-target esp32s3 # for CoreS3
    idf.py menuconfig
    
  • 2.Use idf.py menuconfig to enter the configuration menu. In menuconfig, configure the device pin settings under:
    Component configZigbee NCP Host

    - Component config → Zigbee NCP Host
      - UART TX Pin: 17
      - UART RX Pin: 10
    
  • 3.Execute the following commands to build and flash the HOST firmware:

    idf.py build
    idf.py flash
    

4. Getting Started

  • Connect the CoreS3 and the Module Gateway H2.

  • Connect the CoreS3 to your computer.

  • Use idf.py monitor or other serial debugging tools at 115200bps to view the runtime logs.

Normal runtime log contents:

  • The NCP side shows that the Zigbee protocol stack has initialized successfully.
  • The Host side shows a successful connection to the NCP.
  • Zigbee network creation successful (Coordinator mode).
On This Page