Connecting ESP32-C6 to Golioth over OpenThread

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 network
  • OPENTHREAD_NETWORK_CHANNEL – Thread Network Channel
  • OPENTHREAD_NETWORK_PANID – Thread network PAN ID
  • OPENTHREAD_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!

Marko Puric
Marko Puric
Marko is a Field Applications Engineer (FAE) at Golioth. He helps Golioth customers bring their proofs-of-concept to life, and works with them to overcome initial integration challenges. This effort ensures successful integration of the Golioth Platform into new development and production environments.

Post Comments

No comments yet! Start the discussion at forum.golioth.io

More from this author

Related posts

spot_img

Latest posts

Bluetooth-to-Cloud Connectivity Private Access

We're introducing Bluetooth-to-Cloud Connectivity on Golioth, making it seamless for Bluetooth devices to connect to the cloud. Sign up to be the first to access it.

The Miserable State of Modems and Mobile Network Operators

This is a story of the complexities of cellular connectivity, the perils of closed ecosystems, and how to debug what you cannot see.

Useful Zephyr Shells for IoT Development

The Zephyr shell subsystem will help you directly interact with and troubleshoot your IoT hardware. This post details our most commonly used commands, as well as a listing of all Zephyr shell modules that we could extract from a recent project.

Want to stay up to date with the latest news?

Subscribe to our newsletter and get updates every 2 weeks. Follow the latest blogs and industry trends.