Pair and Connect a Gadget to an Echo Device Over Classic Bluetooth
This topic describes how to establish a Classic Bluetooth (BR/EDR) connection between a gadget and an Echo device that have never been paired, or whose pairing information has been removed.
For the process by which a paired gadget can reconnect to an Echo device after becoming disconnected from it, see Reconnection Flow for Alexa Gadgets over Classic Bluetooth.
For Alexa Gadgets Toolkit issues related to Bluetooth, see Bluetooth on the known issues page.
- Discovery phase
- Pairing phase
- RFCOMM connection phase
- Alexa Gadgets Toolkit directives and events
- Problem: The gadget cannot pair to the Echo device
- Problem: The gadget can pair to an Echo device, but does not receive an RFCOMM connection request from the Echo device
- Problem: The gadget can pair to and receive an RFCOMM connection request from an Echo device, but does not receive an
Alexa.Discovery.Discoverdirective from the Echo device
The following figure shows how a gadget and an Echo device establish a Classic Bluetooth connection with which to exchange Alexa Gadgets directives and events. The steps are explained after the figure.
The Echo device and the gadget discover each other over Classic Bluetooth as follows:
- The user puts the gadget into pairing mode. This procedure depends on the gadget. For example, a button gadget might use a long press. If your gadget has a touchscreen, a user could enable pairing through an option on the screen.
- The user puts the Echo device into pairing mode. For Echo devices without a screen, a user can put an Echo device into pairing mode by using the Amazon Alexa app. In the Alexa app, the user goes to Settings, selects the Echo device, and then selects Pair Alexa Gadget under Connected Devices. If the Echo device has a screen, the user follows on-screen instructions to initiate pairing.
- The Echo device scans for Bluetooth devices within range by sending out an inquiry request.
- The gadget responds to the Echo device's inquiry request with an Extended Inquiry Response (EIR) that contains the parameters listed in Extended Inquiry Response settings.
After finding the gadget and connecting to it over the link layer, the Echo device pairs with the gadget using the standard Bluetooth Secure Simple Pairing (SSP) process. To do so, the gadget must use the parameters listed in Pairing parameters. In addition to a pairing request and response, pairing entails the exchange of information such as I/O capabilities, link keys, and so on.
When pairing is complete, the gadget and the Echo device do not need to be paired again, even after they are disconnected, unless they have become unpaired.
RFCOMM connection phase
The Echo device then sends the gadget a request to connect to its RFCOMM server. For this connection to be established, the gadget's local Service Discovery Protocol (SDP) database must contain the settings listed in SDP database settings.
Alexa Gadgets Toolkit directives and events
The Echo device and the gadget now exchange the following information using protocol buffer format:
- The Echo device sends the gadget a
- The gadget responds with a
Discover.Responseevent that, along with other information, contains a hash of the DSN and the device type secret that your gadget was assigned when you registered it in the developer portal.
- The Echo device and the gadget exchange directives and events that are defined by the Alexa Gadgets Toolkit interfaces.
If you encounter problems pairing or connecting your gadget to an Echo device, review the following tips.
Problem: The gadget cannot pair to the Echo device
The gadget's Bluetooth stack is not configured correctly.
Problem: The gadget can pair to an Echo device, but does not receive an RFCOMM connection request from the Echo device
The gadget did not send an SDP connection request to the Echo device.
The Echo device does not recognize the gadget as an Alexa Gadget. Instead, the Echo device thinks the gadget is a regular Bluetooth device.
The Echo device recognizes the gadget as an Alexa Gadget, but the Echo device fails to get the correct SDP response from the gadget.
Problem: The gadget can pair to and receive an RFCOMM connection request from an Echo device, but does not receive an
Alexa.Discovery.Discover directive from the Echo device
The gadget's RFCOMM server is not set up correctly.
Was this page helpful?
Last updated: Feb 14, 2022