nRF5 SDK for Thread and Zigbee v2.0.0
BLE Eddystone and Thread CoAP Server Example

Table of Contents

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:

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, nRF52840 SoC 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).

LED assignments:

Button assignments:

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.

Testing

  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.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 BSP_LED_3 on server boards in the network by pressing BSP_BUTTON_1 on the client board.
  8. You can provision a client with the server by pressing BSP_BUTTON_3 on the server board and then pressing BSP_BUTTON_3 on the client board.
  9. Once the boards are provisioned, you can toggle BSP_LED_3 on the server board by pressing BSP_BUTTON_0 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 BSP_BUTTON_0 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