nRF5 SDK for Thread and Zigbee v4.1.0
BLE Eddystone and Thread CoAP Server Example

Table of Contents

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.

This BLE-Thread dynamic multiprotocol example requires you to run on the second board any complementary example that contains Thread CoAP Server functionality, for example:

For more information about multiprotocol support, see Multiprotocol support with BLE/Bluetooth.

This example application is based on the Eddystone example available in nRF5 SDK. It has been extended to support dynamic switching between two connection modes, BLE and Thread, at the same time (concurrently). Thread operates on the 802.15.4 radio during Bluetooth low energy radio's inactive time (using Timeslot API). Depending on the Bluetooth low energy connection interval, the nRF52 device can spend up to 99% of the radio time on the Thread protocol.

This example also supports the Thread CoAP Server role, as described in the CoAP Server example.

The application works similarly to ble_app_eddystone, using Nordic's BLE Eddystone implementation.

Note
Transmitting and receiving data does not break connections from any of the used radio protocols (BLE or Thread).

Setup

You can find the source code and the makefile in the following folder: <InstallFolder>\examples\multiprotocol\ble_thread\ble_thread_dyn_coap_srv_eddystone.

LED assignments

The publisher uses LED assignments as described in Thread BSP LED and button reference for the following LEDs:

The following LEDs reserved for user application purposes are assigned in this example on the server:

Button assignments

The following buttons reserved for user application purposes are assigned in this example on the server:

The following buttons are assigned in this example on the client:


Testing

Note
The following testing procedure uses the nRF52840 device.
  1. Prepare two nRF52840 Preview Development Kits and an Android smartphone (you can also use an iOS smartphone).
  2. On the smartphone, install nRF Beacon for Eddystone.
  3. Run the following commands to flash the CoAP Client example to one of the boards:
    $ cd <InstallFolder>/examples/thread/simple_coap_client/hex
    $ nrfjprog -f nrf52 -r --program nrf52840_xxaa_pca10056.hex --chiperase
  4. Install Install micro-ecc. This library is required by the Cryptography library .
  5. Build the example according to the instructions in Building examples.
  6. Flash SoftDevice and the example according to the instructions in Running examples.
  7. You can toggle LED4 on server boards in the network by pressing Button 2 on the client board.
  8. You can provision a client with the server by pressing Button 4 on the server board and then pressing Button 4 on the client board.
  9. Once the boards are provisioned, you can toggle LED4 on the server board by pressing Button 1 on the provisioned client board.
  10. Android phones will detect Eddystone beacons using the Nearby service, but you can also use nRF Connect to view the Eddystone beacons.
  11. Press Button 1 and open nRF Beacon for the Eddystone app.
  12. Go to Update tab and tap Connect.
  13. Select nRF5x_Eddys and tap Unlock when prompted.

You can now configure your Eddystone beacon.


Documentation feedback | Developer Zone | Subscribe | Updated