While we are excited about our advancements in Bluetooth announced on Tuesday, we are still big proponents of Thread. One of the biggest benefits is each end/leaf node in a Thread network having an IP address (IPv6, of course). Then there are the added benefits of meshing, which can extend range and enable even more resilient networks. OpenThread powers these low-power, mesh-based networks for IoT applications. In our previous demo, we showed how to connect an nRF52840-based device to Golioth with the GL-S200 border router.
Today we take it a step further by using the ESP32-C6 development board from Espressif, demonstrating how we successfully connected it to Golioth over OpenThread using ESP-IDF with minimal changes to the Firmware SDK.
Why ESP32-C6 for OpenThread?
The ESP32-C6 is Espressif’s first RISC-V-based SoC with integrated 802.15.4 radio, making it ideal for OpenThread applications. This chip also supports Wi-Fi 6, Bluetooth 5 (LE), and Thread support, allowing it to operate in low-power, wireless mesh networks.
Since OpenThread operates over IEEE 802.15.4, the ESP32-C6, with its onboard 802.15.4 radio, can run the OpenThread stack without requiring additional external radios. This makes it an excellent choice for IoT projects that need reliable and scalable connectivity while maintaining low power consumption.
How we built it
We created a new esp32-openthread
repository in our Golioth Labs account that works with ESP-IDF and OpenThread. There are files in the src
folder that mirror the Reference Design Template
Check out the README for the latest directions on how to build/use it, but here’s a summary:
cd <INSTALL_LOCATION> git clone --recursive [email protected]:goliothlabs/esp32-openthread.git cd <INSTALL_LOCATION>/esp32-openthread/golioth-firmware-sdk git submodule update --init --recursive
Configure the following options in sdkconfig.defaults file:
OPENTHREAD_NETWORK_NAME
– Name of your Thread networkOPENTHREAD_NETWORK_CHANNEL
– Thread Network ChannelOPENTHREAD_NETWORK_PANID
– Thread network PAN IDOPENTHREAD_NETWORK_MASTERKEY
– Network Key of your Thread network
Setup the environment, this step assumes you’ve installed esp-idf v5.3 to ~/esp/esp-idf. If you haven’t, follow the initial steps in examples/esp_idf/README.md
source ~/esp/esp-idf/export.sh cd <INSTALL_LOCATION>/esp32-openthread # From the esp32-openthread directory, set target chip to ESP32-C6: idf.py set-target esp32c6 idf.py build idf.py flash idf.py monitor
You will now be dropped into an ESP-IDF shell, were you can directly interact with the hardware. We’ll add credentials so your device can validate onto the Golioth backend
# Shell Credentials settings set golioth/psk-id "YourGoliothDevicePSK-ID" settings set golioth/psk "YourGoliothDevicePSK"
Firmware SDK Addition
Getting the ESP32-C6 connected to Golioth over OpenThread was pretty straightforward. The only modification required in the Firmware SDK was enabling libcoap IPv6 support.
Once enabled, our ESP32-C6 device was able to communicate over OpenThread, exchange data with the Golioth cloud, and join into our existing OpenThread network.
Using the GL-S200 Border Router
Just like in our previous demo, we used the GL-S200 border router to bridge our OpenThread network to the internet. The GL-S200 remains a great choice due to its stability and ease of setup, making it a reliable gateway for Thread-based devices.
With the ESP32-C6 running OpenThread and the GL-S200 handling the routing, we achieved a fully functional connection to Golioth, demonstrating a scalable way to bring Thread-based devices online with minimal setup effort.
Try It Yourself
Our demo app is available for testing with source code and setup instructions and shows how to connect an ESP32-C6 to Golioth over OpenThread. If you’re working with Thread-based devices, this is an easy way to get started
Give it a try, and let us know what you build!
No comments yet! Start the discussion at forum.golioth.io