This blog is to describe how to set up the nRF52840 DK board communicating with an Echo device over Bluetooth Low Energy (BLE) / Bluetooth Smart.
What is the Alexa Gadgets?
Amazon provides Alexa Gadgets Toolkit which can build your own Alexa Gadget and then communicate/interacts with compatible Amazon Echo devices over Bluetooth.
You can build up your own Alexa Gadget and connect as below features.
Details can be found at the Amazon online documentation.
Nordic nRF5 on the Alexa Gadgets
Nordic Semiconductor press release has announced that the latest version of its nRF Connect SDK (Software Development Kit) (version 1.4) includes example application software code for Alexa Gadgets. By using the code as the basis for software development, developers can accelerate time-to-market for Alexa Gadgets based on Nordic’s nRF52 Series or nRF5340 Bluetooth® 5.2/Bluetooth Low Energy (Bluetooth LE) Systems-on-Chip (SoCs).
nRF Connect SDK
nRF Connect SDK 1.4 version has started to support on the Alexa Gadgets. The example code be found at the nrf\samples\bluetooth\alexa_gadgets.
The Peripheral Alexa Gadgets sample demonstrates how a Bluetooth LE device can connect to an Amazon Echo device using the Alexa Gadgets Bluetooth Service and Profile.
Documentation for the Gadgets Service and Profile can be found at Alexa Gadgets Bluetooth LE.
Before a Gadget can be connected to an Amazon Echo device, you must register it with Amazon. See Alexa Gadgets Setup for information on how to do this.
You need to install the Nanopb on your platforms.
This sample depends on an external protobuf compiler tool – Nanopb.
unzip -d nanopb nanopb-0.4.4-windows-x86.zip
After unzip the package, you need to add the PATH inside the system environmental path.
You can use the command to refresh the environmental path.
How to compile the nRF52840 DK firmware on the Alexa Gadgets.
When registering the Gadget, you will receive two identifier strings:
- Device Amazon ID
- Device secret
You must update the
CONFIG_GADGETS_DEVICE_SECRET configuration options in
prj.conf with the values that you received during registration.
On when connected.
On when handshake with peer is completed.
On when wakeword directive (
Alexa.Gadget.StateListener) is received.
Toggles when Color Cycler skill is used.
Erases bond information when button is held during power cycle or reset.
After programming the sample to your board, test it by performing the following steps:
- Optionally, set up log monitoring:
- Connect the board to the computer using a USB cable. The board is assigned a COM port (Windows) or ttyACM device (Linux), which is visible in the Device Manager. Connect to the kit with a terminal emulator (for example, PuTTY). See How to connect with PuTTY for the required settings.
- Reset the board.
- Follow these instructions to pair your Echo device with the sample: Alexa Gadgets Pairing.
- Observe that LED 1 turns on to indicate that a connection has been established.
- Observe that LED 2 turns on to indicate that the Alexa Gadgets handshake has completed.
- Speak the “Alexa” wake word to your Echo device and observe that LED 3 turns on.
- If you are monitoring the log output from the COM port, observe log activity during Alexa queries.