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.

  1. 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 the provision.py script in order to generate the mfg.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 and device_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 the provision.py script is nordic_aws_nrf52840.hex. It is, however, compatible with other supported boards.

  2. 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 (new nordic_aws_nrf52840.hex) in the Sidewalk network.

Add MQTT to destination

  1. Log in to AWS. Open the AWS IoT Core service.

    ../_images/AWSIoTCore.png
  2. Navigate to Manage → LPWAN devices → Destinations.

    ../_images/AWSIoTCoreDestinations.png
  3. Select your destination end press Edit.

    ../_images/AWSIoTCoreDestinationEdit.png
  4. Edit the destination details.

    1. Select Publish to AWS IoT Core message broker.

    2. Type your MQTT Topic name.

      ../_images/AWSIoTCoreDestinationTestMQTT.png
    3. Edit permissions.

    4. Select Create a new service role and click Save.

      ../_images/AWSIoTCoreDestinationTestRole.png

Use MQTT client

  1. Open the MQTT test client.

  2. Type your MQTT topic in the filter field and click Subscribe.

    ../_images/AWSIoTCoreMQTT.png