This guide covers the basic build and configuration of OpenThread Commissioner (OT Commissioner). Upon completion of this procedure, you'll have an OT Commissioner CLI executable and a static Commissioner library.
Set up OT Commissioner
Clone the OT Commissioner repository:
git clone https://github.com/openthread/ot-commissioner
Build OT Commissioner
OT Commissioner installs to the
/usr/local directory. If you'd like to change
your installation directory, set
Build OT Commissioner:
cmake -DCMAKE_INSTALL_PREFIX=/usr/local -GNinja ..
Create an Environment variable to run
commissioner-cliin the next step:
Optional. Run unit tests:
Install OT Commissioner
OT Commissioner installs the following to your installation directory:
- OT Commissioner library and header files
- OT Commissioner CLI executable binary
- Default configuration files and credentials
- Scripts to run OT Commissioner CLI as daemon
sudo ninja install
Verify the installation by checking the help menu.
If you installed to the
commissioner-cli is available
from the command line.
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. You can
also view sample files on the ot-commissioner GitHub repository.
To connect to a CCM Thread network, update these fields in
||Unique identifier within the Enterprise Domain.|
||The private key file in PEM format.|
||The certificate file in PEM format.|
||The trust anchor file in PEM format.|
These key and certificate files are used to establish secure sessions between the Commissioner and Border Agent.
The Pre-Shared Key
PSKc is used to establish a secure session between the
Commissioner and Border Agent. To connect to a Non-CCM Thread network, you
can set your
PSKc from the OT Commissioner CLI. For more information,
refer to External Commissioning.
When you run
pi@raspberrypi: commissioner-cli from the command line,
OT Commissioner creates a
commissioner.log file in the current working
directory, for example
/home/pi/commissioner.log. In the JSON configuration
file, you can configure your
LogFile path, logging level, and other log
To start OT Commissioner with your configuration settings:
Commission a joiner
To use OT Commissioner to commission a joiner, refer to External Commissioning.