← Back to archive

Repo of the Day

kilwa0/esp32c6-zigbee-router

Published: Jun 17, 2026

Open repository ↗

Contribute to kilwa0/esp32c6-zigbee-router development by creating an account on GitHub.

Summary

The repository provides ESP-IDF firmware that turns an ESP32-C6 into a pure Zigbee router (ZHA Range Extender, device 0x0008) with an on-board WS2812 status LED and BOOT-button gestures. Built on Espressif's esp-zigbee-lib 2.x (ezb_* API), it focuses on relaying traffic and extending range rather than exposing application clusters, and includes a ZCL OTA upgrade client.

What it is useful for

  • Extending the reach of a Zigbee HA network by relaying packets between distant end devices and the coordinator.
  • Building a low-cost mains-powered router from an ESP32-C6-DevKitC-1 (WROOM-1 N6, 16 MB flash) without new hardware design.
  • Diagnosing network health at a glance: the WS2812 on GPIO 8 indicates state (red = no network, amber = searching, green = joined, blue = coordinator permit-join active, pulsing green = locally-opened permit-join).
  • Triggering operations from the BOOT button on GPIO 9: single-tap toggles LED night mode, double-tap opens a 60 s permit-join window, triple-tap toggles TX power between 8 dBm and 20 dBm, and a 5 s hold factory-resets the Zigbee NVS.
  • Receiving firmware over the air via a ZCL OTA Upgrade Client using 223-byte blocks and a dedicated 940 KB ota_0 partition.
  • Customising the primary channel mask (default 0x02108000 — channels 15/20/25, chosen for minimum 2.4 GHz Wi-Fi overlap in the EU) and secondary fallback (channels 11–26) through Kconfig.

How engineers can use it

Clone the repository and use ESP-IDF 5.3.5 or newer with ESP32-C6 support. The README documents the build flow:

idf.py set-target esp32c6
idf.py reconfigure
idf.py build
idf.py flash monitor

Verify the partition table contains the zb_storage and ota_0 entries shown in the README. Edit main/router.h to change manufacturer/model strings (Pascal-string length byte included) and the OTA ESP_OTA_MANUFACTURER_ID/ESP_OTA_IMAGE_TYPE so the OTA server image matches.

Documented limitations: the firmware uses the public ZigBee Alliance HA Trust Center Link Key, so production deployments should adopt a full install-code policy; the 20 dBm TX boost is volatile and reverts to 8 dBm after reboot; GPIO 8 and GPIO 9 are strapping pins and must be left floating or pulled correctly; the README does not document a software reboot gesture — use the physical RST button; and the dependency esp-zboss-lib carries its own licence, so any redistribution must comply with all three licences listed in the README.