Google is committed to advancing racial equity for Black communities. See how.

OpenThread Commissioner Build and Configuration

This guide covers the basic build and configuration of OpenThread Commissioner (OT Commissioner). Upon completion of this procedure, you will have an OT Commissioner CLI executable and a static Commissioner library.

Set up the Commissioner

  1. Clone the OT Commissioner repository:
    git clone https://github.com/openthread/ot-commissioner
  2. Install dependencies:
    cd ot-commissioner
    ./script/bootstrap.sh
  3. Build OT Commisioner:
    mkdir build
    cd build
    cmake -DCMAKE_INSTALL_PREFIX=/usr/local -GNinja ..
    ninja -j16
  4. Optional. Run unit tests:
    ./tests/unit/commissioner-tests

Install the Commissioner

Install OT Commissioner in the /usr/local directory. This will install:

  • OT Commissioner library and header files
  • OT Commissioner CLI executable binary
  • Default configuration files and credentials
  • Scripts to run OT Commissioner CLI as daemon

To change the installation directory, set -DCMAKE_INSTALL_PREFIX.

ninja install

Verify the installation by checking the help menu:

commissioner-cli -h

Configuration

The OT Commissioner CLI supports both Thread 1.2 Commercial Commissioning Mode (CCM) and Thread 1.1 commissioning (Non-CCM). To connect to different Thread networks, a JSON configuration file is needed to start OT Commissioner CLI:

  • ccm-config.json — The default configuration file for CCM Thread Network.
  • non-ccm-config.json — The default configuration file for Non-CCM Thread Network.

By default, these configuration files are installed in /usr/local/etc/commissioner.

CCM configuration

To connect to a CCM Thread network, update these fields in ccm-config.json:

Field Description
DomainName Unique identifier within the Enterprise Domain.
PrivateKeyFile The private key file in PEM format.
CertificateFile The certificate file in PEM format.
TrustAnchorFile The trust anchor file in PEM format.

These key and certificate files are used to establish secure sessions between the Commissioner and Border Agent.

Non-CCM configuration

To connect to a Non-CCM Thread network, update this field in non-ccm-config.json:

Field Description
PSKc The Pre-Shared Key used to establish secure session between the Commissioner and Border Agent.

Commission a joiner

To use OT Commissioner to commission a joiner, see External Thread Commissioning.