My newest and least cost Thread Border Router

My newest and least cost Thread Border Router takes its place in the “Dongle Forest.”


It works. The lowest cost way to connect Home Assistant with a Thread network is to buy an ESP32C6 dev board from Azason for $12 or spend $6 on one shipped from China. Then download Espressif’s development system and build their example Open Thread Border Router and flash it to the chip. Plug the chip into a USB phone charger and duct-tape it to the wall. (I used blue painter’s tape so as not to leave marks on the wall.)

Notice what I did not say to do: I did not install any add-on to Home Assistant and I did not connect any USB dongle to the server. You don’t need to. A “border router” does just what the name implies. It sits on the border of your WiFi and Thread networks and moves data across the border in either direction. The border router makes Thread data accessible over WiFi and, hence, to Home Assistant.

Buy five of these chips at $6 each and place them all over the house, and now you have a bomb-proof, robust Thread network for $30.

But there might be a better option. The Open Thread router has two parts that talk over a serial link: (1) The Router itself and (2) the Radio CoProcessor. These can be connected with USB, Serial UART, or SPI, or in the case of the single chip solution, the data is passed through internal memory. It is also possible to build the router using two chips. One handles the routing and connects to WiFi, the other just talks to Thread, and they exchange data over some link. This is better because now with two chips, there are two radios, both radios can work at the same time. With one radio in the C6 chip, the radio has to constantly swap modes and can only listen on one network at a time. The example software can be built either way, with one or two chips. So for only double the cost you get a much better router able to handle large networks. But the one-chip one works fine for 6 or 10 devices on the network.

But you want high performance and are cheap, and only want to buy one chip? Yes, that works and is the most common solution. You run the router on the Home Assistant computer inside a Docker container, and then you flash an RCP (Radio Co Processor) onto the ESP32C6 and connect it to the router with USB. The router on the HA server now needs not bother with Wi-Fi. It can send its data internally to Home Assistant. This is the best solution and what you get if you install using HA Web Interface. But you can only have one of these, and you might want 3 or 4 routers to make for a more redundant Thread network. So do the one-or-two chip solution or just spend $100 each and buy an Apple HomePod Mini and place a few of them around the house. They are very good at playing music, and you can say “Siri, turn on the lights," and the microphone hears you from across the room, even with music playing. But at $100 each vs $6 each.

NO. I will NOT post detailed instructions because every online source I found was wrong and missed steps. The only reliable and accurate instructions come from Espressif. Their documentation is excellent and is continuously maintained to keep pace with changes in their development software. I used the example code straight from Espressif.

Notice the latest ESP dev system is version 6.0, and almost all online blogs give instructions based on v5. x versions. Stuff has changed, and it will change again soon. So I will not write detailed steps that will be wrong next month.

Hopefully, this has been helpful. My biggest problems occurred when I tried to follow the steps in blogs or YouTube without first reading the doc myself.

All that said, As soon as this router was on the air, the first thing I did was run a “scan” for other networks. It found a pile of them. Seems my neigbors have Eeros WiFi routers and they have Thread built-in and anounce that fact loudly. It seems that buyiong an Eeros Wifi mesh system woud get you good Thred coverage with no extra work.

Is the device capable of OTA updates? Because my biggest gripe with my home built one was that is was a pain to update manually. I eventually turned to only commercial ones.

That is a good question. My device is not OTA upgradable. But your question made me go back and read to see if the feature could be added. Yes. Espressif’s API supports this and provides a good explanation of the various ways to handle it.

The big problem with OTA is that you need enough memory to hold two copies of the firmware. Conceptually, it is simple. You write incoming data to the empty space in the ROM and then, after some kind of verification passes, you flip a pointer in the boot loader. Then reboot.

They do supply the means to do this without the need to write much of it.

My other ESP32 projects are based on Home Assistant’s “ESPHome” platform. All of these are, in fact, OTA upgradable. ESPHome gives you that with almost zero effort

Nicely done.

I get the gripe with other sources, but perhaps a link to this would be helpful?

Is it possible to plug it to usb in haos so is more reliable, instead of wifi? Like f.i. sonoff dongles.

Or a version that can be connected via ethernet cable? Just asking :face_with_peeking_eye:

Yes. I recenty did this with the same ESP32-C6 dev board. It is now a dongle, or to use the correct term, an RCP (Radio CoProcessor). This requires no coding or much thinking, just build and flash Espresif’s example RDP. Then use a USB cable to connect to the HA server.

But,… You don’t have any manual control over which border router is used. The thread network decides this automatically. You REALLY want to have at least two border routers. So with two, even after adding a dongle to HA, it is a 50/50 chance if that dongle will be used or not. If you have four border routers, you have only a 25% change the dongle is used.

Right now, it seems my Thread network has elected to use the standalone BR that is built with two ESP32 chips. It was using the Apple HomePod some days ago. I can force it to use the dongle that is plugged into the HA server if I disconnect power from all the others and wait.

It is slightly frustrating to buy and set up a Border Router only to see it does nothing other than provide a hot backup. But you need that.

I intend to “upgrade” the standalone BR to Ethernet. Espresif sells the add-on Ethernet port for $9.50. It is easy to do

I want to buy two of these Ethernet ports because there is a new Thread feature: If two BRs find that can communicate over Ethernet, they will route packets over the Ethernet if it takes load off the wireless network or if Ethernet is the only way to connect two “radio islands” that are far apart. I know little about this. The above is everything I know. Eventually, trying it will reach the top of the to-do list. I an not sure it WiFi can also be used this way or if the feature only works with wire.

So you THINK it is somehow cleaner to use the HA-based border router but the Thread networks has another opinion. If you give it only one option, you force it but the result is a fragile Thread network with a single point of failue. But fragile Thread networks can work just fine, until they don’t.