diff --git a/doc/images/unify_sample_new.png b/doc/images/unify_sample_new.png new file mode 100644 index 0000000000..65a4aa9401 Binary files /dev/null and b/doc/images/unify_sample_new.png differ diff --git a/doc/images/unify_sample_old.png b/doc/images/unify_sample_old.png new file mode 100644 index 0000000000..054301d6ed Binary files /dev/null and b/doc/images/unify_sample_old.png differ diff --git a/doc/index.rst b/doc/index.rst index 6020ac28f1..26e763a29d 100644 --- a/doc/index.rst +++ b/doc/index.rst @@ -41,7 +41,7 @@ Browse the content by referring to the following pages: :caption: Subpages: setting_up_sidewalk_environment/setting_up_environment.rst - testing_samples/samples.rst + samples/samples_list.rst compatibility_matrix.rst sidewalk_release_notes.rst additional_resources.rst diff --git a/doc/samples/samples_list.rst b/doc/samples/samples_list.rst new file mode 100644 index 0000000000..ca47a7d5c5 --- /dev/null +++ b/doc/samples/samples_list.rst @@ -0,0 +1,48 @@ +.. _samples_list: + +Samples overview +################ + +In the Sidewalk repository, all samples are placed in the :file:`samples` directory. + +The following table demonstrates configuration for the supported development kits and differences between samples: + +.. tabs:: + + .. tab:: nRF52840 + + +-----------------------------+--------------------------------------------------------------------------+-----------------------------------------------+-------------------------------+-----------------------+--------------+-------------+-------------+ + | Sample | Additional hardware | Bootloader (in release and debug configs) | Application overlays | Bluetooth® LE support | LoRa support | FSK support | DFU support | + +=============================+==========================================================================+===============================================+===============================+=======================+==============+=============+=============+ + | :ref:`sidewalk_template` | * External flash (included in the DK) | * MCUboot - DFU partition in external flash | * ``overlay-dut.conf`` | Supported | Supported | Supported | Supported | + | | * `Semtech SX1262MB2CAS`_ (only for the configurations with LoRa or FSK) | * Application partition size = 956 kB | | | | | | + | | | | | | | | | + +-----------------------------+--------------------------------------------------------------------------+-----------------------------------------------+-------------------------------+-----------------------+--------------+-------------+-------------+ + + .. tab:: nRF5340 + + +-----------------------------+--------------------------------------------------------------------------+-----------------------------------------------+-------------------------------+-----------------------+--------------+-------------+-------------+ + | Sample | Additional hardware | Bootloader (in release and debug configs) | Application overlays | Bluetooth® LE support | LoRa support | FSK support | DFU support | + +=============================+==========================================================================+===============================================+===============================+=======================+==============+=============+=============+ + | :ref:`sidewalk_template` | * External flash (included in the DK) | * MCUboot - DFU partition in external flash | * ``overlay-dut.conf`` | Supported | Supported | Supported | Supported | + | | * `Semtech SX1262MB2CAS`_ (only for the configurations with LoRa or FSK) | * Application partition size = 956 kB | | | | | | + | | | | | | | | | + +-----------------------------+--------------------------------------------------------------------------+-----------------------------------------------+-------------------------------+-----------------------+--------------+-------------+-------------+ + +.. toctree:: + :maxdepth: 1 + :glob: + :caption: New samples migration guide: + + why_new_template.rst + +.. toctree:: + :maxdepth: 1 + :glob: + :caption: List of samples: + + template.rst + +.. include:: ../ncs_links.rst + +.. _Semtech SX1262MB2CAS: https://www.semtech.com/products/wireless-rf/lora-transceivers/sx1262mb2cas diff --git a/doc/testing_samples/samples_list.rst b/doc/samples/template.rst similarity index 60% rename from doc/testing_samples/samples_list.rst rename to doc/samples/template.rst index 883c3cede9..e7ce3ba067 100644 --- a/doc/testing_samples/samples_list.rst +++ b/doc/samples/template.rst @@ -1,4 +1,4 @@ -.. _samples_list: +.. _sidewalk_template: Sidewalk Template ################# @@ -31,45 +31,22 @@ The supported modules are as follows: +------------+---------------+------------+ .. note:: - The LoRa radio module shield must be connected to the development kit header, and the antenna must be connected to the radio module. + To use sub-GHz radio, the Semtech shield must be connected to the development kit header, and the antenna must be connected to the radio module. For the exact pin assignment, refer to the :ref:`setting_up_hardware_semtech_pinout` section. - Overview ******** You can use this sample as a starting point to implement a Sidewalk device. The Sidewalk Template demonstrates a simple Sidewalk application that allows you to send and receive messages, as well as update firmware. -In the Sidewalk repository, all samples are placed in the :file:`samples` directory. - -The following table demonstrates configuration for the supported development kits and differences between samples: - -.. tabs:: - - .. tab:: nRF52840 - - +-----------------------------+--------------------------------------------------------------------------+-----------------------------------------------+-------------------------------+-----------------------+--------------+-------------+-------------+ - | Sample | Additional hardware | Bootloader (in release and debug configs) | Application overlays | Bluetooth® LE support | LoRa support | FSK support | DFU support | - +=============================+==========================================================================+===============================================+===============================+=======================+==============+=============+=============+ - | :ref:`sidewalk_template` | * External flash (included in the DK) | * MCUboot - DFU partition in external flash | * `overlay-dut.conf` | Supported | Supported | Supported | Supported | - | | * `Semtech SX1262MB2CAS`_ (only for the configurations with LoRa or FSK) | * Application partition size = 956 kB | | | | | | - | | | | | | | | | - +-----------------------------+--------------------------------------------------------------------------+-----------------------------------------------+-------------------------------+-----------------------+--------------+-------------+-------------+ - - .. tab:: nRF5340 - - +-----------------------------+--------------------------------------------------------------------------+-----------------------------------------------+-------------------------------+-----------------------+--------------+-------------+-------------+ - | Sample | Additional hardware | Bootloader (in release and debug configs) | Application overlays | Bluetooth® LE support | LoRa support | FSK support | DFU support | - +=============================+==========================================================================+===============================================+===============================+=======================+==============+=============+=============+ - | :ref:`sidewalk_template` | * External flash (included in the DK) | * MCUboot - DFU partition in external flash | * `overlay-dut.conf` | Supported | Supported | Supported | Supported | - | | * `Semtech SX1262MB2CAS`_ (only for the configurations with LoRa or FSK) | * Application partition size = 956 kB | | | | | | - | | | | | | | | | - +-----------------------------+--------------------------------------------------------------------------+-----------------------------------------------+-------------------------------+-----------------------+--------------+-------------+-------------+ +.. _sidewalk_template_user_interface: User Interface ************** +Common button actions for all template configurations: + Button 1 (short press): Sends a message to the cloud. The type of message depends on sample configuration. @@ -87,8 +64,6 @@ Button 3 (long press): Toggles the Sidewalk link mask - This action switches from Bluetooth LE to FSK, from FSK to LoRa, and from LoRa to Bluetooth LE. A log message informs about the link mask switch and the status of the operation. -Buttons short press actions and LEDs behavior depends on selected sample configuration and is described in the next part of the documentation. - Configuration ************* @@ -145,12 +120,9 @@ Configuration options for Sidewalk * ``CONFIG_SIDEWALK_DFU`` -- Enables the nRF Connect SDK bootloader and DFU service over Bluetooth LE. -Configuration options for sample -================================ - * ``CONFIG_TEMPLATE_APP`` -- Switch between different application types. - * ``CONFIG_TEMPLATE_APP_HELLO`` -- Enables simple Sidewalk hello world application. This is default option. See :ref:`sidewalk_template` for more information. + * ``CONFIG_TEMPLATE_APP_HELLO`` -- Enables simple Sidewalk hello world application. This is default option. See :ref:`sidewalk_hello` for more information. * ``CONFIG_TEMPLATE_APP_SENSOR_MONITORING`` -- Enables Sidewalk Sensor monitoring application. See :ref:`sensor_monitoring` for more information. * ``CONFIG_TEMPLATE_APP_CLI`` -- Enables Sidewalk CLI. To see the list of available commands, flash sample and type ``sid help``. @@ -159,11 +131,61 @@ Configuration options for sample * ``CONFIG_SIDEWALK_AUTO_CONN_REQ`` -- Enable automatic connection request before message send. The Bluetooth LE connection request action is performed automatically if needed. +You can build the ``sensor_monitoring`` template application, with Bluetooth LE only libraries for ``build_target`` by running the following command in the project directory: + +.. parsed-literal:: + :class: highlight + + $ west build -b *build_target* -- -DCONFIG_TEMPLATE_APP_SENSOR_MONITORING=y -DCONFIG_SIDEWALK_SUBGHZ_SUPPORT=n + +For example: + +.. code-block:: console + + $ west build -b nrf5340dk_nrf5340_cpuapp -- -DCONFIG_TEMPLATE_APP_SENSOR_MONITORING=y -DCONFIG_SIDEWALK_SUBGHZ_SUPPORT=n + Configuration overlays ====================== * ``overlay-dut`` -- Sidewalk Device Under Test configuration. Enables CLI, disables sample automation. +You can build the template application with Sidewalk DUT configuration overlay for ``build_target`` by running the following command in the project directory: + +.. parsed-literal:: + :class: highlight + + $ west build -b *build_target* -- -DOVERLAY_CONFIG="overlay-dut.conf" + +For example: + +.. code-block:: console + + $ west build -b nrf52840dk_nrf52840 -- -DOVERLAY_CONFIG="overlay-dut.conf" + + +Source file setup +***************** + +The application consists of two source files: + +* :file:`main.c` -- The main source file. Starts Sidewalk application. +* :file:`app.c` (:file:`app.h`) -- The application specific file. + It communicates to the sidewalk thread using events defined in :file:`sidewalk.h`, and receives Sidewalk callbacks defined in :file:`sid_api.h`. + An application may consist of multiple `app_*` files, to define user interface and realize application logic. +* :file:`sidewalk.c` (:file:`sidewalk.h`) -- Sidewalk thread file. + This is a common source file for all sample configuration. + It implements a separate thread where the Sidewalk API is called. + The file also includes the support for the DFU state. + See the behavior of the state machine outlined in the following diagram: + + .. uml:: + :caption: Sidewalk thread state machine + + [*] --> Sidewalk + Sidewalk --> [*] : event_factory_reset + Sidewalk --> FirmwareUpdate : event_dfu + FirmwareUpdate --> Sidewalk : event_dfu + .. _sidewalk_template_building_and_running: Building and Running @@ -182,15 +204,41 @@ This sample can be found under :file:`samples/template`. To build the sample, follow the steps in the `Building and programming an application`_ documentation. +.. _registering_sidewalk: + +Registering Sidewalk Endpoint +***************************** + +You can complete Sidewalk registration in one of the two ways: + + * Through an automatic touchless mode that uses Sidewalk Frustration-Free Networking (FFN) where no user interaction is required. + + .. note:: + There are advantages of using automatic FFN registration: + + * There is no association between a user and the Sidewalk Endpoint. + The Endpoint is allowed to connect to network without being associated to any user. + * No Login with Amazon (LWA) is needed. + + * Through a manual process by using a local machine to run a registration script and to connect to the Endpoint over Bluetooth LE. + +For the exact instructions on both of these methods, refer to the `Registering and testing your Sidewalk endpoint`_ documentation. + +.. _Registering and testing your Sidewalk endpoint: https://docs.sidewalk.amazon/provisioning/iot-sidewalk-register-endpoint.html + .. _sidewalk_template_testing: +Testing +******* + +Testing application scenarios are different dependent of the Sidewalk configuration was chosen. + .. toctree:: :maxdepth: 1 :glob: - :caption: Testing: - sidewalk_application_samples/sensor_monitoring.rst - sidewalk_application_samples/template.rst + template_testing/hello_sidewalk.rst + template_testing/sensor_monitoring.rst .. include:: ../ncs_links.rst diff --git a/doc/testing_samples/sidewalk_application_samples/testing_sample_include.txt b/doc/samples/template_testing/hello_sidewalk.rst similarity index 70% rename from doc/testing_samples/sidewalk_application_samples/testing_sample_include.txt rename to doc/samples/template_testing/hello_sidewalk.rst index 47839a38bc..899e781999 100644 --- a/doc/testing_samples/sidewalk_application_samples/testing_sample_include.txt +++ b/doc/samples/template_testing/hello_sidewalk.rst @@ -1,202 +1,253 @@ -Starting Sidewalk ------------------ - -To start Sidewalk, do the following: - -#. Connect your Nordic device to the PC through USB. - Set the power switch on the device to **ON**. - -#. Flash the sample application with the manufacturing data as described in the Building and running section of the respective sample. - - You should see the following logs: - - .. code-block:: console - - *** Booting nRF Connect SDK 883c3709f9c8 *** - ---------------------------------------------------------------- - sidewalk v2.5.0-3-g1232aabb - nrf v2.5.0-g271e80422 - zephyr 883c3709f9 - ---------------------------------------------------------------- - sidewalk_fork_point = af5d608303eb03465f35e369ef22ad6c02564ac6 - build time = 2023-03-14 15:00:00.000000+00:00 - board = nrf52840dk_nrf52840 - ---------------------------------------------------------------- - [00:00:00.001,373] application_state: working = true - [00:00:00.055,480] sidewalk_app: Sidewalk link switch to BLE - - When Sidewalk sample starts, **LED 4** turns on. - -#. Wait for the device to register, or perform registration manually as described in the :ref:`registering_sidewalk` documentation. - - You should see the following logs: - - .. code-block:: console - - [00:00:31.045,471] sid_thread: Device Is registered, Time Sync Fail, Link status Up - - When Sidewalk registration status changes, **LED 3** turns on. - -#. Wait for the device to complete time sync with the Sidewalk network. - - You should see the following logs: - - .. code-block:: console - - [00:00:35.827,789] sid_thread: status changed: ready - [00:00:35.827,850] sid_thread: Device Is registered, Time Sync Success, Link status Up - - When Sidewalk gets Time Sync, **LED 2** turns on. - -#. Wait for status change. - - a. For a Bluetooth LE device, status change occurs on request. Gateway connects over Bluetooth LE before sending down-link message, and device sends connection request before up-link message. Sidewalk automatically disconnects Bluetooth LE after some inactivity period. - - #. For a LoRa and FSK device, the following messages appear in the log: - - .. code-block:: console - - [00:45:31.597,564] sid_thread: status changed: init - [00:45:31.597,564] sid_thread: on_sidewalk_status_changed: Device Is registered, Time Sync Success, Link status Up - - When Sidewalk Link Status is Up, **LED 1** turns on. - -Sending message to AWS MQTT ---------------------------- - -You can use `AWS IoT MQTT client`_ to view the received and republished messages from the device. -Follow the outlined steps: - -#. Enter ``#`` and click :guilabel:`Subscribe to topic`. - You are now subscribed to the republished device messages. - -#. To see the data republished into the subscribed MQTT topic, press **Button 1** on your development kit. - - .. code-block:: console - - # Logs from DK after pressing "Button 1" - [00:04:57.461,029] sid_template: Pressed button 1 - [00:04:57.461,120] sid_thread: sending counter update: 0 - [00:04:57.461,456] sid_thread: queued data message id:3 - - - # Logs from MQTT test client - { - "MessageId": "4c5dadb3-2762-40fa-9763-8a432c023eb5", - "WirelessDeviceId": "5153dd3a-c78f-4e9e-9d8c-3d84fabb8911", - "PayloadData": "MDA=", - "WirelessMetadata": { - "Sidewalk": { - "CmdExStatus": "COMMAND_EXEC_STATUS_UNSPECIFIED", - "MessageType": "CUSTOM_COMMAND_ID_NOTIFY", - "NackExStatus": [], - "Seq": 2, - "SidewalkId": "BFFFFFFFFF" - } - } - - Payload data is presented in base64 format. - You can decode it using Python: - - .. code-block:: console - - python -c "import sys,base64;print(base64.b64decode(sys.argv[1].encode('utf-8')).decode('utf-8'))" MDA= - 00 - - Data is republished into the subscribed MQTT topic. - - .. figure:: /images/Step7-MQTT-Subscribe.png - -Receiving message from AWS MQTT -------------------------------- - -#. To be able to use AWS CLI, ensure you completed steps in the `Installing or updating the latest version of the AWS CLI`_ documentation. - -#. Run the following command to send a message to your Sidewalk Endpoint: - - .. code-block:: console - - aws iotwireless send-data-to-wireless-device --id= --transmit-mode 0 --payload-data="" --wireless-metadata "Sidewalk={Seq=}" - - - * ```` is the Wireless Device ID of your Sidewalk Device. - - You can find it in the :file:`WirelessDevice.json` file, generated with the :file:`Nordic_MFG.hex` file during :ref:`setting_up_sidewalk_product`. - - You can also find your Wireless Device ID in the message sent form the device to AWS, it you have sent it before. - - * ```` is base64 encoded. - - To prepare a message payload in the base64 format, run: - - .. code-block:: console - - python -c "import sys,base64;print(base64.b64encode(sys.argv[1].encode('utf-8')).decode('utf-8'))" "Hello Sidewalk!" - SGVsbG8gICBTaWRld2FsayE= - - * ```` is an integer and should be different for each subsequent request. - - .. note:: - Ensure to increase 'Seq' number on every message. - The device will not receive a message with lower or equal sequence number. - - Once you have populated the command with data, it should look similar to the following: - - .. code-block:: console - - aws iotwireless send-data-to-wireless-device --id=5153dd3a-c78f-4e9e-9d8c-3d84fabb8911 --transmit-mode 0 --payload-data="SGVsbG8gICBTaWRld2FsayE=" --wireless-metadata "Sidewalk={Seq=1}" - - Successfully sent response should look as follows: - - .. code-block:: console - - { - "MessageId": "eabea2c7-a818-4680-8421-7a5fa322460e" - } - - In case you run into the following error, ensure your IAM user or role has permissions to send data to your wireless device: - - .. code-block:: console - - { - "Message": "User: arn:aws:iam::[AWS Account ID]:user/console_user is not authorized to perform: - iotwireless:SendDataToWirelessDevice on resource: arn:aws:iotwireless:us-east-1:[AWS Account ID]: - WirelessDevice/[Wireless Device ID]" - } - - Data will be received in Sidewalk logs: - - .. code-block:: console - - [00:06:56.338,134] sid_thread: Message data: - 48 65 6c 6c 6f 20 20 20 53 69 64 65 77 61 6c 6b |Hello Sidewalk - 21 |! - -Testing Device Firmware Update (DFU) ------------------------------------- - -#. To enter the DFU mode, long press **Button 1** on your development kit. - This action sets the device in the DFU mode, in which only the `Zephyr SMP Server`_ is running and Sidewalk is not operational. - When the application is in the DFU mode, all LEDs flash every 500 ms to signal that the application is waiting for a new image. - -#. To perform a firmware update, follow the Bluetooth testing steps from the `DevZone DFU guide`_. - When the update starts, the LEDs change the pattern to indicate upload in progress. - -#. To exit the DFU mode, long press **Button 1** again when device is in DFU mode. - The device will set the device in the Sidewalk mode. - If the update completes successfully, the device will start a new image. - After using the DFU mode, the first bootup might take up to 60 seconds. - During the image swap the application is silent, meaning that LEDs are not blinking and the console does not output any logs. - The application, however, is running, so do not reset the device. - In case the update fails, the old image is started instead. - -.. include:: ../../ncs_links.rst - -.. _AWS IoT MQTT client: https://docs.aws.amazon.com/iot/latest/developerguide/view-mqtt-messages.html -.. _Installing or updating the latest version of the AWS CLI: https://docs.aws.amazon.com/cli/latest/userguide/getting-started-install.html -.. _ID users change permissions: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_users_change-permissions.html -.. _DevZone DFU guide: https://devzone.nordicsemi.com/guides/nrf-connect-sdk-guides/b/software/posts/ncs-dfu#ble_testing -.. _Sidewalk Protocol Specification: https://docs.sidewalk.amazon/specifications/ -.. _Sidewalk_Handler CloudWatch log group: https://console.aws.amazon.com/cloudwatch/home?region=us-east-1#logsV2:log-groups/log-group/$252Faws$252Flambda$252FSidewalk_Handler -.. _AWS IoT MQTT client: https://docs.aws.amazon.com/iot/latest/developerguide/view-mqtt-messages.html -.. _CloudShell: https://console.aws.amazon.com/cloudshell +.. _sidewalk_hello: + +Hello Sidewalk +############## + +This sample demonstrates a simple Sidewalk End Node application. +It can send Hello message to Sidewalk cloud on button press, as well as represent the Sidewalk status by LED state. +It supports Bluetooth LE, LoRa, and FSK link modes. +External QSPI Flash is used for firmware updates. + +Overview +******** + +The Sidewalk status is indicated by LEDs state and is also printed in the device logs. +It supports actions, such as sending messages, performing factory reset, and entering the DFU state. + + +.. _sidewalk_hello_user_interface: + +User Interface +************** + +Button 1 (short press): + Send Hello - This action queues a message to the cloud. + If Sidewalk is not ready, it displays an error without sending the message. + On Bluetooth LE, the application performs Connection Requests before sending. + +Button 2 (short press): + Set Connection Request - The device requests the Sidewalk Gateway to initiate a connection while the device advertises through Bluetooth LE. + Gateways may not process this request, as it depends on the number of devices connected to it. + +Button 3 (short press): + Toggles the Sidewalk link mask - This action switches from Bluetooth LE to FSK, from FSK to LoRa, and from LoRa to Bluetooth LE. + A log message informs about the link mask switch and the status of the operation. + +LED 1: + Application established a link and connected successfully. + It is ready to send and receive Sidewalk messages. + +LED 2: + Application time synced successfully. + +LED 3: + Application registered successfully. + +LED 4: + Application woke up successfully. + +For common sidewalk template user interface description see ::ref:`sidewalk_template_user_interface` + +Configuration +************* + +The hello Sidewalk application supports the following configurations: + +* ``CONFIG_TEMPLATE_APP_ECHO_MSGS`` -- The sample echoes received Sidewalk messages of type GET and SET to the Sidewalk cloud. + +.. _sidewalk_template_source_files: + +Testing +======= + +See `Testing and debugging an application`_ for information on testing and debugging in the nRF Connect SDK. + +After successfully building the sample and flashing manufacturing data, the sample is ready to use. +To refresh the logs, restart the program by pressing the :guilabel:`RESET` button on your development kit. + +Wait for the device to complete the automatic registration. + +.. note:: + If you have multiple Echo devices registered under a single Amazon account, only one of those devices will be able to operate as an FSK gateway even if other devices have the same capability. + If you need to operate multiple FSK gateways, we recommend setting them up under separate Amazon accounts. + +Starting Sidewalk +----------------- + +To start Sidewalk, do the following: + +#. Connect your Nordic device to the PC through USB. + Set the power switch on the device to **ON**. + +#. Flash the sample application with the manufacturing data as described in the Building and running section of the respective sample. + + You should see the following logs: + + .. code-block:: console + + *** Booting nRF Connect SDK 883c3709f9c8 *** + ---------------------------------------------------------------- + sidewalk v2.5.0-3-g1232aabb + nrf v2.5.0-g271e80422 + zephyr 883c3709f9 + ---------------------------------------------------------------- + sidewalk_fork_point = af5d608303eb03465f35e369ef22ad6c02564ac6 + build time = 2023-03-14 15:00:00.000000+00:00 + board = nrf52840dk_nrf52840 + ---------------------------------------------------------------- + [00:00:00.001,373] application_state: working = true + [00:00:00.055,480] sidewalk_app: Sidewalk link switch to BLE + + When Sidewalk sample starts, **LED 4** turns on. + +#. Wait for the device to register, or perform registration manually as described in the :ref:`registering_sidewalk` documentation. + + You should see the following logs: + + .. code-block:: console + + [00:00:31.045,471] sid_thread: Device Is registered, Time Sync Fail, Link status Up + + When Sidewalk registration status changes, **LED 3** turns on. + +#. Wait for the device to complete time sync with the Sidewalk network. + + You should see the following logs: + + .. code-block:: console + + [00:00:35.827,789] sid_thread: status changed: ready + [00:00:35.827,850] sid_thread: Device Is registered, Time Sync Success, Link status Up + + When Sidewalk gets Time Sync, **LED 2** turns on. + +#. Wait for status change. + + a. For a Bluetooth LE device, status change occurs on request. Gateway connects over Bluetooth LE before sending down-link message, and device sends connection request before up-link message. Sidewalk automatically disconnects Bluetooth LE after some inactivity period. + + #. For a LoRa and FSK device, the following messages appear in the log: + + .. code-block:: console + + [00:45:31.597,564] sid_thread: status changed: init + [00:45:31.597,564] sid_thread: on_sidewalk_status_changed: Device Is registered, Time Sync Success, Link status Up + + When Sidewalk Link Status is Up, **LED 1** turns on. + +Sending message to AWS MQTT +--------------------------- + +You can use `AWS IoT MQTT client`_ to view the received and republished messages from the device. +Follow the outlined steps: + +#. Enter ``#`` and click :guilabel:`Subscribe to topic`. + You are now subscribed to the republished device messages. + +#. To see the data republished into the subscribed MQTT topic, press **Button 1** on your development kit. + + .. code-block:: console + + # Logs from DK after pressing "Button 1" + [00:04:57.461,029] sid_template: Pressed button 1 + [00:04:57.461,120] sid_thread: sending counter update: 0 + [00:04:57.461,456] sid_thread: queued data message id:3 + + + # Logs from MQTT test client + { + "MessageId": "4c5dadb3-2762-40fa-9763-8a432c023eb5", + "WirelessDeviceId": "5153dd3a-c78f-4e9e-9d8c-3d84fabb8911", + "PayloadData": "MDA=", + "WirelessMetadata": { + "Sidewalk": { + "CmdExStatus": "COMMAND_EXEC_STATUS_UNSPECIFIED", + "MessageType": "CUSTOM_COMMAND_ID_NOTIFY", + "NackExStatus": [], + "Seq": 2, + "SidewalkId": "BFFFFFFFFF" + } + } + + Payload data is presented in base64 format. + You can decode it using Python: + + .. code-block:: console + + python -c "import sys,base64;print(base64.b64decode(sys.argv[1].encode('utf-8')).decode('utf-8'))" MDA= + 00 + + Data is republished into the subscribed MQTT topic. + + .. figure:: /images/Step7-MQTT-Subscribe.png + +Receiving message from AWS MQTT +------------------------------- + +#. To be able to use AWS CLI, ensure you completed steps in the `Installing or updating the latest version of the AWS CLI`_ documentation. + +#. Run the following command to send a message to your Sidewalk Endpoint: + + .. code-block:: console + + aws iotwireless send-data-to-wireless-device --id= --transmit-mode 0 --payload-data="" --wireless-metadata "Sidewalk={Seq=}" + + + * ```` is the Wireless Device ID of your Sidewalk Device. + + You can find it in the :file:`WirelessDevice.json` file, generated with the :file:`Nordic_MFG.hex` file during :ref:`setting_up_sidewalk_product`. + + You can also find your Wireless Device ID in the message sent form the device to AWS, it you have sent it before. + + * ```` is base64 encoded. + + To prepare a message payload in the base64 format, run: + + .. code-block:: console + + python -c "import sys,base64;print(base64.b64encode(sys.argv[1].encode('utf-8')).decode('utf-8'))" "Hello Sidewalk!" + SGVsbG8gICBTaWRld2FsayE= + + * ```` is an integer and should be different for each subsequent request. + + .. note:: + Ensure to increase 'Seq' number on every message. + The device will not receive a message with lower or equal sequence number. + + Once you have populated the command with data, it should look similar to the following: + + .. code-block:: console + + aws iotwireless send-data-to-wireless-device --id=5153dd3a-c78f-4e9e-9d8c-3d84fabb8911 --transmit-mode 0 --payload-data="SGVsbG8gICBTaWRld2FsayE=" --wireless-metadata "Sidewalk={Seq=1}" + + Successfully sent response should look as follows: + + .. code-block:: console + + { + "MessageId": "eabea2c7-a818-4680-8421-7a5fa322460e" + } + + In case you run into the following error, ensure your IAM user or role has permissions to send data to your wireless device: + + .. code-block:: console + + { + "Message": "User: arn:aws:iam::[AWS Account ID]:user/console_user is not authorized to perform: + iotwireless:SendDataToWirelessDevice on resource: arn:aws:iotwireless:us-east-1:[AWS Account ID]: + WirelessDevice/[Wireless Device ID]" + } + + Data will be received in Sidewalk logs: + + .. code-block:: console + + [00:06:56.338,134] sid_thread: Message data: + 48 65 6c 6c 6f 20 20 20 53 69 64 65 77 61 6c 6b |Hello Sidewalk + 21 |! + + +.. include:: testing_nordic_dfu_include.txt + +.. include:: ../ncs_links.rst + +.. _SX1262: https://os.mbed.com/components/SX126xMB2xAS/ diff --git a/doc/testing_samples/sidewalk_application_samples/sensor_monitoring.rst b/doc/samples/template_testing/sensor_monitoring.rst similarity index 76% rename from doc/testing_samples/sidewalk_application_samples/sensor_monitoring.rst rename to doc/samples/template_testing/sensor_monitoring.rst index 89220e9fcd..813d732576 100644 --- a/doc/testing_samples/sidewalk_application_samples/sensor_monitoring.rst +++ b/doc/samples/template_testing/sensor_monitoring.rst @@ -17,8 +17,22 @@ Button 1-4 (short press): LED 1-4: Notify LED action message. This action works after application successfully sends capability message. +For common sidewalk template user interface description see ::ref:`sidewalk_template_user_interface` + +Configuration +************* + +.. note:: + To build Sidewalk template as sensor monitoring application + the ``CONFIG_TEMPLATE_APP_SENSOR_MONITORING`` must be enabled in sample configuration. + +The Sidewalk sensor monitoring demo application supports the following configurations: + +* ``CONFIG_TEMPLATE_APP_NOTIFY_DATA_PERIOD_MS`` -- Notify period of sensor monitoring template app in milliseconds. + + Testing -======= +******* See `Testing and debugging an application`_ for information on testing and debugging in the nRF Connect SDK. @@ -40,11 +54,13 @@ You should see the following output: [00:00:00.006,225] sid_template: Sidewalk example started! -Wait for the device to complete the :ref:`automatic_registration_sidewalk_endpoints`. +Wait for the device to complete the automatic registration. .. note:: For the full installation guidelines and the application overview, refer to the `Amazon Sidewalk Sample IoT App`_ repository. +.. include:: testing_nordic_dfu_include.txt + .. include:: ../../ncs_links.rst .. _SX1262: https://os.mbed.com/components/SX126xMB2xAS/ diff --git a/doc/samples/template_testing/testing_nordic_dfu_include.txt b/doc/samples/template_testing/testing_nordic_dfu_include.txt new file mode 100644 index 0000000000..f437db0e4d --- /dev/null +++ b/doc/samples/template_testing/testing_nordic_dfu_include.txt @@ -0,0 +1,28 @@ +Testing Device Firmware Update (DFU) +------------------------------------ + +#. To enter the DFU mode, long press **Button 1** on your development kit. + This action sets the device in the DFU mode, in which only the `Zephyr SMP Server`_ is running and Sidewalk is not operational. + When the application is in the DFU mode, all LEDs flash every 500 ms to signal that the application is waiting for a new image. + +#. To perform a firmware update, follow the Bluetooth testing steps from the `DevZone DFU guide`_. + When the update starts, the LEDs change the pattern to indicate upload in progress. + +#. To exit the DFU mode, long press **Button 1** again when device is in DFU mode. + The device will set the device in the Sidewalk mode. + If the update completes successfully, the device will start a new image. + After using the DFU mode, the first bootup might take up to 60 seconds. + During the image swap the application is silent, meaning that LEDs are not blinking and the console does not output any logs. + The application, however, is running, so do not reset the device. + In case the update fails, the old image is started instead. + +.. include:: ../../ncs_links.rst + +.. _AWS IoT MQTT client: https://docs.aws.amazon.com/iot/latest/developerguide/view-mqtt-messages.html +.. _Installing or updating the latest version of the AWS CLI: https://docs.aws.amazon.com/cli/latest/userguide/getting-started-install.html +.. _ID users change permissions: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_users_change-permissions.html +.. _DevZone DFU guide: https://devzone.nordicsemi.com/guides/nrf-connect-sdk-guides/b/software/posts/ncs-dfu#ble_testing +.. _Sidewalk Protocol Specification: https://docs.sidewalk.amazon/specifications/ +.. _Sidewalk_Handler CloudWatch log group: https://console.aws.amazon.com/cloudwatch/home?region=us-east-1#logsV2:log-groups/log-group/$252Faws$252Flambda$252FSidewalk_Handler +.. _AWS IoT MQTT client: https://docs.aws.amazon.com/iot/latest/developerguide/view-mqtt-messages.html +.. _CloudShell: https://console.aws.amazon.com/cloudshell diff --git a/doc/samples/why_new_template.rst b/doc/samples/why_new_template.rst new file mode 100644 index 0000000000..22b3ed9179 --- /dev/null +++ b/doc/samples/why_new_template.rst @@ -0,0 +1,297 @@ +.. _why_new_sidewalk_template: + +Why samples changes? +******************** + +The old approach to Amazon Sidewalk samples in nRF Connect SDK was to present four different samples: template sub-GHz, template BLE, sensor monitor and dut. The new approach is to present the same functionalities in the one, unified, configurable template sample. + +.. figure:: ../images/unify_sample_old.png + :scale: 100 % + :alt: old samples diagram + + Old samples approach. Separate sample for every configuration. + +.. figure:: ../images/unify_sample_new.png + :scale: 100 % + :alt: old samples diagram + + New template sample. Common, configurable code base. + +After samples unification is will be easier to adopt new features from Amazon Sidewalk and nRF Connect SDK, maintain samples codebase and understand Sidewalk application for new developers. + +.. put diagram here + +How to align changes? +********************* + +In general you can still use applications based on old samples. +We encourage you to align your application to new sample as it is more futureproof. + +Besides sample unification some other changes were made in sdk-sidewalk codebase recently, which my affect your code. To use deprecated functionalities you have to enable suitable config options: + +* ``CONFIG_DEPRECATED_SIDEWALK_PAL_INIT`` -- Enable to initialize platform components from :file:`pal_init.c`. The initialization was moved to :file:`sid_common.c` and is called during ``sid_init()``. +* ``DEPRECATED_SIDEWALK_BLE_MAC_ADDR_TYPE`` -- Enable to switch Bluetooth LE Mac address type for Sidewalk application. These configs was redundant to nRF Connect SDK Bluetooth configurations. +* ``DEPRECATED_DFU_FLAG_SETTINGS_KEY`` -- Enable to save dfu mode after reset. The new template uses :ref:`why_new_sidewalk_template_dfu_mode`. +* ``CONFIG_SIDEWALK_LINK_MASK`` -- Choose sidewalk link mask to start with. The new Sidewalk libraries supports link switch in runtime. To switch between full link mask support libraries and Bluetooth LE only libraries use ``CONFIG_SIDEWALK_SUBGHZ_SUPPORT``. + +What was changed? +***************** + +To make alignment with new template easier, some aspects of work with samples was presented below. Please note, that this is not 1:1 instructions, but rather a generic guide to understand changes. + +Building +-------- + +All below commands assumes you are in :file:`{NCS_PATH}/sidewalk/samples` and build for nRF52840 Development Kit board. + ++---------------------------+---------------------------------------------------------+----------------------------------------------------------------------------------------------+ +| Description | Old | New | ++===========================+=========================================================+==============================================================================================+ +| Template sub-GHz | ``west build -b nrf52840dk_nrf52840 template_subghz`` | ``west build -b nrf52840dk_nrf52840 template`` | ++---------------------------+---------------------------------------------------------+----------------------------------------------------------------------------------------------+ +| Template Bluetooth LE only| ``west build -b nrf52840dk_nrf52840 template_ble`` | ``west build -b nrf52840dk_nrf52840 template -- -DCONFIG_SIDEWALK_SUBGHZ_SUPPORT=y`` | ++---------------------------+---------------------------------------------------------+----------------------------------------------------------------------------------------------+ +| Sensor monitoring demo | ``west build -b nrf52840dk_nrf52840 sensor_monitoring`` | ``west build -b nrf52840dk_nrf52840 template -- -DCONFIG_TEMPLATE_APP_SENSOR_MONITORING=y`` | ++---------------------------+---------------------------------------------------------+----------------------------------------------------------------------------------------------+ +| Device under test (CLI) |``west build -b nrf52840dk_nrf52840 sid_dut`` | ``west build -b nrf52840dk_nrf52840 template -- -DOVERLAY_CONFIG="overlay-dut.conf"`` | ++---------------------------+---------------------------------------------------------+----------------------------------------------------------------------------------------------+ + +Source files +------------ + +Sample file structure was refactored, to make sample unification possible. +The table below presents where most of components was moved form old template to new template. + ++--------------------------------+--------------------------+----------------+ +| Description | Old | New | ++================================+==========================+================+ +| Sidewalk thread implementation | ``application_thread.c`` | ``sidewalk.c`` | ++--------------------------------+--------------------------+----------------+ +| Sidewalk thread events | ``application_thread.h`` | ``sidewalk.h`` | ++--------------------------------+--------------------------+----------------+ +| Sidewalk callbacks | ``sidewalk_callbacks.c`` | ``app.c`` | ++--------------------------------+--------------------------+----------------+ +| Board support | ``board_events.c`` | ``app.c`` | ++--------------------------------+--------------------------+----------------+ +| Application logic | ``main.c`` | ``app.c`` | ++--------------------------------+--------------------------+----------------+ + +Events +------ + +In nRF Connect SDK all Sidewalk API calls should be made form the same thread where ``sid_process()`` is called. +In both old and new samples communication with Sidewalk thread was handled by user defined events. To cover all scenarios in the unified template sample, the events has changed: there are more events, the event was renamed, and it may provide Sidewalk thread a specific context. + +**Events naming** changes was presented in table below: + ++--------------------------------+-------------------------------------+-----------------------------+ +| Description | Old | New | ++================================+=====================================+=============================+ +| Sidewalk process event | ``SIDEWALK_EVENT`` | ``SID_EVENT_SIDEWALK`` | ++--------------------------------+-------------------------------------+-----------------------------+ +| Send message | ``BUTTON_EVENT_SEND_HELLO`` | ``SID_EVENT_SEND_MSG`` | ++--------------------------------+-------------------------------------+-----------------------------+ +| Set connection request | ``BUTTON_EVENT_CONNECTION_REQUEST`` | ``SID_EVENT_CONNECT`` | ++--------------------------------+-------------------------------------+-----------------------------+ +| Factory reset | ``BUTTON_EVENT_FACTORY_RESET`` | ``SID_EVENT_FACTORY_RESET`` | ++--------------------------------+-------------------------------------+-----------------------------+ +| Enter DFU mode | ``BUTTON_EVENT_NORDIC_DFU.c`` | ``SID_EVENT_NORDIC_DFU`` | ++--------------------------------+-------------------------------------+-----------------------------+ +| Set battery option, | ``BUTTON_EVENT_SET_BATTERY_LEVEL`` | ``DUT_EVENT_SET_OPTION`` | +| Set device profile option | ``BUTTON_EVENT_SET_DEVICE_PROFILE`` | | ++--------------------------------+-------------------------------------+-----------------------------+ +| Get device profile option | ``BUTTON_EVENT_GET_DEVICE_PROFILE`` | ``DUT_EVENT_GET_OPTION`` | ++--------------------------------+-------------------------------------+-----------------------------+ +| New events | N/A | ``SID_EVENT_LINK_SWITCH`` | +| | | ``SID_EVENT_NEW_STATUS`` | +| | | ``DUT_EVENT_INIT`` | +| | | ``DUT_EVENT_DEINIT`` | +| | | ``DUT_EVENT_START`` | +| | | ``DUT_EVENT_STOP`` | +| | | ``DUT_EVENT_GET_MTU`` | +| | | ``DUT_EVENT_GET_TIME`` | +| | | ``DUT_EVENT_GET_STATUS`` | +| | | ``DUT_EVENT_SET_DEST_ID`` | ++--------------------------------+-------------------------------------+-----------------------------+ + +**Sending event** procedure, on example of sending hello message to cloud. Some part of the code was removed to make it easier to read. + +Old template: + +.. code:: c + + // main.c + app_event_send(BUTTON_EVENT_SEND_HELLO); + + // application_thread.c + switch (event) { + case BUTTON_EVENT_SEND_HELLO: + button_event_send_hello(application_ctx); + break; + } + + // board_events.c + void button_event_send_hello(app_ctx_t *application_ctx) + { + const char payload[] = "hello"; + struct sid_msg msg; + msg.data = &payload; + msg.size = sizeof(payload); + struct sid_msg_desc desc; + desc.type = SID_MSG_TYPE_NOTIFY; + desc.link_type = SID_LINK_TYPE_ANY; + desc.link_mode = SID_LINK_MODE_CLOUD; + + sid_put_msg(application_ctx->handle, &msg, &desc); + } + +New template: + +.. code:: c + + // app.c + const char payload[] = "hello"; + sidewalk_msg_t *hello = sidewalk_data_alloc(sizeof(sidewalk_msg_t)); + hello->msg.size = sizeof(payload); + hello->msg.data = sidewalk_data_alloc(hello->msg.size); + memcpy(hello->msg.data, payload, hello->msg.size); + hello->desc.type = SID_MSG_TYPE_NOTIFY; + hello->desc.link_type = SID_LINK_TYPE_ANY; + hello->desc.link_mode = SID_LINK_MODE_CLOUD; + + sidewalk_event_send(SID_EVENT_SEND_MSG, hello); + + // sidewalk.c + switch (sm->event.id) { + case SID_EVENT_SEND_MSG: + sidewalk_msg_t *p_msg = (sidewalk_msg_t *)sm->event.ctx; + sid_put_msg(sm->sid->handle, &p_msg->msg, &p_msg->desc); + sidewalk_data_free(p_msg->msg.data); + sidewalk_data_free(p_msg); + break; + } + +**Handling event** procedure, on example of handling Sidewalk process event. Some part of the code was removed to make it easier to read. + +Old template: + +.. code:: c + + // context + typedef struct application_context { + struct sid_event_callbacks event_callbacks; + struct sid_config config; + struct sid_handle *handle; + } app_ctx_t; + + + static void sidewalk_app_entry(void *ctx, void *unused, void *unused2) + { + // init + sid_init(&application_ctx->config, &application_ctx->handle); + sid_start(application_ctx->handle, BUILT_IN_LM); + + // process + while (true) { + app_event_t event = SIDEWALK_EVENT; + + if (!k_msgq_get(&application_thread_msgq, &event, K_FOREVER)) { + switch (event) { + case SIDEWALK_EVENT: + sid_process(application_ctx->handle); + } + } + } + } + + // thread start + sid_error_t app_thread_init(app_ctx_t *context) + { + k_thread_create(sidewalk_app_entry, context); + + } + + // event send + void app_event_send(app_event_t event) + { + k_msgq_put(&application_thread_msgq, (void *)&event, K_NO_WAIT); + } + + + +New template: + +.. code:: c + + // context + typedef struct { + struct sid_handle *handle; + struct sid_config config; + struct sid_status last_status; + } sidewalk_ctx_t; + + typedef struct { + struct smf_ctx ctx; + struct k_msgq msgq; + sidewalk_ctx_event_t event; + sidewalk_ctx_t *sid; + } sm_t; + + // init + static void state_sidewalk_entry(void *o) + { + sm_t *sm = (sm_t *)o; + sid_init(&sm->sid->config, &sm->sid->handle); + sid_start(sm->sid->handle, sm->sid->config.link_mask); + } + + // process + static void state_sidewalk_run(void *o) + { + sm_t *sm = (sm_t *)o; + + switch (sm->event.id) { + case SID_EVENT_SIDEWALK: + sid_process(sm->sid->handle); + break; + } + } + + static void sid_thread_entry(void *context, void *unused, void *unused2) + { + while (true) { + k_msgq_get(&sid_sm.msgq, &sid_sm.event, K_FOREVER); + smf_run_state(SMF_CTX(&sid_sm)) + } + } + + // thread start + void sidewalk_start(sidewalk_ctx_t *context) + { + (void)k_thread_create(sid_thread_entry, context); + } + + + // event send + int sidewalk_event_send(sidewalk_event_t event, void *ctx) + { + sidewalk_ctx_event_t ctx_event = { + .id = event, + .ctx = ctx, + }; + + return k_msgq_put(&sid_sm.msgq, (void *)&ctx_event, K_NO_WAIT); + } + +.. _why_new_sidewalk_template_dfu_mode: + +Sidewalk and custom Bluetooth Service +------------------------------------- + +The new template samples uses `Zephyr State Machine Framework`_. +In :file:`sidewalk.c` the state machine is used to demonstrate how application can switch between Sidewalk and `Zephyr SMP Server`_ application. +You can use this as a reference design for switching between Sidewalk mode and another Bluetooth LE service based application. + +.. _Zephyr State Machine Framework: https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/zephyr/services/smf/index.html#state-machine-framework + +.. _Zephyr SMP Server: https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/zephyr/samples/subsys/mgmt/mcumgr/smp_svr/README.html#smp-svr diff --git a/doc/testing_samples/samples.rst b/doc/testing_samples/samples.rst deleted file mode 100644 index 44742ecade..0000000000 --- a/doc/testing_samples/samples.rst +++ /dev/null @@ -1,14 +0,0 @@ -.. _samples: - -Samples -####### - -The samples included in this SDK showcase various Sidewalk use cases on Nordic Semiconductor devices. - -.. toctree:: - :maxdepth: 1 - :glob: - :caption: Subpages: - - samples_list.rst - sidewalk_registration.rst diff --git a/doc/testing_samples/sidewalk_application_samples/template.rst b/doc/testing_samples/sidewalk_application_samples/template.rst deleted file mode 100644 index e44fbaede1..0000000000 --- a/doc/testing_samples/sidewalk_application_samples/template.rst +++ /dev/null @@ -1,92 +0,0 @@ -.. _sidewalk_template: - -Sidewalk Template -################# - -This sample demonstrates a template for the Sidewalk End Node application. -It supports Bluetooth LE, LoRa, and FSK link modes. -External QSPI Flash is used for firmware updates. - -Overview -******** - -The Sidewalk status is indicated by LEDs state and is also printed in the device logs. -It supports actions, such as sending messages, performing factory reset, and entering the DFU state. -The sample echoes received Sidewalk messages of type GET and SET to the Sidewalk cloud. - -User Interface -************** - -Button 1 (short press): - Send Hello - This action queues a message to the cloud. - If Sidewalk is not ready, it displays an error without sending the message. - On Bluetooth LE, the application performs Connection Requests before sending. - -Button 2 (short press): - Set Connection Request - The device requests the Sidewalk Gateway to initiate a connection while the device advertises through Bluetooth LE. - Gateways may not process this request, as it depends on the number of devices connected to it. - -Button 3 (short press): - Toggles the Sidewalk link mask - This action switches from Bluetooth LE to FSK, from FSK to LoRa, and from LoRa to Bluetooth LE. - A log message informs about the link mask switch and the status of the operation. - -LED 1: - Application established a link and connected successfully. - It is ready to send and receive Sidewalk messages. - -LED 2: - Application time synced successfully. - -LED 3: - Application registered successfully. - -LED 4: - Application woke up successfully. - -Configuration -************* - -When running the sample, you can use different configuration files depending on the supported features. - -.. _sidewalk_template_source_files: - -Source file setup -================= - -The application consists of two source files: - -* :file:`app.c` -- The main application file. - It implements Sidewalk callbacks, assigns button actions, and initializes components. -* :file:`sidewalk.c` -- Sidewalk thread file. - It implements a separate thread where the Sidewalk API is called to start, stop, process, switch link modes, and send messages. - The file also includes the support for the DFU state. - See the behavior of the state machine outlined in the following diagram: - -.. uml:: - :caption: Sidewalk thread state machine - - [*] --> Sidewalk - state Common{ - Sidewalk --> [*] : event_factory_reset - Sidewalk --> FirmwareUpdate : event_dfu - FirmwareUpdate --> Common : event_dfu - -.. _sidewalk_template_hello_testing: - -Testing -======= - -See `Testing and debugging an application`_ for information on testing and debugging in the nRF Connect SDK. - -After successfully building the sample and flashing manufacturing data, the sample is ready to use. -To refresh the logs, restart the program by pressing the :guilabel:`RESET` button on your development kit. - -Wait for the device to complete the :ref:`automatic_registration_sidewalk_endpoints`. - -.. note:: - If you have multiple Echo devices registered under a single Amazon account, only one of those devices will be able to operate as an FSK gateway even if other devices have the same capability. - If you need to operate multiple FSK gateways, we recommend setting them up under separate Amazon accounts. - -.. include:: testing_sample_include.txt - -.. _SX1262: https://os.mbed.com/components/SX126xMB2xAS/ diff --git a/doc/testing_samples/sidewalk_registration.rst b/doc/testing_samples/sidewalk_registration.rst deleted file mode 100644 index fb81d867ee..0000000000 --- a/doc/testing_samples/sidewalk_registration.rst +++ /dev/null @@ -1,21 +0,0 @@ -.. _registering_sidewalk: - -Registering Sidewalk Endpoint -############################# - -You can complete Sidewalk registration in one of the two ways: - - * Through an automatic touchless mode that uses Sidewalk Frustration-Free Networking (FFN) where no user interaction is required. - - .. note:: - There are advantages of using automatic FFN registration: - - * There is no association between a user and the Sidewalk Endpoint. - The Endpoint is allowed to connect to network without being associated to any user. - * No Login with Amazon (LWA) is needed. - - * Through a manual process by using a local machine to run a registration script and to connect to the Endpoint over Bluetooth LE. - -For the exact instructions on both of these methods, refer to the `Registering and testing your Sidewalk endpoint`_ documentation. - -.. _Registering and testing your Sidewalk endpoint: https://docs.sidewalk.amazon/provisioning/iot-sidewalk-register-endpoint.html