This information applies to the following SoCs: nRF52833 and nRF52840.
This example does not support the SES compiler.
This example requires the following SoftDevice: S140
Important: Before you run this example, make sure to program the SoftDevice.
- Warning
- There is an issue in the nRF5 SDK for Thread and Zigbee v4.1.0 that causes higher-than-usual sleep power consumption for all multiprotocol examples when using nRF52840. See workaround on DevZone.
The dynamic BLE-Thread Template example demonstrates the usage of the dynamic multiprotocol method. This example is a merge of a simplified version of BLE Peripheral Template and Thread CLI Example applications.
For more information about multiprotocol support, see Multiprotocol support with BLE/Bluetooth.
The nRF52 device operates simultaneously on Thread and BLE. It joins the Thread network as a Thread FTD device. It also acts as a BLE Peripheral device sending BLE connectable advertisements.
This example provides OpenThread’s built-in command line interface (CLI), and automatically attaches to the Thread network.
Setup
You can find the source code in the following folder: <InstallFolder>\examples\multiprotocol\ble_thread\ble_thread_dyn_template
LED assignments
The example uses LED assignments as described in Thread BSP LED and button reference for the following LEDs:
- LED1 – Used to indicate the network connection state.
Button assignments
The following buttons reserved for user application purposes are assigned in this example:
- Button 1 – Wake up from the BLE sleep mode.
Testing
The following testing procedure uses the nRF52840 device.
- Prepare at least one nRF52840 Preview Development Kit and an Android smartphone.
- On the smartphone, install nRF Connect for Mobile.
- Compile and program the SoftDevice and the application. Observe that the BSP_INDICATE_ADVERTISING state is indicated.
- Connect to the device from nRF Connect (the device is advertising as 'Nordic_Template'). Observe that the BSP_INDICATE_CONNECTED state is indicated.
- Disconnect the device in nRF Connect and observe that the BSP_INDICATE_ADVERTISING state is indicated.
- Connect to the board through UART. The application uses the following UART settings:
-
Baud rate: 115200
-
8 data bits
-
1 stop bit
-
No parity
-
HW flow control: None
Refer to OpenThread CLI reference for complete reference of the OpenThread Command Line Interface.
- Run the
state
command to check the state of the device in the Thread network: The actual state may differ, depending on when the device joined the network.