ADTRAN 7310-8 Getting Started Manual page 20

Lorawan gateway with aws iot core
Hide thumbs Also See for 7310-8:
Table of Contents

Advertisement

The configuration steps required to create the "Hello World" application and test a device's ability to communicate
across the IoT network includes the following:
Creating and Testing the Lambda Function
Creating the Destination Rule
Configuring Amazon SNS
Configuring IoT Analytics
Testing your "Hello World" Application
8.2 Creating and Testing the Lambda Function
The lambda function is used to process device messages, after they have been processed by the IoT Rules Engine.
The IoT Rules Engine processes these messages using a configured destination rule.
To create the lambda function to process device messages processed by the destination rule, follow these steps:
Go to the AWS Lambda console (console.aws.amazon.com/lambda).
1.
Click on Functions in the navigation pane.
2.
Click on Create function.
3.
Select Author from scratch. Under Basic information, enter the function name "sailboatdecoder" and
4.
choose Runtime Node.js 12.x. from the Runtime drop-down menu.
Click on Create function.
5.
Navigate to <<provide your github repository URL>> and copy the code for the lambda function.
6.
Under Function code, paste the copied code into the editor under the index.js tab.
7.
Once the code has been pasted, choose Deploy to deploy the lambda code.
8.
Click on the Permissions tab of the lambda function
9.
Change the Lambda Role Policy permission by following these steps:
10.
a.
Under Execution role, click on the hyperlink under Role name.
b. On the Permissions tab, find the policy name and click on it.
Choose Edit policy, and choose the JSON tab.
c.
d. Append the following to the Statement section of the policy to allow publishing to AWS IoT:
,
{
"Effect": "Allow",
"Action": [
"iot:Publish"
],
"Resource": [
"*"
]
}
e.
Choose Review Policy, then Save changes.
To test the lambda function, use the following steps to create a test event:
In the drop-down for Select a test event, choose Configure test events.
1.
Enter a name for the test event under Event name.
2.
Paste the following sample payload in the area under Event name:
3.
{
"MessageId": "55d122ab-6355-2233-9874-ff47c5222108",
"WirelessDeviceId": "65d128ab-90dd-4668-9556-fe47c589610b",
"PayloadData": "zA0LYgHpAX//f/8=",
"WirelessMetadata":
{
© 2020, Amazon Web Services, Inc. or its affiliates. All rights reserved.
"LoRaWAN":

Advertisement

Table of Contents
loading

Table of Contents