ESP32-C6 Zigbee Router
A dedicated Zigbee router firmware for an ESP32-C6 development board. Its purpose is to extend the range and improve the reliability of a Zigbee mesh network.
Hardware
- ESP32-C6 Development Board (with 4MB Flash)
Software
- ESP-IDF v5.4.2
Build and Flash
- Clone the repository.
- Navigate to the project directory.
- Source the ESP-IDF environment:
. /path/to/esp-idf/export.sh - Set the target and open the configuration menu:
idf.py set-target esp32c6 idf.py menuconfig - Confirm the settings are correct (especially Partition Table and Flash Size), then Save and Quit.
- Build the project:
idf.py build - Flash the device (replace
/dev/ttyACM0with your device's port):idf.py -p /dev/ttyACM0 flash
Key Configuration & Troubleshooting Notes
This project required several specific configurations to resolve build and runtime errors:
-
Partition Table (
partitions.csv): The ESP-Zigbee stack requireszb_storageandzb_fctpartitions. These must be defined inpartitions.csvwith explicit hexadecimal sizes to ensure correct parsing. -
menuconfig- Partition Table: The build system will ignore the custompartitions.csvfile unless explicitly configured. This is set underPartition Table --->by changing the type toCustom partition table CSV. -
menuconfig- Flash Size: The project must be configured to match the board's physical flash size (4MB). This is set underSerial flasher config --->. A mismatch causes a boot loop withinvalid header: 0xfffffffferrors. -
main/CMakeLists.txtDependencies: The main component requires explicit dependencies to find necessary headers. TheREQUIRESline must includeesp-zigbee-lib,nvs_flash, andfreertos. -
API Versioning: The Zigbee configuration macros must match the installed
esp-zigbee-libversion. This firmware uses:.esp_zb_role = ESP_ZB_DEVICE_TYPE_ROUTER.nwk_cfg.zczr_cfgfor the router network configuration..app_device_id = ESP_ZB_HA_TEST_DEVICE_IDas a valid, defined device ID.
Behavior
Once flashed and powered, the device will automatically attempt to join an open Zigbee network. To pair, put your Zigbee coordinator (e.g., ZHA, Zigbee2MQTT) into "Permit Join" or "Add Device" mode and power on the router.