Use an ESP32-C6 as a Cheap Thread Border Router

After buying an ikea ALPSTUGA and discovering they switched from Zigbee to Thread, I discovered an ESP32 can be used as a cheap RCP Thread border Router.

The support it limited to ESP who have 802.15.4 radio. For the moment, the only chip which can do this are:

  • ESP32-C6
  • ESP32-H2
  • ESP32-C5

It is possible to use the ESP32 as Wi-Fi thread router, but you need to have two chips, one act as the Wi-Fi controller and the other as the Thread radio.

If found some cheap one on Amazon here, 15.99€ for 3 pieces at the time of writing. The one I’m using is a waveshare esp32-c6 with OLED screen, I described how to use the esp32-c6 with esphome in another blog post.

In my case, I’m using an ESP32-C6 as an OpenThread Radio Co-Processor (RCP). In this mode, the ESP32-C6 will act as an RCP device. Managing the Thread network and communicating with the router by serial, using the spinel protocol. The communication and routing between matter devices and the Thread network are handled by OpenThread Border Router

Programming the ESP32

The official ESP-IDF SDK contains already some implementation of the OpenThread RCP mode and other implementations, it can be found on their GitHub.

Based on the official ESP-IDF documentation, you can follow these steps to set up an ESP32-C6 as a cheap Thread Router.

I’m using the release branch v5.5.2

mkdir -p ~/esp
cd ~/esp
# Will take a while
git clone -b v5.5.2 --recursive https://github.com/espressif/esp-idf.git
cd esp-idf

# if using fish shell
# ./install.fish esp32c6
# . ./export.fish

# if using bash shell
./install.sh esp32c6
. ./export.sh

cd examples/openthread/ot_rcp
idf.py set-target esp32c6
# configure the spinel interface to use the USB port
cp sdkconfig.ci.rcp_usb sdkconfig
idf.py build
idf.py flash

Once the ESP32-C6 is flashed, you can connect to it to your home assistant instance using the USB port.

home assistant

Installing and configuring OpenThread Border Router

In the add-on section, you need to install the OpenThread Border Router add-on.

Go to Settings -> Addons -> Addon Store and search for OpenThread Border Router and install it.

Once installed, you need to configure it to use the ESP32-C6 as a border router. When it is correctly connected and flashed, you will see a device with a name containing usb-Espressif_USB_JTAG_serial_debug_unit_

OpenThread Border Router device

Once the add-on is started, go to Devices and Services Check if the Thread integration is present, if not the case click on Add integration.

In the Thread integration configuration, click on the cog and ensure the thread router border is selected as the one to provide credentials. You can change this by clicking on the three dots.

Default Credential Provider

Matter

The next step is to configure the Matter integration. Go to Devices and Services and look for a Matter integration, If not also add it. This will install the add-on matter at the same time.

Provisioning the device

To allow the provisioning of the thread devices, it is necessary to make your phone download the thread credentials.

This procedure can be found here

Provisioning the device

If everything is correctly configured, you should be able to provision the device by going to the Devices and Services section and clicking on the Add integration button. Then select Matter and follow the instructions.


This article may contain affiliate links. If you buy something through one of these links, I may earn a commission at no additional cost to you. Thank you for supporting my work!