Though Thread and Matter-based devices are gradually going mainstream, dedicated hubs, or routers to manage them remain expensive. If you are a DIY enthusiast like me, you can create an OpenThread Border Router without breaking the bank. And it integrates instantly with Home Assistant to streamline communication between Thread and Matter devices.

All it takes is a Raspberry Pi and an ESP32 board (specifically, a particular model) to create an OpenThread Border Router. The best part is that you don’t need to wipe anything off your existing Raspberry Pi board either. That’s what I did. Here’s how I used this cheap ESP32 to turn my Raspberry Pi into an OpenThread Border Router.

Selecting the hardware to build an OpenThread Border Router

Picking elements for a functional, but affordable setup

Raspberry Pi is a fantastic single-board computer, but it lacks a built-in IEEE 802.15.4 radio interface. Similarly, though the ESP32 performs some tasks better than the Pi, it lacks processing power. So, you need to pair them together to work as host and radio processor components. I utilized a Raspberry Pi 4B for processing and an ESP32-H2 development board I already owned. You can use the Pi 3 or a higher model. While my Pi 4 case (Argon40) exposes GPIO pins, I skipped it intentionally to avoid messy wiring. Obviously, yanking wires from a live system can damage the ESP32-H2 board or Pi. So, I connected the ESP32 over USB for simplicity and a reliable serial connection.

Using the ESP32-H2 is more economical than the $25 nRF52840 MDK USB dongle to build an OpenThread Border Router. That’s expensive if you want the comfort of a plug-and-play and neat setup. However, the ESP32-H2 board is the cheapest option with some extra effort.

Raspberry Pi 4

Getting the ESP32 ready with RCP firmware

Requires building a custom one

To get started, you’ll need to flash a Radio Co-Processor (RCP) supporting firmware onto the ESP32-H2 board, as it doesn’t come preloaded with these binaries. For that, you need to clone the ESP-IDF and ESP Thread Border Router SDK repositories from GitHub as per the official ESP-IDF documentation. Since I used a Mac to build and flash the firmware, I ensured that Homebrew was installed, along with Python 3, Ninja, and CMake.

For reliable USB communication, I flash the firmware at a 460800 baud rate. If you want to use UART over GPIO, you need to drop the baud rate to 115200. The menu configuration step is crucial for enabling the board to automatically join a Wi-Fi network and create a Thread network if these settings are absent on the board. Building the firmware took 15 minutes. Once compiled, I flashed it to the ESP32 and verified that RCP booted without crashing.

Prepping Raspberry Pi to run OpenThread Border Router

Setting up the host device for processing and networking

With the RCP module ready, the next step was to set up the OpenThread Border Router host on a Raspberry Pi. The quickest way to run the official Docker image, but it kept crashing in my setup. The otbr-agent wouldn’t run properly, and the OpenThread Border Router’s web UI was unreachable.

So, I switched to building OTBR natively using its official repo on the Raspberry Pi, and it took about 20 minutes. Next, I created a custom otbr-agent service, pointing it to ESP32-H2’s USB address and assigning it a proper radio URL with the baud rate — the default is 460800 for USB.

Ensure the baud rate specified in the radio URL matches; otherwise, the OTBR will fail to allow devices to communicate efficiently.

When the agent is running, ensure that the wpan0 interface is active so that the Pi can talk and consistently route traffic from the radio co-processor over the USB connection.

Weaving a web interface for easily connectivity

Makes it easier to manage networks

The native setup adds an optional web UI to make it easier to form new Thread networks and diagnose issues. To enable it, find out the otbr-agent’s location and specify it in the otbr-web configuration file. Would you like to access the interface on your network? Add 0.0.0.0 next to the otbr-agent’s location so the web UI is reachable from other devices on the same network. Then, start the otbr-web service and open the web interface in a browser with just the Raspberry Pi’s address.

The web interface may seem challenging to use initially. To create (or form as the UI states) a new network, I generated the Extended PAN ID, PAN ID, and Network key using OpenSSL’s random hex generator on Raspberry Pi. Finally, I chose a non-overlapping channel to avoid any adjacent interference with my home Wi-Fi’s channels.

Make a full local, inexpensive OpenThread Border Router

Once everything was set up, Home Assistant detected the new OpenThread Border Router without any manual configuration, all thanks to the Thread integration. Adding new Thread and Matter over Thread devices is seamless in Home Assistant. Also, it creates a self-healing mesh network that is fully local, independent of cloud services, with no vendor dependency, and utilizes low power.

For a setup that was built entirely with the components I already owned, the extra work was worth the speed and reliability. If you want to construct a privacy-respecting local smart home that meets modern standards, a DIY OpenThread Border Router with ESP32-H2 and Raspberry Pi is a cost-effective way to start.