Thread: CLI¶
Overview¶
The Thread CLI sample demonstrates how to send commands to a Thread device using the OpenThread Command Line Interface (CLI). The CLI is integrated into the Zephyr shell.
Requirements¶
Before you start, check that you have the required hardware and software:
- 2x nRF54L15 Connect Kit with U.FL cabled 2.4 GHz Antenna
- 2x USB-C Cable
- A computer running macOS, Ubuntu, or Windows 10 or newer
Attaching the 2.4 GHz antenna¶
Before applying power to the board, ensure the U.FL cabled 2.4 GHz antenna is properly installed.
Building the sample¶
To build the sample, follow the instructions in Getting Started Guide to set up your preferred building environment.
Use the following steps to build the Thread CLI sample on the command line.
-
Open a terminal window.
-
Go to
NCS-Project/nrf54l15-connectkit
repository cloned in the Getting Started Guide. -
Build the sample using the
west build
command, specifying the board (following the-b
option) asnrf54l15_connectkit/nrf54l15/cpuapp
.Tip
The
-p
always option forces a pristine build, and is recommended for new users. Users may also use the-p auto
option, which will use heuristics to determine if a pristine build is required, such as when building another sample. -
After building the sample successfully, the firmware with the name
merged.hex
can be found in thebuild
directory.
Flashing the firmware¶
Connect the nRF54L15 Connect Kit to the computer with a USB-C cable:
Then flash the sample using west flash
:
Tip
In case you wonder, the west flash
will execute the following command:
Testing¶
After both boards are programmed with the CLI sample, complete the following steps to test communication between boards:
-
Connect to both boards with a terminal emulator, specifying the primary COM port that your computer uses to communicate with the nRF54L15:
- Start PuTTY.
-
Configure the correct serial port and click Open:
-
Press the DFU/RST button on both boards to reset the nRF54L15.
-
Configure the required Thread network parameters with the
ot channel
,ot panid
, andot networkkey
commands. Make sure to use the same parameters for all nodes that you add to the network. The following example uses the default OpenThread parameters: -
Enable the Thread network with the
ot ifconfig up
andot thread start
commands: -
Invoke some of the OpenThread commands to obtain network-related details from each device:
-
Test communication between the devices with the
ot ping
command. For example: