This example requires the following SoftDevice: S140
Important: Before you run this example, make sure to program the SoftDevice.
This dynamic multiprotocol example application is based on the ble_app_eddystone
example available in nRF5 SDK v15.3.0. It has been extended to support dynamic switching between two protocols, BLE and Zigbee, at the same time (concurrently). From the Zigbee protocol perspective, this example implements a dimmable light bulb, as described in the Light bulb example.
To support both protocols at the same time, the Zigbee stack uses the 802.15.4 radio during the Bluetooth low energy radio's inactive time (using Timeslot API). Depending on the Bluetooth low energy connection interval, the nRF52840 SoC can spend up to 99% of the radio time on the Zigbee protocol. This is the same mechanism as the one used inside Thread Dynamic multiprotocol examples.
For more information on multiprotocol operation, refer to the Multiprotocol support with BLE/Bluetooth support section.
- Note
- Transmitting and receiving data does not break connections from any of the used radio protocols (BLE or Zigbee).
This BLE Zigbee multiprotocol example requires running two other examples containing Zigbee coordinator and Zigbee light switch that can be found in Zigbee Light Control example.
Setup
You can find the source code in the following folder: <InstallFolder>\examples\multiprotocol\ble_zigbee\ble_zigbee_dynamic_light_bulb_eddystone
LED and button assignments
LED assignments:
- BSP_LED_0:
- Toggles when a non-connectable advertisement is sent.
- Is on when the device is advertising connectable advertisements.
- BSP_LED_1 – Is on when the device has connected.
- BSP_LED_2 – Is on when the device has successfully joined the Zigbee network.
- BSP_LED_3 – Can be controlled by the Zigbee light switch.
- Note
- If using this light bulb example on the nRF52840 Dongle (PCA10059), it is the LED1 that informs about the successful joining the Zigbee network, while the LED2 indicates the other states – see the example source code for clarification.
Button assignments:
- BSP_BUTTON_0 – Switch to connectable mode allowing for configuration from nRF Beacon for Eddystone.
Testing
- Precondition
- To test this example, prepare three nRF52840 Preview Development Kits and a smartphone (Android or iOS).
- On the smartphone, install nRF Beacon for Eddystone.
- Run the following commands to flash the Zigbee coordinator example to one of the boards:
$ cd <InstallFolder>/examples/zigbee/light_control/light_coordinator/hex
$ nrfjprog -f nrf52 -r --program nrf52840_xxaa_pca10056.hex --chiperase
- Run the following commands to flash the Zigbee dimmable light switch example to another board:
$ cd <InstallFolder>/examples/zigbee/light_control/light_switch/hex
$ nrfjprog -f nrf52 -r --program nrf52840_xxaa_pca10056.hex --chiperase
- Build the example according to the instructions in Building examples.
- Flash SoftDevice and the example according to the instructions in Running examples.
- You can toggle BSP_LED_3 on the light bulb board in the network by pressing buttons on the light switch board. Android phones will detect Eddystone beacons using the Nearby service, but you can also use nRF Connect.
- Press BSP_BUTTON_0 and open nRF Beacon for the Eddystone app.
- Go to Update tab and tap Connect.
- Select nRF5x_Eddys and tap Unlock when prompted.
Now you can configure your Eddystone beacon.