STM32WB OpenThread Border Router Application

Revision as of 14:44, 17 December 2021 by Registered User

1. Introduction

Regarding Thread implementation, each node forming the 802.15.4 network can act with different roles: Leader, Router, End device or Sleepy End Device (SED). A special role named Border Router allow the Thread nodes to access the outside world through an end-to-end IPv6 connection. A Thread Border Router (i.e., Thread BR) connects a Thread network to other IP-based networks, such as Wi-Fi or Ethernet. A Thread network requires a Border Router to connect to other networks. It is basically a bridge between Thread network and a Wi-Fi or ethernet interface.

OpenThread Border Router


A Thread Border Router minimally supports the following functions:

  • Bidirectional IP connectivity between Thread and Wi-Fi/Ethernet networks.
  • Bidirectional service discovery via mDNS (on a Wi-Fi/Ethernet link).
  • Thread-over-infrastructure that merges Thread partitions over IP-based links.
  • External Thread Commissioning (for example, a mobile phone) to authenticate and join a Thread device to a Thread network.


2. OpenThread Border Router (OTBR) Application Setup

The border router is based on a Raspberry Pi (RPi) loaded with OTBR and a Dory acting as RCP (Radio co-processor). The RCP is controlled by the RPi as a remote Radio and all commands and data packets are send from RPi to RCP and vice versa. OTBR includes:

  • Bridge ethernet/WiFi to Thread
  • Open Thread stack (above MAC)
  • Local web server to server Web pages thru WiFi AP

OTBR comes in Raspberry Pi image which embeds a list of services.

The OpenThread stack partitioning between RPi and STM32WB is as follow: Host processor RPi is running the OpenThread core stack (OTBR), and the RCP is handling the low radio layers (sub-MAC and radio drivers). The host processor typically does not sleep in this design, in part to ensure reliability of the Thread network. The advantage here is that OpenThread can utilize the resources on the more powerful processor. This design is useful for devices that are less sensitive to power constraints.

OpenThread stack partitioning

2.1. Hardware requirements

To setup a minimal running network we need at least:

  • 2 STM32WB are needed to demonstrate Thread BR (one attached with the RPi as RCP and another one forming a Thread network together with Thread BR).
  • 1 FTDI cable (TTL-232R-RPi), used to allow communication RPi and STM32WB RCP.
  • Regarding RPi:
    • A Raspberry Pi 3B or newer
    • Rpi’s External 5V AC adapter for power
    • A microSD card of at least 64GB ("SD card" in this guide). Please choose a Samsung or Sandisk SD card brand as it has been demonstrated by the RPi community to be much more reliable than the other manufacturers
    • A direct internet connection with no VPN thru ethernet
    • USB keyboard
    • HDMI capable screen
    • Ethernet cable to directly connect to an internet ISP box

The following picture depicts 4 nodes OpenThread network.

4 Nodes OpenThread Network

2.2. Raspberry Pi Services and Configuration

A Raspberry Pi (RPi) functioning as an OpenThread Border Router (OTBR) may also serve as a Soft Access Point (SoftAP). This SoftAP acts as a DHCP server to assign IPv4 addresses to the RPi and any devices used as External Commissioners. The RPi must be connected to the internet via Ethernet (eth0 interface) to successfully serve as a SoftAP.