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.

3 Likes

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

2 Likes

Nicely done.

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

1 Like

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:

1 Like