This article will show you how to connect "The Things Network V3" and "AWS IoT Core".
1. TTN Settings
- Select the application to connect from TTN, and select "AWS IoT" from "Integrations".
- Then click on the "Deployment Guide".
- Scroll down.
- For "Select your AWS region", select your region.
- Then click "Deploy for The Things Network" under "Community".
2. AWS Settings
- Enter the TTN cluster address or TTN application ID.
- See below for cluster address and application ID
Creating an API key
- Select "API keys" from the TTN application and click "Add API key".
- Make the settings as shown in the image.
- Copy the created API key and paste it into the aws settings screen.
- When the stack is created by aws, it will be as follows.
- Creating the stack will take a few minutes.
3. Set up with AWS IoT Core
- Log in to the aws IoT Core.
- And if you check "Things", you can see that a new device has been added.
- Let's check if the data can be obtained.
- Enter "lorawan / #" in "MQTT test client".
- After waiting for a while, the data will be earned.
- However, this alone is not enough to extract only the variables you want.
- Let's add a rule for the data format.
- I use a distance sensor, so I try to get only the distance.
- Edit the SQL statement.
- These are the SQL statements I used.
SELECT end_device_ids.device_id AS device, received_at AS r_date, uplink_message.decoded_payload.distance AS distance FROM 'lorawan/A840414/uplink' WHERE uplink_message.decoded_payload.distance > 20
Top comments (0)