esp32.diy

ESP32-C6 Zigbee Router: Build a Cheap Range Extender with ESPHome

Nov 25, 2026 · 7 min read

Beginner 53 stars 8 forks Python MIT Updated 2026-11-24

Seeed XIAO ESP32C6 running the Zigbee router firmware in the 3D-printed case with an external SMA antenna

TL;DR esp32c6-zigbee-router is an ESPHome configuration that turns a ~5 € ESP32-C6 board into a Zigbee 3.0 router for Zigbee2MQTT and ZHA, giving battery-powered sensors a closer hop to the coordinator. It needs no WiFi or secrets, uses the native ESPHome Zigbee component, and comes with a snap-fit 3D-printed case for an external SMA antenna.
What you need
  • Seeed Studio XIAO ESP32C6
  • ESP32-C6 boards (e.g. esp32-c6-devkitc-1)
  • ESP32-C5 / ESP32-H2 (supported by ESPHome, not tested here)
  • U.FL to SMA bulkhead pigtail (1/4"-36 thread)
  • 2.4 GHz antenna
  • 3D-printed case (STL files included)
  • USB cable
BoardSeeed Studio XIAO ESP32C6 (other ESP32-C6 boards supported)
FrameworkESPHome 2026.5+ with native zigbee component
ProtocolZigbee 3.0 router, no WiFi
Works withZigbee2MQTT, ZHA, Home Assistant
LicenseMIT
DifficultyBeginner

What you will build and why

Zigbee meshes live or die by their routers. Battery-powered sensors, buttons and door contacts are end devices: they cannot relay traffic and rely on a mains-powered router or the coordinator being within reach. If your basement humidity sensor keeps dropping off, the usual fix is to buy a smart plug or bulb just to act as a repeater.

This project does the same job with a ~5 € ESP32-C6. The firsttris/esp32c6-zigbee-router repository is an ESPHome configuration that turns the board into a Zigbee 3.0 router for Zigbee2MQTT and ZHA. It joins your network as a Zigbee Range Extender, has no entities of its own, and needs no WiFi and no secrets. You flash it over USB once, put the coordinator into pairing mode, and the router shows up.

What you get out of the box:

If you already run Home Assistant with Zigbee2MQTT or ZHA, this is one of the cheapest ways to fix a dead spot.

The alternative, larger white case from Printables with the lid removed, leaving more room for the U.FL to SMA pigtail\2
The alternative, larger white case from Printables with the lid removed, leaving more room for the U.FL to SMA pigtail

What you need

The hardware list is short, which is the point.

Hardware

Optional, for the case and external antenna

Software

pip install -r requirements.txt

If you prefer containers, the repo ships a docker-compose.yml that mounts the repository as /config and passes the USB device into the container.

Typical use cases

Fix a Zigbee dead spot

Place the router between the coordinator and far-off battery sensors so they get a closer, mains-powered parent.

Wall-mounted repeater

The snap-fit case with keyhole and SMA antenna makes a tidy, permanently installed extender for hallways or basements.

Multi-floor mesh backbone

Build several for a few euros each and spread them across floors to strengthen the whole Zigbee2MQTT or ZHA mesh.

ESPHome Zigbee starting point

Use the config as a minimal, working reference for the native ESPHome zigbee component before adding your own sensors.

How it works

A Zigbee router is a mains-powered device that relays signals between other devices, extending range and improving stability. End devices (your battery sensors) attach to the nearest router as their parent, and the router forwards their traffic toward the coordinator. This firmware exposes no sensors or switches by default; it simply joins as a router.

On the XIAO ESP32C6, the board has both a built-in ceramic antenna and a U.FL connector. An RF switch chooses between them: GPIO3 powers the switch and GPIO14 selects the antenna. The config drives these pins through an antenna_mode substitution. ALWAYS_ON selects the external antenna (the default, matching the SMA case) and ALWAYS_OFF selects the ceramic antenna.

Because the device has no WiFi, it will never appear online in the ESPHome dashboard or the ESPHome integration of Home Assistant. You manage it entirely from Zigbee2MQTT or ZHA.

The BOOT button doubles as a factory-reset trigger: hold it for 5 seconds and the router leaves the network, clears its Zigbee data and starts pairing again. Your ESPHome config is untouched.

Build and flash

Step 1: Optional settings. The defaults work right away. If you want a different name, edit the substitutions in esp32-c6-zigbee-router.yaml:

substitutions:
  device_name: esp32-c6-zigbee-router  # Unique name, also used as the Zigbee model ID
  friendly_name: ESP32-C6 Zigbee Router  # Display name

Step 2: Pick the antenna (XIAO only). The default is the external antenna. Without one physically connected, ALWAYS_ON gives very poor range, so switch to the ceramic antenna if you skip the pigtail:

substitutions:
  antenna_mode: ALWAYS_OFF   # built-in ceramic antenna

You can also override it from the command line without touching the file:

esphome -s antenna_mode ALWAYS_OFF run esp32-c6-zigbee-router.yaml

Step 3: Compile and flash. Plug the board in over USB and run:

esphome run esp32-c6-zigbee-router.yaml --device=/dev/ttyACM0

Replace /dev/ttyACM0 with your port. Typical paths are /dev/ttyUSB0 or /dev/ttyACM0 on Linux, /dev/cu.usbmodem* on macOS and COM3 style names on Windows. On standard Linux, add yourself to the dialout group if you get a permission error:

sudo usermod -a -G dialout $USER

On immutable systems like Fedora Atomic or Bazzite with rootless Docker/Podman, the README notes you may need sudo chmod 666 /dev/ttyACM0 before each flash, and SELinux may require security_opt: label=disable (already set in docker-compose.yml).

Docker alternative. Plug the USB device in before starting the container, then:

docker compose up -d
docker compose exec esphome esphome run /config/esp32-c6-zigbee-router.yaml --device=/dev/ttyACM0

The container also starts the ESPHome dashboard at http://localhost:6052. It has no password and listens on all interfaces, so only use it on a trusted network or stop the container when done.

Browser flashing. web.esphome.io can flash but not compile. Build first with esphome compile esp32-c6-zigbee-router.yaml, then upload .esphome/build/esp32-c6-zigbee-router/build/firmware.factory.bin via Chrome or Edge.

Upgrading from an older version? Earlier releases used the external luar123/zigbee_esphome component and a custom partitions_zb.csv. Both are gone. Remove the router from your coordinator, erase the flash, then reflash and pair again:

esphome clean esp32-c6-zigbee-router.yaml
esptool --port /dev/ttyACM0 erase-flash

Pair and verify

Step 4: Join the network. The router searches for an open network within 30-60 seconds of boot, so enable pairing on the coordinator first and keep it open until the device appears.

If the logs repeat Failed to join network with status(0x03) every few seconds, no network is accepting joins. Enable pairing mode and the router joins within seconds.

Check the logs over USB:

esphome logs esp32-c6-zigbee-router.yaml --device=/dev/ttyACM0

On first pairing you should see Joined network successfully: PAN ID(...), Channel(...), Short Address(...), and after a reboot Device rebooted and Rejoined Zigbee network. The config dump shows Router: YES. Note that the dump prints right after boot, before the rejoin, so Device is joined to the network: NO there is not a problem; the join messages are what counts.

Check the mesh. In Zigbee2MQTT open the Map and confirm the ESP32-C6 shows up as a router with link quality to its neighbours. In ZHA, use Visualize under the ZHA integration.

To move the router to another network, remove it from the coordinator, enable pairing, then hold BOOT for 5 seconds and release. Do not hold BOOT while plugging in USB; that starts the ROM bootloader instead.

Ideas to extend it and limitations

Expose chip temperature. The native component can publish ESPHome sensors to your coordinator. Uncomment the sensor: block in esp32-c6-zigbee-router.yaml to get the ESP32-C6 chip temperature in Zigbee2MQTT or ZHA. After adding or removing sensors, the README says you need to remove the router from your coordinator and pair it again so the new clusters are picked up.

Measure the difference. A Zigbee2MQTT map is a snapshot. The author's companion project Funkloch records the signal of every Zigbee2MQTT device over days and weeks, shows which devices picked your new router as parent, and sends ntfy, webhook or MQTT alerts when a device drops out. It runs as one read-only Docker container next to Zigbee2MQTT with no cloud, which makes it easy to test placement: move the router, wait a day, compare.

Tweak the case. The parametric xiao_esp32c6_case.py lets you change dimensions if you use a different pigtail or board variant.

Limitations to keep in mind

Verdict

For anyone running Zigbee2MQTT or ZHA, this is a cheap, well-documented way to add a dedicated router without buying a smart plug you do not need. The native ESPHome Zigbee component, BOOT-button re-pairing and a ready-to-print case make it a one-evening build. Just remember it is USB-flash only and currently tested on the XIAO ESP32C6 alone.

Sources

github.comfirsttris/esp32c6-zigbee-router — repository & README

Facts in this article come from the project's public README and GitHub metadata at the time of writing. Images belong to their respective owners and link back to the original source.