Skip to main content

Using AWS Cloud Services for SenseCAP T1000 Tracker

AWS IoT provides the cloud services that connect your IoT devices to other devices and AWS cloud services. AWS IoT provides device software that can help you integrate your IoT devices into AWS IoT-based solutions. If your devices can connect to AWS IoT, AWS IoT can connect them to the cloud services that AWS provides.

Login to AWS IoT console

info

If you do not have an AWS account, click here to create one.

Add Gateway

Navigate to Internet of Things, then click IoT Core.

pir

On the left menu,select LPWAN devicesGateways, click Add gateway

pir

Gateway's EUI: The EUI of your gateway, you can find it on the device label.
Frequency: The gateway's frequency band.
Name: Name your gateway(optional)
SubBand: Optionally, you can also specify LoRaWAN configuration data such as the subbands that you want to use and filters that can control the flow of traffic. For more information, see Configure position of wireless resources with AWS IoT Core for LoRaWAN.

pir

Configure your gateway

Gateway Certificate

To authenticate your gateway so that it can securely communicate with AWS IoT, your LoRaWAN gateway must present a private key and certificate to AWS IoT Core for LoRaWAN.

Click Create certificate.

pir

Download and save the certificate files and the server trust certificates.

pir

There shoule be four files inside, you'll use them later to configure the gateway.

pir

Gateway Permission

If you haven't created the IoTWirelessGatewayCertManagerRole IAM role for your account, create the role before you continue adding the gateway. Your gateways won't be able to communicate with AWS IoT without this role.

Choose the Role: IoT Wireless Gateway Cert Manager Role, then submit the configuration.

pir

Copy the CUPS URL, we will use it in the next step.

pir

Gateway Configuration

Login to the Luci configure page of the gateway, check Get_Started for more details.

Navigate to LoRa > LoRa Network.

Mode: Basic Station
Gateway EUI: Your gateway eui
Server: CUPS Server
URL: The CUPS URL we copied before
Authentication Mode: TLS Server and Client Authentication

pir

Copy the content of the certificate file we downloaded before(the certificate can be opened in text form).

pir

Navigate to the Gateways page and choose the gateway you've added.

In the LoRaWAN specific details section of the Gateway details page, you'll see the connection status and the date and time the last uplink was received.

pir

Add Profiles

Device and service profiles can be defined to describe common device configurations. These profiles describe configuration parameters that are shared by devices to make it easier to add those devices. AWS IoT Core for LoRaWAN supports device profiles and service profiles.

Add devices profiles

Navigate to Devices > Profiles, click Add device profile.

pir

Provide a Device profile name, select the Frequency band (RfRegion)that you're using for the device and gateway, and keep the other settings to the default values.

pir

Add service profiles

Navigate to Devices > Profiles, click Add service profile

pir

It's recommend that you leave the setting AddGWMetaData enabled so that you'll receive additional gateway metadata for each payload, such as RSSIand SNR for the data transmission.

pir

Add Destination

Navigate to Devices > Destination, click Add destination.

pir

Here select Publish to AWS IoT Core Message Broker and name the destination's MQTT topic

Permissions: Select an existing service role > IoT Wireless Gateway Cert Manager Role

info

A destination name can only have alphanumeric, - (hyphen) and _ (underscore) characters and it can't have any spaces.

pir

Add LoRaWAN Devices

Add wireless device

Navigate to LPWAN devices > Devices, click Add wireless device.

Wireless device specification: OTAAv1.0x

DevEUI/APP EUI/APP key: can be found in the SenseCAP Mate APP, check Get_Started for more details.

pir

pir

Select the device profile and destination you created in the previous step.

pir

Navigate to the Devices page and choose the device you added before.

In the Details section of the Wireless devices details page, you'll see the date received.

pir

Configure the decoder

Create Message Rules

Navigate to Message routing tab → Rules, and click Create Rule button.

pir

Name your rule and submit it.

pir

SQL version: 2016-03-23
SQL statement: SELECT * FROM "YourDestinationTopic"

Here we fill in t1000-raw according to Add Destination

pir

Scroll down to Rule actions section, and select Lambda from Action 1, then click Create a Lambda function.

pir

Function name: Name your function.
Runtime: Node.js 20.x
Architexture: x86_64

Click Create function button to create a new function.

pir

After creating the function, it goes to the function's config page. We will configure it later so just go back to the rules page.

Click the Refresh button and select the Lambda function you create before. Then click Next to Step 4.

pir

Check that all details of the rule are correct, then click Create to create the rule.

pir

Configure the Lambda Function

Back to Message routing tab → Rules, select the rule you created before.

Click Lambda from Actions and then click the link to go to the Lambda function configuration page.

pir

pir

On the following funcition config page, rename the index.mjs file to index.js, remove all the code and replace it with the script from Resource, then click Deploy button.

pir

Note

Replace the region and device id according to your device.

After configuring the decoder, Click ConfigurationPermissionsEdit.

pir

Click View the xxxxxxxxxxx role at the bottom.

pir

Click Add permissionsAttach policies.

pir

Search AdministratorAccess, check the box left it, and then click Add Permissions.

pir

Check the data

Check the data on page MQTT test client, input # and click Subscribe button, you will see the data.

The raw payload of T1000 Tracker publish from t1000-raw and the decoded data publish from tracker/measurement.

pir

pir

Resource

SenseCAP T1000 Tracker Decoder for AWS

Loading Comments...