nRF5 SDK for Thread v0.11.0
BLE Eddystone and Thread CoAP Server Example
This example requires the following SoftDevice: S140

Important: Before you run this example, make sure to program the SoftDevice.

This BLE-Thread dynamic multiprotocol example requires you to run any complementary example on the second board, i.e. an example containing Thread CoAP Client 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 may 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, utilizing 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\experimental\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/experimental/simple_coap_client/hex
    $ nrfjprog -f nrf52 -r --program nrf52840_xxaa.hex --chiperase
  4. Build the example according to the instructions in Building examples.
  5. Flash SoftDevice and the example according to the instructions in Running examples.
  6. You can toggle BSP_LED_3 on server boards in the network by pressing BSP_BUTTON_1 on the client board.
  7. 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.
  8. Once the boards are provisioned, you can toggle BSP_LED_3 on te server board by pressing BSP_BUTTON_0 on the provisioned client board.
  9. Android phones will detect Eddystone beacons using the Nearby service, but you can also use nRF Connect to view the Eddystone beacons.
  10. Press BSP_BUTTON_0 and open nRF Beacon for the Eddystone app.
  11. Go to Update tab and tap Connect.
  12. Select nRF5x_Eddys and tap Unlock when prompted.
  13. Now you can configure your Eddystone beacon.

Documentation feedback | Developer Zone | Subscribe | Updated