DIY Thread Border Router

Table of Contents
Build a Thread Border Router for $10 or less
Did you know that you can build a TBR for $10 or less? If you’re wondering what the heck a TBR is, here’s a quick summary: A TBR is a device that links a Thread mesh network to other IP-based networks, such as Wi-Fi or Ethernet. Why might you need one? Well, if you buy a Matter-over-Thread device, such as a smart bulb or sensor, you need this tiny device to control it.
That being said, if you have the latest Apple TV or a smart speaker from Google, a TBR is already baked into your device, and you’re good to go. But if you’re like me and don’t have either, you’ll need to buy one. And they aren’t cheap. IKEA’s DIRIGERA sells for CAD $100.
An unexpected journey
It all started when my friend dragged me to IKEA. I saw their smart bulb (KAJPLATS) with a remote for just $10 and bought it out of sheer curiosity, but mainly for the cute remote. It worked out of the box with no manual configuration. Great, or so I thought, rather prematurely. However, when I tried to control the bulb with my phone, I realized these devices don’t connect to Wi-Fi as I had assumed. After a little digging, I came across the term TBR for the very first time.
The Plan
I wasn’t ready to drop $100 just to test a single device. But while looking for inexpensive TBRs, I came across a tutorial that claimed I could build one for just $5. It turns out that an ESP32 is fully capable of acting as a TBR, and Google has published open-source software for TBRs. I also learned that Home Assistant can control Matter/Thread devices. It looked like every piece of the puzzle was attainable in theory. All that was left was putting them together.
ESP32
I love this board: tiny yet mighty. Just beware that there are many variants, and not all of them support the Matter-over-Thread protocol. Some great YouTube videos explain the various models, so you shouldn’t have any trouble choosing one. But if a TBR is your main objective, go with Seeed Studio’s C6 variant, which also has Wi-Fi support. It’s made by a reputable company, and I got mine for just under $10 from AliExpress. I bought a 4MB board but read afterward that an 8MB version is better. I haven’t had any issues so far, though, so this might be something to investigate.
It was also highly recommended to get an external antenna (also quite cheap) to extend the range. But I passed on that since I live in a small apartment.

Software
This is where things got a little frustrating. Although there were enough tutorials, there wasn’t much help when something went wrong or when the concepts weren’t clear. The concepts behind the Matter and Thread protocols are easy to understand, but flashing firmware, configuring it, and troubleshooting it were anything but straightforward.
In fact, after I completed the tutorial to flash my ESP32 and connected it to my Home Assistant, things almost worked. I wasn’t able to add my ESP32 to my preferred network, which was a necessary step. I also realized that the tutorial I was following required the ESP32 to remain connected to the device running HA via USB. I’m sure people experienced in this space would have realized this early on, but not a newbie like me. So even if the tutorial had worked, I wouldn’t have been very happy with the outcome.
Luckily, after some sleuthing, I found another promising tutorial. It worked like a charm and avoided the need to keep my TBR physically connected to the HA device. I’ve documented the detailed procedure in that thread.
A note about Home Assistant
HA is simply amazing. I feel a little bad using such a powerful OS just to control a single bulb. That being said, it wasn’t all smooth sailing at the beginning, although not on account of HA. You see, I have an old Intel MacBook Pro running as a home server, so I thought I’d run HA in a VM on it. I did, for a while. But every couple of days, HA’s clock drifted or got stuck. Despite numerous attempts to fix the timer, I never found a working solution.
Fortunately, I also have a Raspberry Pi 4B (2GB RAM). After a quick Docker setup, HA has been running happily without any glitches. The point is that if you’re thinking about running HA in a VM, expect some surprises. It’s better to run HA on a dedicated device.
Case
Another fun part of this project was 3D-printing a case. There are many available for this board, and I used a cute design from MakerWorld. I’m also fortunate to live in a city where I could print it at my local library for free.
3D printing the case

The cute little TBR on my wall

Conclusion
I’m very happy with the outcome and the experience of this project. It’s an excellent introduction to the ESP32, Matter/Thread protocols, the IKEA smart bulb and programmable remote, Home Assistant, and even 3D printing. There’s easily a semester’s worth of stuff here.
