Amazon Sidewalk - SoC Dynamic Multiprotocol Light#

This is a Dynamic Multiprotocol reference application demonstrating a light bulb that can be switched via Bluetooth or Amazon Sidewalk (BLE or FSK radio layer).

It allows a BLE central device to control the LED on the mainboard and receive button press notifications. To test this demo, install Simplicity Connect mobile application. Simultaneously this sample application leverages the Amazon Sidewalk protocol to connect to the cloud using either BLE or sub-GHz FSK modulation. The Sidewalk endpoint connects to a gateway, allowing it to exchange data with the AWS cloud.

The user interacts with the endpoint either by pressing the main board buttons, through the BLE Simplicity Connect application or through the AWS cloud by issuing CLI commands.

You can learn more about Silicon Labs Multiprotocol libraries on Silicon Labs website.

Ⓘ INFO Ⓘ: This application can be used with Sidewalk-supported EFR32 series 2 SoC with at least 1024kB flash size.

⚠ WARNING ⚠: Sub-GHz communication occurs in the 900MHz band, a frequency open in the US but may be restricted in other regions.

Prerequisites#

To successfully interface with Amazon Sidewalk, this example application requires the preparation of cloud (AWS) resources and the addition of device credentials matched to those resources. To perform these tasks and procure access to a Sidewalk gateway, complete the initial software and hardware setup steps described in Getting Started: Prerequisites.

Ⓘ INFO Ⓘ: If using sub-GHz communication, make note of the additional sub-GHz considerations discussed in the Silicon Labs Wireless Development Kit section of the hardware prequisites.

Build the Application#

With prerequisites in place, generate the primary application image as described in Getting Started: Create and Compile your Sidewalk Application.

Prepare the Cloud and Endpoint#

Create AWS resources to interface with your endpoint and couple the application image with device-specific credentials by following the steps in Getting Started: Provision your Amazon Sidewalk Device.

Modulation Control#

The Dynamic Multiprotocol application is supported only on Sidewalk BLE, Sidewalk FSK and regular BLE radio layer.

Interacting with the Endpoint#

Send commands to the endpoint using either the main board button presses or CLI commands. The J-Link RTT interface provides access to the CLI commands. The following table shows the available commands and their effect, with equivalent button presses where applicable. Some commands are dependent on the currently selected radio layer.

If you press the BTN0, the LED0 should turn on. This will send a notification message to both the BLE and Sidewalk cloud applications. You can also control the LED from both the BLE and Sidewalk cloud applications. Details can be found below in the according section.

When LED1 is available on the hardware, it is used to represent BLE state, the LED is on when advertising and off when not.

Radio board CLI and push-button actions#

Command

Description

Example

Main Board Button

help

Display help menu

> help

N/A

toggle_led

Toggle LED

> toggle_led 0

PB0/BTN0 short press (note 1)

ble_start_stop

Switch BLE advertising on and off

> ble_start_stop

PB0/BTN0 long press

send

Sends an updated counter value to the cloud

> send

PB1/BTN1 (note 1); PB0/BTN0 short press (note 2)

reset

Performs software reset (1) or unregisters the Sidewalk Endpoint (2)

> reset 2

N/A

bleconnect (note 3)

Initiate BLE connection request

> bleconnect

N/A

⚠ WARNING ⚠: The reset 2 command is used to unregister your device with the cloud. It can only be called on a registered AND time synced device.

Notes:

  • (note 1) Not available on xg27, xg29 and kg100s

  • (note 2) Only on xg27, xg29 and kg100s

  • (note 3) Only in BLE-BLE DMP example application

BLE interaction#

You'll need to have the Simplicity Connect mobile app. Once installed you can go to the demo view and select Connected Device. Then you should see Blinky Example appear in the device list. If not make sure that the application is running and not in a faulty state (e.g. Sidewalk stack couldn't start).

Toggle the LED#

Once connected you should see a bulb. By tapping the bulb you can toggle the LED on the board. Also, you can see the source of trigger (Trigger can be Bluetooth, Local control or Amazon Sidewalk). Source is not supported.

State of the LED#

The light bulb state in the mobile app is in sync with the LED on the board.

Sidewalk interaction#

Once your Sidewalk configuration is up and running you can connect to the MQTT test client to see the notification of the LED updates. You can issue a command from the cloud to the endpoint to toggle the LED using Sidewalk.

You can refer to the Interacting with the cloud documentation for instructions.

Toggle the LED#

To toggle the LED via Sidewalk, send the following AWS CLI command:

aws iotwireless send-data-to-wireless-device --id="Wireless-Device-ID" --transmit-mode 0 --payload-data="MQMAAQA=" --wireless-metadata "Sidewalk={Seq=1}"

Ⓘ INFO Ⓘ: Don't forget to specify your Wireless device ID and increment/change the Seq ID (--wireless-metadata "Sidewalk={Seq=1}") for each message.

State of the LED#

In MQTT client you can subscribe to the # channel to see all incoming messages. A specific message is sent from the endpoint to indicate the state of the LED.

Interacting with the Cloud#

Gain additional insight on the network activity from the cloud perspective by using the techniques described in Getting Started: Interacting with the Cloud.

Report Bugs & Get Support#

You are always encouraged and welcome to ask any questions or report any issues you found to us via Silicon Labs Community.