Setting up your Sidewalk product¶
To correctly set up your Sidewalk device, first you have to onboard it. Complete the Onbarding your Sidewalk devices steps described in the Amazon Sidewalk documentation.
Generate provisioning¶
The tools required for provisioning are located in the repository (sdk-nrf and sdk-sidewalk) under the sidewalk/tools/provision
path.
Follow the Provision your Sidewalk endpoint and flash the binary image documentation.
Note
The default address of the the
mfg.hex
file provided in the official Amazon Sidewalk documentation is incompatible with the nRF Connect SDK applications. You must add the--addr 0xFF000
argument to theprovision.py
script in order to generate themfg.hex
file that is compatible with the nRF Connect SDK memory map.If you are using the combined device JSON file obtained from the AWS IoT console, use the
certificate_json
parameter. It will specify this file as an input when running the provisioning script.python3 provision.py nordic aws --output_bin mfg.bin --certificate_json certificate.json --addr 0xFF000
If you are using separate device JSON files obtained as responses from the GetDeviceProfile and GetWirelessDevice API operations, use the
wireless_device_json
anddevice_profile_json
parameters. This will specify both files as input when running the provisioning script.python3 provision.py nordic aws --output_bin mfg.bin \ --wireless_device_json wireless_device.json \ --device_profile_json device_profile.json \ --addr 0xFF000
Note
The default name of the
mfg.hex
file generated from theprovision.py
script isnordic_aws_nrf52840.hex
. It is, however, compatible with other supported boards.Flash the generated
nordic_aws_nrf52840.hex
file with the provisioning data:$ nrfjprog --sectorerase --program nordic_aws_nrf52840.hex --reset
If you reflashed the
nordic_aws_nrf52840.hex
file on an already working device, you need to deregister the previously flashed device. To do this, perform a factory reset by long pressing Button 1. This will allow you to register a new product (newnordic_aws_nrf52840.hex
) in the Sidewalk network.
Add MQTT to destination¶
Log in to AWS. Open the AWS IoT Core service.
Navigate to Manage → LPWAN devices → Destinations.
Select your destination end press Edit.
Edit the destination details.
Select Publish to AWS IoT Core message broker.
Type your MQTT Topic name.
Edit permissions.
Select Create a new service role and click Save.
Use MQTT client¶
Open the MQTT test client.
Type your MQTT topic in the filter field and click Subscribe.