Table of Contents
The following examples demonstrate different features of the Thread stack running on the nRF52840 or the nRF52833 device.
Before running the examples, see Running precompiled examples.
- Thread multiprotocol examples demonstrate the usage of Thread and BLE within the same example application.
- Thread-only examples demonstrate the usage of applications based only on Thread.
- Device support breakdown
- Not all Thread examples support both the nRF52840 or the nRF52833 devices. See both sections for more information.
- SoftDevice usage
- Thread examples do not use the SoftDevice, with the exception of multiprotocol examples.
- Thread example parameters
- All Thread examples, except for the Thread NFC MeshCoP Example, have been precommissioned with the following parameters:
In an end product, precommissioning must NOT be used. Use the commissioning procedure to obtain network credentials.Radio Channel: 11PAN ID: 0xABCDNetwork Master Key: 0x00112233445566778899AABBCCDDEEFFMesh-Local Prefix: FDDE:AD00:BEEF::/64
Testing
You can find the source code and the project file of the examples in the following folder: <InstallFolder>/examples/thread
Use the following steps to test the Thread examples:
- Build the example according to the instructions in Building examples.
- Use nrfjprog (from nRF5x Command Line Tools v10.3.0 or newer) to program the .hex file that was created in the
_buildfolder to the board. - Use an RTT viewer to see the log messages produced by the application.
Command Line Interface support
Most examples expose a Command Line Interface (CLI) over a serial port. Refer to OpenThread CLI Reference for details of the available commands.
The following examples do not expose a CLI:
- MTD CoAP Client
- Thread NCP/RCP Example
- BLE UART and Thread Switched MTD CoAP Client Example
- Thread MQTT-SN Sleepy Nodes Example
Thread BSP LED and button reference
All Thread examples use the following LED assignments:
- LED1 (
BSP_LED_0orBSP_BOARD_LED_0) – Network connection state:- Disabled – Node is disconnected and is not currently connecting to a Thread mesh network.
- Slow blinking (period of 200 ms when on, period of 800 ms when off) – Node is not connecting to a Thread mesh network.
- Rapid blinking (period of 100 ms) - Node is connecting to a Thread mesh network.
- Solid – Node is connected to a Thread mesh network, either as a Child or as a Leader.
- LED2 (
BSP_LED_1orBSP_BOARD_LED_1) –- Commissioning state:- Disabled – Example does not support commissioning.
- Slow blinking (period of 200 ms when on, period of 800 ms when off) – Node supports commissioning but is not commissioned.
- Rapid blinking (period of 100 ms) – Node is currently in the commissioning procedure.
- Solid – Node is commissioned.
- LED1 and LED2 blinking four times synchronously (400 ms period): Node received an ICMPv6 Ping Request message.
- Note
- Switched multiprotocol examples use LED2 to indicate the active network stack.
- Reserved for user application purposes:
- LED3 (
BSP_LED_2orBSP_BOARD_LED_2) - LED4 (
BSP_LED_3orBSP_BOARD_LED_3)
- LED3 (
All buttons are reserved for user application purposes. The following buttons are available:
- Button 1 (
BSP_BUTTON_0orBSP_BOARD_BUTTON_0) - Button 2 (
BSP_BUTTON_1orBSP_BOARD_BUTTON_1) - Button 3 (
BSP_BUTTON_2orBSP_BOARD_BUTTON_2) - Button 4 (
BSP_BUTTON_3orBSP_BOARD_BUTTON_3)
See example pages for assignments related to each example.