Skip to content

Commit 4240360

Browse files
committed
doc: add Sidewalk location service information
[KRKNWK-21107] Add Sidewalk location service doc including overview, testing and known issues.
1 parent ff9b3a4 commit 4240360

File tree

13 files changed

+759
-257
lines changed

13 files changed

+759
-257
lines changed

doc/includes/include_building_and_running.txt

Lines changed: 38 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9,26 +9,52 @@ This sample can be found under :file:`samples/sid_end_device`.
99
This step needs to be completed only once.
1010
You do not have to repeat it for every sample rebuild.
1111

12-
To build the sample, follow the steps in the `Building and programming an application`_ documentation.
12+
For general instructions on building the sample, follow the steps in the `Building and programming an application`_ documentation.
1313

14-
To build the sample for sub-GHz (LoRa/FSK) operation, use the ``--shield`` option with ``west build``. This configures the correct device tree overlays and pin mappings for the Semtech SX1262 shield, and enables the correct Sidewalk radio configuration.
14+
You can also build the sample with specific configurations:
1515

16-
.. tabs::
16+
* For Bluetooth LE only operation, use the default build commands.
1717

18-
.. tab:: nrf52840dk/nrf52840
18+
.. parsed-literal::
19+
:class: highlight
1920

20-
.. code-block:: console
21+
west build -b *board_target*
2122

22-
west build -b nrf52840dk/nrf52840 --shield semtech_sx1262mb2cas
23+
* For sub-GHz (LoRa and FSK) operation, use the ``--shield`` option with ``west build``.
24+
This configures the correct device tree overlays and pin mappings for the Semtech radio shield, and enables the correct Sidewalk radio configuration.
2325

24-
.. tab:: nrf5340dk/nrf5340/cpuapp
26+
.. tabs::
2527

26-
.. code-block:: console
28+
.. tab:: nrf52840dk/nrf52840
2729

28-
west build -b nrf5340dk/nrf5340/cpuapp --shield semtech_sx1262mb2cas
30+
.. code-block:: console
2931

30-
.. tab:: nrf54l15dk/nrf54l15/cpuapp
32+
west build -b nrf52840dk/nrf52840 --shield semtech_sx1262mb2cas
3133

32-
.. code-block:: console
34+
.. tab:: nrf5340dk/nrf5340/cpuapp
3335

34-
west build -b nrf54l15dk/nrf54l15/cpuapp --shield nrf54l15dk_arduino_adapter --shield semtech_sx1262mb2cas
36+
.. code-block:: console
37+
38+
west build -b nrf5340dk/nrf5340/cpuapp --shield semtech_sx1262mb2cas
39+
40+
.. tab:: nrf54l15dk/nrf54l15/cpuapp
41+
42+
.. code-block:: console
43+
44+
west build -b nrf54l15dk/nrf54l15/cpuapp --shield nrf54l15dk_arduino_adapter --shield semtech_sx1262mb2cas
45+
46+
* For sub-GHz (LoRa and FSK) operation and location scanning over WiFi and GNSS, use the ``lr1110mb1lcks`` shield.
47+
48+
.. tabs::
49+
50+
.. tab:: nrf52840dk/nrf52840
51+
52+
.. code-block:: console
53+
54+
west build -b nrf52840dk/nrf52840 --shield semtech_lr1110mb1xxs
55+
56+
.. tab:: nrf54l15dk/nrf54l15/cpuapp
57+
58+
.. code-block:: console
59+
60+
west build -b nrf54l15dk/nrf54l15/cpuapp --shield simple_arduino_adapter --shield semtech_lr1110mb1xxs
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
Receiving message from AWS MQTT
2+
-------------------------------
3+
4+
#. To be able to use AWS CLI, you must first complete `Installing or updating the latest version of the AWS CLI`_.
5+
6+
#. Run the following command to send a message to your Sidewalk Endpoint:
7+
8+
.. code-block:: console
9+
10+
aws iotwireless send-data-to-wireless-device --id=<wireless-device-id> --transmit-mode 0 --payload-data="<payload-data>" --wireless-metadata "Sidewalk={Seq=<sequence-number>}"
11+
12+
* ``<wireless-device-id>`` is the Wireless Device ID of your Sidewalk Device.
13+
14+
You can find it in the :file:`WirelessDevice.json` file, generated with the :file:`Nordic_MFG.hex` file during :ref:`setting_up_sidewalk_prototype`.
15+
If you have sent a message before, you can also find your Wireless Device ID in the messages sent from your device to AWS.
16+
17+
* ``<payload-data>`` is base64 encoded.
18+
* ``<sequence-number>`` is an integer and should be different for each subsequent request.
19+
20+
#. Prepare a message payload in the base64 format by running the following command:
21+
22+
.. code-block:: console
23+
24+
python -c "import sys,base64;print(base64.b64encode(sys.argv[1].encode('utf-8')).decode('utf-8'))" "Hello Sidewalk!"
25+
SGVsbG8gU2lkZXdhbGsh
26+
27+
#. Increase a sequence number on every message.
28+
The device will not receive a message with lower or equal sequence number.
29+
30+
Once you have populated the command with data, it should look similar to the following:
31+
32+
.. code-block:: console
33+
34+
aws iotwireless send-data-to-wireless-device --id=5153dd3a-c78f-4e9e-9d8c-3d84fabb8911 --transmit-mode 0 --payload-data="SGVsbG8gU2lkZXdhbGsh" --wireless-metadata "Sidewalk={Seq=1}"
35+
36+
Successfully sent response should look as follows:
37+
38+
.. code-block:: console
39+
40+
{
41+
"MessageId": "eabea2c7-a818-4680-8421-7a5fa322460e"
42+
}
43+
44+
In case you receive the following error, make sure your IAM user or role has permissions to send data to your wireless device:
45+
46+
.. code-block:: console
47+
48+
{
49+
"Message": "User: arn:aws:iam::[AWS Account ID]:user/console_user is not authorized to perform:
50+
iotwireless:SendDataToWirelessDevice on resource: arn:aws:iotwireless:us-east-1:[AWS Account ID]:
51+
WirelessDevice/[Wireless Device ID]"
52+
}
53+
54+
Data will be received in Sidewalk logs:
55+
56+
.. code-block:: console
57+
58+
[00:06:56.338,134] <inf> sid_thread: Message data:
59+
48 65 6c 6c 6f 20 20 20 53 69 64 65 77 61 6c 6b |Hello Sidewalk
60+
21 |!

doc/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ Browse the content by referring to the following pages:
4343

4444
setting_up_sidewalk_environment/setting_up_environment.rst
4545
samples/samples_list.rst
46+
location_services.rst
4647
testing.rst
4748
compatibility_matrix.rst
4849
release_notes_and_migration.rst

doc/known_issues.rst

Lines changed: 44 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -22,42 +22,56 @@ A known issue can list one or both of the following entries:
2222
List of known issues for v1.1.0
2323
*******************************
2424

25-
.. warning::
26-
SDK v1.19 introduces several new issues. Thorough testing is recommended before production use.
27-
28-
**High Priority Issues:**
29-
3025
KRKNWK-20869: Intermittent downlink message reception issues with multilink configurations
3126
When multiple transport types are enabled (multilink), downlink messages from the cloud may not be received by the device.
32-
Sometimes messages arrive via a different transport than expected. Uplink messages work as expected.
27+
Sometimes, messages arrive through a different transport than expected.
28+
Uplink messages work as expected.
3329

34-
35-
**Affected platforms:** nRF52840, nRF54L15 with LR1110 shield
36-
37-
**Note:** The exact set of affected platforms that show this behavior is not constant, and reproduction of this issue is not consistent.
38-
39-
**Impact:** Moderate - affects message reliability in multilink scenarios
30+
**Affected platforms:** nRF52840, nRF54L15 with LR1110 shield (the exact set of affected platforms is not constant, and reproduction is not consistent)
4031

41-
**Lower Priority Issues:**
32+
KRKNWK-20851: Cannot initialize location when LoRa or FSK transport is initialized in Amazon Sidewalk
33+
Device fails to initialize location when using LoRa or FSK transport.
34+
35+
**Affected platforms:** nRF52840, nRF54L15 with LR1110 shield (issue reproduction is inconsistent)
36+
37+
**Workaround:** If the device freezes when location initialization fails, restart the device.
38+
Ensure that location services are initialized only after the Sidewalk stack is ready, and deinitialized before Sidewalk stack is deinitialized.
4239

4340
KRKNWK-20863: Increased boot time due to bootloader configuration
44-
Boot time increased on all platforms due to recent bootloader configuration changes.
45-
The impact is most noticeable on nRF52840 (~3 seconds vs expected <1 second), but all platforms experience
46-
increased boot time.
47-
48-
**Root Cause:** The increased boot time is caused by bootloader configuration changes that affect the
49-
initialization sequence across all platforms.
50-
51-
**Technical Details:**
52-
- **Commit:** `99ed5147cb7543c1f8f9a116da801d3909a92e83` - "use rsa keys for all SoCs"
53-
- **Change:** Sets default config of `BOOT_SIGNATURE_TYPE` to `BOOT_SIGNATURE_TYPE_RSA`
54-
- **Impact:** RSA signature verification is computationally more expensive than the previous default,
55-
causing increased boot time across all platforms
56-
57-
**Note:** This issue is not related to specific radio configurations (LoRa, BLE, etc.) but affects
58-
the general boot process on all platforms.
59-
60-
**Affected platforms:** All platforms (most significant impact on nRF52840)
41+
Boot time has increased on all platforms due to bootloader configuration changes.
42+
It now uses RSA keys for signature verification ((the default config of ``BOOT_SIGNATURE_TYPE`` is changed to ``BOOT_SIGNATURE_TYPE_RSA``), significantly increasing the boot time (commit 99ed5147cb7543c1f8f9a116da801d3909a92e83, "use rsa keys for all SoCs").
43+
The effect is most noticeable on the nRF52840 SoC (around 3 seconds to start up instead of the expected less than 1 second).
44+
This issue is unrelated to specific radio configurations (LoRa, Bluetooth LE) but affects the general boot process.
45+
46+
**Affected platforms:** All platforms
47+
48+
KRKNWK-20856: GNSS scan enters endless loop
49+
The GNSS scan operation may enter an endless loop.
50+
Reproduction of the issue is inconsistent.
51+
It does not occur with the location send command.
52+
53+
**Affected platforms:** nRF52840, nRF54L15 with LR1110 shield
54+
55+
**Workaround:** Reset device when freezes in endless GNSS loop.
56+
57+
KRKNWK-20857: Location modem stays busy when scan operation overlaps with deinit
58+
The location modem does not recover if a scan runs concurrently with a deinitialization operation.
59+
60+
**Affected platforms:** nRF52840, nRF54L15 with LR1110 shield
61+
62+
**Workaround:** If the location modem stays busy, and cannot perform scan restart the device.
63+
Ensure the location service deinit is triggered when no ongoing scan.
64+
65+
KRKNWK-21159: Crash in ``sid_location_run`` due to invalid context in Wi-Fi callback
66+
The application may crash if ``sid_location_run`` is called in an invalid context during a Wi-Fi callback.
67+
68+
**Affected platforms:** nRF52840, nRF54L15 with LR1110 shield
69+
70+
KRKNWK-21160: Semtech interrupt pin remains high blocking the Wi-Fi scan.
71+
72+
**Affected platforms:** nRF52840, nRF54L15 with LR1110 shield
73+
74+
**Workaround:** Clear event pin interrupt in Semtech hal after each occurrence.
6175

6276
List of known issues for v1.0.1
6377
*******************************

doc/links.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,10 +78,14 @@
7878
.. _Provision your Sidewalk endpoint and flash the binary image: https://docs.sidewalk.amazon/provisioning/iot-sidewalk-provision-endpoint.html
7979
.. _AWS: https://aws.amazon.com/
8080
.. _Setting up a Sidewalk gateway: https://docs.sidewalk.amazon/getting-started/sidewalk-onboard-prereq-gateway.html
81+
.. _Introducing AWS IoT Core Device Location Integration with Amazon Sidewalk: https://aws.amazon.com/blogs/aws/introducing-aws-iot-core-device-location-integration-with-amazon-sidewalk/
82+
.. _Amazon Sidewalk Location Library Developer Guide: https://docs.sidewalk.amazon/assets/pdf/Amazon_Sidewalk_Location_Library_Developer_Guide-1.0-rev-A.pdf
83+
8184

8285
.. Other links and additional resources
8386
8487
.. _SX1262: https://os.mbed.com/components/SX126xMB2xAS/
88+
.. _LR1110: https://www.semtech.com/products/wireless-rf/lora-edge/lr1110
8589
.. _Semtech SX1262MB2CAS: https://www.semtech.com/products/wireless-rf/lora-transceivers/sx1262mb2cas
8690
.. _PICS v2.9.0 - BLE only: https://docs.nordicsemi.com/bundle/Amazon-Sidewalk-Protocol-PICS---BLE-only/resource/Amazon_Sidewalk_Protocol_PICS_-_BLE_only.pdf
8791
.. _PICS v2.9.0: https://docs.nordicsemi.com/bundle/Amazon-Sidewalk-Protocol-PICS/resource/Amazon_Sidewalk_Protocol_PICS.pdf

doc/location_services.rst

Lines changed: 135 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,135 @@
1+
.. _location_services:
2+
3+
Location services
4+
##################
5+
6+
.. contents::
7+
:local:
8+
:depth: 2
9+
10+
The Amazon Sidewalk Location Library provides an API that automatically selects the most power- and time-efficient location mechanism based on available hardware and network conditions.
11+
12+
Overview
13+
********
14+
15+
The Amazon Sidewalk Location Library is available in the Amazon Sidewalk SDK v1.19 and later, and it enables Sidewalk customers to use a range of cloud-based location solvers.
16+
It also provides better control to configure and override the mechanism used to determine location as required.
17+
18+
Supported Location Methods
19+
===========================
20+
21+
The location library supports three types of location resolution methods:
22+
23+
* Sidewalk Network Location over Bluetooth LE - Uses existing Bluetooth LE connections to determine location through the Sidewalk network.
24+
* Wi-Fi Scan - Scans for nearby Wi-Fi access points and sends MAC addresses to the cloud for location resolution.
25+
* GNSS Scan - Uses Global Navigation Satellite System to collect satellite vehicle data for coordinate resolution.
26+
27+
These methods are supported on two available link types:
28+
29+
* Bluetooth LE
30+
* LoRa (Long Range)
31+
32+
.. note::
33+
FSK with Wi-Fi and GNSS scanning enabled is not currently supported.
34+
35+
Wi-Fi and GNSS scanning use the Semtech LoRa Basics Modem middleware to manage and perform scans on the device.
36+
37+
.. list-table:: Hardware and Library Requirements for Location Methods
38+
:header-rows: 1
39+
40+
* - **Location Method**
41+
- **Required Hardware**
42+
- **Supported Sidewalk Library Variants**
43+
* - BLE Location
44+
- nRF chip
45+
- BLE only, or LoRa/FSK
46+
* - Wi-Fi Location
47+
- nRF chip and LR1110 radio
48+
- LoRa and FSK
49+
* - GNSS Location
50+
- nRF chip and LR1110 radio
51+
- LoRa and FSK
52+
53+
.. note::
54+
Semtech SX1262 radio does not support Wi-Fi and GNSS scans.
55+
However, you can still use Bluetooth LE location features while using the SX1262 for LoRa and FSK communication.
56+
57+
Location Levels
58+
===============
59+
60+
Location levels are arranged from lowest to highest effort, based on power usage and time required.
61+
The available hardware on the device determines which levels can be used.
62+
If a higher location level fails or times out, the library automatically moves to the next level after a set timeout.
63+
64+
For more details on integrating device location services with Amazon Sidewalk, refer to the AWS post `Introducing AWS IoT Core Device Location Integration with Amazon Sidewalk`_
65+
66+
This article provides guidance on enabling Device Location for Sidewalk devices, configuring geolocation options in AWS IoT Core, and understanding how location data is transmitted and resolved within the AWS ecosystem.
67+
68+
Level 1: Connected to Sidewalk through BLE
69+
------------------------------------------
70+
71+
At this level, the device uses its existing Sidewalk Bluetooth LE connection to resolve location.
72+
73+
* Power Consumption - No additional power used
74+
* Description - If the device can be located through Bluetooth LE over the Sidewalk network, the device notifies the cloud to resolve the location without extra effort.
75+
If the device is not connected through Bluetooth LE or a location cannot be resolved, the library moves to the next level.
76+
The device’s location is based on the Amazon Hub it is connected to.
77+
78+
Level 2: Reserved
79+
-----------------
80+
81+
This level is not yet supported and will default to the next level if reached.
82+
83+
Level 3: Send Wi-Fi Scan
84+
------------------------
85+
86+
At this level, the device tries to find its location using nearby Wi-Fi networks.
87+
88+
* Power Consumption - Low
89+
* Description - The device scans for nearby Wi-Fi access points and sends the results to the cloud.
90+
It must find at least one access point.
91+
Otherwise, the device will move to the next level.
92+
If the cloud returns a low confidence score or cannot determine the location, the application should proceed to the next level.
93+
94+
Level 4: Send GNSS Scan
95+
-----------------------
96+
97+
At this level, the device uses satellite data for location.
98+
99+
* Power Consumption - Higher power consumption than Wi-Fi scanning
100+
* Description - The device collects and sends GNSS (satellite) data.
101+
At least four satellites must be detected for a valid scan.
102+
103+
Testing
104+
*******
105+
106+
The Sidewalk location feature is implemented in the DUT application.
107+
For testing instructions, see :ref:`variant_sidewalk_dut_test_location`.
108+
109+
Sidewalk libraries
110+
==================
111+
112+
Location service is supported in Sidewalk libraries in the following range:
113+
114+
* Sidewalk Sub-GHz library (LoRa and FSK) supports all location methods.
115+
However to build with radio and pal componets for WiFi and GNSS scanning, ``CONFIG_SIDEWALK_SUBGHZ_RADIO_LR1110`` must be enabled.
116+
This config is enabled automatically when sample is build with ``semtech_lr11xxmb1xxs`` shield.
117+
118+
* Sidewalk Bluetooth LE only library supports only network location method over Bluetooth LE.
119+
120+
Writing custom application
121+
**************************
122+
123+
For detailed API documentation and usage guide for developers, refer to the `Amazon Sidewalk Location Library Developer Guide`_.
124+
125+
.. _location_services_troubleshooting:
126+
127+
Troubleshooting
128+
***************
129+
130+
If you run into problems, the following list includes common issues and their solutions:
131+
132+
* ``No positioning data in the AWS IoT Core`` - Ensure that positioning is activated for your device in the AWS IoT Core console, and a destination is configured.
133+
* ``Sidewalk not ready`` - Make sure Sidewalk is initialized and started before initializing location services.
134+
* ``Initialization order`` - Always initialize location services after calling ``sid_init()`` and deinitialize before calling ``sid_deinit()``.
135+
* ``BLE location not working`` - Ensure the device is connected to a Sidewalk gateway over Bluetooth LE, and the gateway has location services enabled.

0 commit comments

Comments
 (0)