Skip to content
This repository was archived by the owner on Jun 15, 2023. It is now read-only.

Commit a31070e

Browse files
committed
Periodic update - 10/05/22-08:52am PDT
1 parent 6d7aa43 commit a31070e

File tree

55 files changed

+813
-293
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+813
-293
lines changed

developerguide/binary-payloads.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Working with binary payloads<a name="binary-payloads"></a>
22

3-
When the message payload should be handled as raw binary data, rather than a JSON object, use the \* operator to refer to it in a `SELECT` clause\. This works for non\-JSON payloads with some rule actions, such as the [S3 action](https://docs.aws.amazon.com/iot/latest/developerguide/iot-rule-actions.html#s3-rule)\.
3+
If you send a raw binary payload, AWS IoT Core routes it downstream to an Amazon S3 bucket through an [S3 action](https://docs.aws.amazon.com/iot/latest/developerguide/iot-rule-actions.html#s3-rule)\. The raw binary payload is then encoded as base64 and attached to JSON\. To handle your message payload as raw binary data \(rather than a JSON object\), you can use the \* operator to refer to it in a SELECT clause\.
44

55
## Binary payload examples<a name="binary-payloads-examples"></a>
66

+88-5
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,90 @@
1-
# Configuring a remote device<a name="configure-remote-device"></a>
1+
# Configuring a remote device and using IoT agent<a name="configure-remote-device"></a>
22

3-
If you want to deliver the destination client access token to the remote device through methods other than subscribing to the reserved IoT MQTT topic, you might need two components on the remote device:
4-
+ A destination client access token listener\.
5-
+ A local proxy\.
3+
The IoT agent is used to receive the MQTT message that includes the client access token and start a local proxy on the remote device\. You must install and run the IoT agent on the remote device if you want secure tunneling to deliver the client access token using MQTT\. The IoT agent must subscribe to the following reserved IoT MQTT topic:
64

7-
The destination client access token listener should work with the client access token delivery mechanism of your choice\. It must be able to start a local proxy in destination mode\.
5+
**Note**
6+
If you want to deliver the destination client access token to the remote device through methods other than subscribing to the reserved MQTT topic, you might need a destination client access token \(CAT\) listener and a local proxy\. The CAT listener must work with your chosen client access token delivery mechanism and be able to start a local proxy in destination mode\.
7+
8+
## IoT agent snippet<a name="agent-snippet"></a>
9+
10+
The IoT agent must subscribe to the following reserved IoT MQTT topic so that it can receive the MQTT message and start the local proxy:
11+
12+
`$aws/things/thing-name/tunnels/notify`
13+
14+
Where `thing-name` is the name of AWS IoT thing associated with the remote device\.
15+
16+
The following is an example MQTT message payload:
17+
18+
```
19+
{
20+
"clientAccessToken": "destination-client-access-token",
21+
"clientMode": "destination",
22+
"region": "aws-region",
23+
"services": ["destination-service"]
24+
}
25+
```
26+
27+
After it receives an MQTT message, the IoT agent must start a local proxy on the remote device with the appropriate parameters\.
28+
29+
The following Java code demonstrates how to use the [AWS IoT Device SDK](https://github.com/aws/aws-iot-device-sdk-java) and [ProcessBuilder](https://docs.oracle.com/javase/8/docs/api/java/lang/ProcessBuilder.html) from the Java library to build a simple IoT agent to work with secure tunneling\.
30+
31+
```
32+
// Find the IoT device endpoint for your AWS account
33+
final String endpoint = iotClient.describeEndpoint(new DescribeEndpointRequest().withEndpointType("iot:Data-ATS")).getEndpointAddress();
34+
35+
// Instantiate the IoT Agent with your AWS credentials
36+
final String thingName = "RemoteDeviceA";
37+
final String tunnelNotificationTopic = String.format("$aws/things/%s/tunnels/notify", thingName);
38+
final AWSIotMqttClient mqttClient = new AWSIotMqttClient(endpoint, thingName,
39+
"your_aws_access_key", "your_aws_secret_key");
40+
41+
try {
42+
mqttClient.connect();
43+
final TunnelNotificationListener listener = new TunnelNotificationListener(tunnelNotificationTopic);
44+
mqttClient.subscribe(listener, true);
45+
}
46+
finally {
47+
mqttClient.disconnect();
48+
}
49+
50+
private static class TunnelNotificationListener extends AWSIotTopic {
51+
public TunnelNotificationListener(String topic) {
52+
super(topic);
53+
}
54+
55+
@Override
56+
public void onMessage(AWSIotMessage message) {
57+
try {
58+
// Deserialize the MQTT message
59+
final JSONObject json = new JSONObject(message.getStringPayload());
60+
61+
final String accessToken = json.getString("clientAccessToken");
62+
final String region = json.getString("region");
63+
64+
final String clientMode = json.getString("clientMode");
65+
if (!clientMode.equals("destination")) {
66+
throw new RuntimeException("Client mode " + clientMode + " in the MQTT message is not expected");
67+
}
68+
69+
final JSONArray servicesArray = json.getJSONArray("services");
70+
if (servicesArray.length() > 1) {
71+
throw new RuntimeException("Services in the MQTT message has more than 1 service");
72+
}
73+
final String service = servicesArray.get(0).toString();
74+
if (!service.equals("SSH")) {
75+
throw new RuntimeException("Service " + service + " is not supported");
76+
}
77+
78+
// Start the destination local proxy in a separate process to connect to the SSH Daemon listening port 22
79+
final ProcessBuilder pb = new ProcessBuilder("localproxy",
80+
"-t", accessToken,
81+
"-r", region,
82+
"-d", "localhost:22");
83+
pb.start();
84+
}
85+
catch (Exception e) {
86+
log.error("Failed to start the local proxy", e);
87+
}
88+
}
89+
}
90+
```

developerguide/connect-iot-lorawan-downlink-queue.md

+3
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,9 @@ You can use the AWS IoT Wireless API to queue downlink messages and clear indivi
6060
**Queue downlink messages**
6161
To create a downlink message queue, use the [https://docs.aws.amazon.com/iot-wireless/2020-11-22/apireference/API_SendDataToWirelessDevice.html](https://docs.aws.amazon.com/iot-wireless/2020-11-22/apireference/API_SendDataToWirelessDevice.html) API operation or the [cli/latest/reference/iotwireless/send-data-to-wireless-device.html](cli/latest/reference/iotwireless/send-data-to-wireless-device.html) CLI command\.
6262

63+
**Note**
64+
When sending a downlink message using the `SendDataToWirelessDevice` API, you can choose the gateways that you want to use for the downlink data traffic\. For more information, see [Choosing gateways to receive the LoRaWAN downlink data traffic](connect-iot-lorawan-gateway-participate.md)\.
65+
6366
```
6467
aws iotwireless send-data-to-wireless-device \
6568
--id "11aa5eae-2f56-4b8e-a023-b28d98494e49" \
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
# Configuring your gateways to send beacons to class B devices<a name="connect-iot-lorawan-gateway-beaconing"></a>
2+
3+
If you onboard class B wireless devices to AWS IoT Core for LoRaWAN, the devices receive downlink messages in scheduled time slots\. The devices open these slots based on time\-synchronized beacons that are transmitted by the gateway\. For your gateways to transmit these time\-synchronous beacons, you can use AWS IoT Core for LoRaWAN to configure certain beaconing\-related parameters for the gateways\.
4+
5+
To configure these beaconing parameters, your gateway must be running LoRa Basics Station software version 2\.0\.4 or later\. For more information, see [Using qualified gateways from the AWS Partner Device Catalog](connect-iot-lorawan-manage-gateways.md#connect-iot-lorawan-qualified-gateways)\.
6+
7+
## How to configure the beaconing parameters<a name="connect-iot-lorawan-beaconing-configure"></a>
8+
9+
**Note**
10+
You only need to configure the beaconing parameters for your gateway if it's communicating with a class B wireless device\.
11+
12+
You configure the beaconing parameters when adding your gateway to AWS IoT Core for LoRaWAN using the [https://docs.aws.amazon.com/iot-wireless/2020-11-22/apireference/API_CreateWirelessGateway.html](https://docs.aws.amazon.com/iot-wireless/2020-11-22/apireference/API_CreateWirelessGateway.html) API operation\. When you invoke the API operation, specify the following parameters using the `Beaconing` object for your gateways\. After you configure the parameters, the gateways will send the beacons to your devices at a 128\-second interval\.
13+
+ `DataRate`: The data rate for the gateways that are transmitting the beacons\.
14+
+ `Frequencies`: The list of frequencies for the gateways to transmit the beacons\.
15+
16+
The following example shows how you configure these parameters for the gateway\. The `input.json` file will contain additional details, such as the gateway certificate and provisioning credentials\. For more information about adding your gateway to AWS IoT Core for LoRaWAN using the `CreateWirelessGateway` API operation, see [Add a gateway by using the API](connect-iot-lorawan-onboard-gateway-add.md#connect-iot-lorawan-onboard-gateway-api)\.
17+
18+
**Note**
19+
The beaconing parameters aren't available when you add your gateway to AWS IoT Core for LoRaWAN using the AWS IoT console\.
20+
21+
```
22+
aws iotwireless create-wireless-gateway \
23+
--lorawan GatewayEui="a1b2c3d4567890ab",RfRegion="US915" \
24+
--name "myLoRaWANGateway" \
25+
--cli-input-json file://input.json
26+
```
27+
28+
The following shows the contents of the `input.json` file\.
29+
30+
**Contents of input\.json**
31+
32+
```
33+
{
34+
"Arn": "arn:aws:iotwireless:us-east-1:400232685877aa:WirelessGateway/a01b2c34-d44e-567f-abcd-0123e445663a",
35+
"Description": "My LoRaWAN gateway",
36+
"LoRaWAN": {
37+
"GatewayEui": "a1b2c3d4567890ab",
38+
"JoinEuiFilters": [
39+
["0000000000000001", "00000000000000ff"],
40+
["000000000000ff00", "000000000000ffff"]
41+
],
42+
"NetIdFilters": ["000000", "000001"],
43+
"RfRegion": "US915",
44+
"SubBands": [2]
45+
},
46+
"Beaconing": {
47+
"DataRate": 8,
48+
"Frequencies": ["923300000","923900000"]
49+
},
50+
"Name": "myFirstLoRaWANGateway",
51+
"ThingArn": null,
52+
"ThingName": null
53+
}
54+
```
55+
56+
## Get information about the beaconing parameters<a name="connect-iot-lorawan-beaconing-get"></a>
57+
58+
You can get information about the beaconing parameters for your gateway using the [https://docs.aws.amazon.com/iot-wireless/2020-11-22/apireference/API_GetWirelessGateway.html](https://docs.aws.amazon.com/iot-wireless/2020-11-22/apireference/API_GetWirelessGateway.html) API operation\.
59+
60+
**Note**
61+
If a gateway has already been onboarded, you can't use the `UpdateWirelessGateway` API operation to configure the beaconing parameters\. To configure the parameters, you must delete the gateway and then specify the parameters when adding your gateway using the `CreateWirelessGateway` API operation\.
62+
63+
```
64+
aws iotwireless get-wireless-gateway \
65+
--identifier "12345678-a1b2-3c45-67d8-e90fa1b2c34d" \
66+
--identifier-type WirelessGatewayId
67+
```
68+
69+
Running this command returns information about your gateway and the beaconing parameters\.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Configure beaconing and filtering capabilities of your LoRaWAN gateways<a name="connect-iot-lorawan-gateway-configure"></a>
2+
3+
When working with LoRaWAN devices, you can configure certain optional parameters for your LoRaWAN gateways\. The parameters include:
4+
+
5+
6+
**Beaconing**
7+
You can configure beaconing parameters for your LoRaWAN gateways that are acting as a bridge for your class B LoRaWAN devices\. These devices receive a downlink message at scheduled time slots, so you must configure the beaconing parameters for your gateways to transmit these time\-synchronized beacons\.
8+
+
9+
10+
**Filtering**
11+
You can configure the `NetID` and `JoinEUI` parameters for your LoRaWAN gateways to filter the device data traffic\. Filtering the traffic helps conserve bandwidth usage and reduces the traffic flow between the gateways and LNS\.
12+
+
13+
14+
**Sub\-bands**
15+
You can configure the sub\-bands for your gateway to specify the particular sub\-band that you want to use\. For wireless devices that can't hop between the various sub\-bands, you can use this capability to communicate with the devices using only the frequency channels in that particular sub\-band\.
16+
17+
The following topics contain more information about these parameters and how to configure them\. The beaconing parameters aren't available in the AWS Management Console and can only be specified using the AWS IoT Wireless API or the AWS CLI\.
18+
19+
**Topics**
20+
+ [Configuring your gateways to send beacons to class B devices](connect-iot-lorawan-gateway-beaconing.md)
21+
+ [Configuring your gateway's subbands and filtering capabilities](connect-iot-lorawan-subband-filter-configuration.md)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
# Choosing gateways to receive the LoRaWAN downlink data traffic<a name="connect-iot-lorawan-gateway-participate"></a>
2+
3+
When you send a downlink message from AWS IoT Core for LoRaWAN to your device, you can choose the gateways you want to use for the downlink data traffic\. You can specify an individual gateway or choose from a list of gateways to receive the downlink traffic\.
4+
5+
## How to specify the gateway list<a name="connect-iot-lorawan-participate-how"></a>
6+
7+
You can specify an individual gateway or the list of gateways to use when sending a downlink message from AWS IoT Core for LoRaWAN to your device using the [https://docs.aws.amazon.com/iot-wireless/2020-11-22/apireference/API_SendDataToWirelessDevice.html](https://docs.aws.amazon.com/iot-wireless/2020-11-22/apireference/API_SendDataToWirelessDevice.html) API operation\. When you invoke the API operation, specify the following parameters using the `ParticipatingGateways` object for your gateways\.
8+
9+
**Note**
10+
The list of gateways you want to use isn't available in the AWS IoT console\. You can specify this list of gateways to use only when using the `SendDataToWirelessDevice` API operation or the CLI\.
11+
+ `DownlinkMode`: Indicates whether to send the downlink message in sequential mode or concurrent mode\. For class A devices, specify `UsingUplinkGateway` to use only the chosen gateways from the previous uplink message transmission\.
12+
+ `GatewayList`: The list of gateways that you want to use for sending the downlink data traffic\. The downlink payload will be sent to the specified gateways with the specified frequency\. This is indicated using a list of `GatewayListItem` objects, that consists of `GatewayId` and `DownlinkFrequency` pairs\.
13+
+ `TransmissionInterval`: The duration of time for which AWS IoT Core for LoRaWAN will wait before transmitting the payload to the next gateway\.
14+
15+
**Note**
16+
You can specify this list of gateways to use only when sending the downlink message to a class B or a class C wireless device\. If you use a class A device, the gateway that you chose when sending the uplink message will be used when a downlink message is sent to the device\.
17+
18+
The following example shows how you specify these parameters for the gateway\. The `input.json` file will contain additional details\. For more information about sending a downlink message using the `SendDataToWirelessDevice` API operation, see [Perform downlink queue operations by using the API](connect-iot-lorawan-downlink-queue.md#connect-iot-lorawan-downlink-queue-api)\.
19+
20+
**Note**
21+
The parameters for specifying the list of participating gateways aren't available when you send a downlink message from AWS IoT Core for LoRaWAN using the AWS IoT console\.
22+
23+
```
24+
aws iotwireless send-data-to-wireless-device \
25+
--id "11aa5eae-2f56-4b8e-a023-b28d98494e49" \
26+
--transmit-mode "1" \
27+
--payload-data "SGVsbG8gVG8gRGV2c2lt" \
28+
--cli-input-json file://input.json
29+
```
30+
31+
The following shows the contents of the `input.json` file\.
32+
33+
**Contents of input\.json**
34+
35+
```
36+
{
37+
"WirelessMetadata": {
38+
"LoRaWAN": {
39+
"FPort": "1",
40+
"ParticipatingGateways": {
41+
"DownlinkMode": "SEQUENTIAL",
42+
"TransmissionInterval": 1200,
43+
"GatewayList": [
44+
{
45+
"DownlinkFrequency": 100000000,
46+
"GatewayID": a01b2c34-d44e-567f-abcd-0123e445663a
47+
},
48+
{
49+
"DownlinkFrequency": 100000101,
50+
"GatewayID": 12345678-a1b2-3c45-67d8-e90fa1b2c34d
51+
}
52+
]
53+
}
54+
}
55+
}
56+
}
57+
```
58+
59+
The output of running this command generates a `MessageId` for the downlink message\. In some cases, even if you receive the `MessageId`, packets can get dropped\. For more information about how you can resolve the error, see [Troubleshoot downlink message queue errors](connect-iot-lorawan-downlink-queue.md#connect-iot-lorawan-downlink-queue-troubleshoot)\.
60+
61+
```
62+
{
63+
MessageId: "6011dd36-0043d6eb-0072-0008"
64+
}
65+
```
66+
67+
## Get information about the list of participating gateways<a name="connect-iot-lorawan-participate-get"></a>
68+
69+
You can get information about the list of gateways that are participating in receiving the downlink message by listing messages in the downlink queue\. To list messages, use the [https://docs.aws.amazon.com/iot-wireless/2020-11-22/apireference/API_ListQueuedMessages.html](https://docs.aws.amazon.com/iot-wireless/2020-11-22/apireference/API_ListQueuedMessages.html) API\.
70+
71+
```
72+
aws iotwireless list-queued-messages \
73+
--wireless-device-type "LoRaWAN"
74+
```
75+
76+
Running this command returns information about the messages in the queue and their parameters\.

developerguide/connect-iot-lorawan-onboard-gateway-add.md

+7-2
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,12 @@ The following lists describe the API actions that perform the tasks associated w
8888
For the complete list of the actions and data types available to create and manage AWS IoT Core for LoRaWAN resources, see the [AWS IoT Wireless API reference](https://docs.aws.amazon.com/iot-wireless/2020-11-22/apireference/welcome.html)\.
8989

9090
**How to use the AWS CLI to add a gateway**
91-
You can use the AWS CLI to create a wireless gateway by using the [create\-wireless\-gateway](https://docs.aws.amazon.com/cli/latest/reference/iotwireless/create-wireless-gateway.html) command\. The following example creates a wireless LoRaWAN device gateway\. You can also provide an `input.json` file that will contain additional details such as the gateway certificate and provisioning credentials\.
91+
You can use the AWS CLI to create a wireless gateway by using the [create\-wireless\-gateway](https://docs.aws.amazon.com/cli/latest/reference/iotwireless/create-wireless-gateway.html) command\.
92+
93+
**Note**
94+
If your gateway is communicating with class B LoRaWAN devices, you can also specify certain beaconing parameters when adding the gateway using the `CreateWirelessGateway` API or the `create-wireless-gateway` CLI command\. For more information, see [Configuring your gateways to send beacons to class B devices](connect-iot-lorawan-gateway-beaconing.md)\.
95+
96+
The following example creates a wireless LoRaWAN device gateway\. You can also provide an `input.json` file that will contain additional details such as the gateway certificate and provisioning credentials\.
9297

9398
**Note**
9499
You can also perform this procedure with the API by using the methods in the AWS API that correspond to the CLI commands shown here\.
@@ -98,7 +103,7 @@ aws iotwireless create-wireless-gateway \
98103
--lorawan GatewayEui="a1b2c3d4567890ab",RfRegion="US915" \
99104
--name "myFirstLoRaWANGateway" \
100105
--description "Using my first LoRaWAN gateway"
101-
--cli-input-json input.json
106+
--cli-input-json file://input.json
102107
```
103108

104109
For information about the CLIs that you can use, see [AWS CLI reference](https://docs.aws.amazon.com/cli/latest/reference/iotwireless/index.html)

0 commit comments

Comments
 (0)