cloudageit / aws-stf-dp-aicl-catversion

STF Core Data Producers

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Smart Territory Framework - Data Producer using AWS IoT Core for LoRaWAN

This repository contains a CDK application that deploys a stack of a Data Producer using AWS IoT Core for LoRaWAN to ingest data from LoRaWAN sensors. This stack deploys the resources needed to ingest data from a LoRaWAN sensor using AWS IoT Core for LoRaWAN including:

  • The LoRaWAN destination that describes the AWS IoT Rule that routes the messages to the Lambda Function that processes the data.
  • The AWS IoT Rule that routes the messages to the Lambda Function.
  • The Lambda Function that decodes and transforms the payload using the NGSI-LD Smart Data Model relevant to the use case before publishing into the STF IoT Queue. You will need the ARN of the STF IoT Queue. The default value of the ARN when deploying the STF IoT Stack is arn:aws:sqs:${Aws.REGION}:${Aws.ACCOUNT_ID}:StfIoTQueue-${Aws.REGION}. Unless you have changed the name of the Queue when deploying the STF IoT Stack, you have nothing to do.

Architecture


You can deploy same stack multiple times for distinct sensors. We include samples of payload decoders (Lambda Function) for various sensors and applications (see the List below).

The name of the stack and the function used is extracted from the thing_prefix used. For example, if you use the prefix SmartParking-BoschPLS, the stack will extract the last part of the prefix in lower case boschpls and will use the Lambda in the folder with the same name boshpls.


Thing Prefix


Prerequisites


To deploy this application, you need the following:

  • An AWS account. If you don't have one, see Set up an AWS account.
  • An AWS Identity and Access Management (IAM) user with administrator permissions
  • AWS CDK Toolkit installed. See Getting started with the AWS CDK to install it.
  • STF Core deployed. The following CDK application requires the ARN of the STF IoT Queue and the prefix used to register this type of sensors in the STF IoT registry.

Getting started

This repository contains a CDK application that deploys a stack of a Data Producer to ingest data from LoRaWAN sensors using AWS IoT Core for LoRaWAN and publishes to STF Core.

You can deploy this stack multiple times for all the LoRaWAN sensors you want to connect. To deploy a stack you need to provide the prefix of the thing that will be registered in the STF IoT Registry and the SQS IoT Queue ARN. We provide samples for some sensors (see the list above).


Parameters


If you used a custom name for the STF IoT Queue when deploying the STF IoT stack, then you can update the ARN of the Queue accordingly in the file stf-dp-aicl.ts.


ARN STF IoT Queue


Once it is set up, you can deploy the application using the following commands:


npm install
cdk bootstrap
cdk deploy --all

The name of the stack and the function used is extracted from the thing_prefix used. For example, if you use the prefix SmartParking-BoschPLS, the stack will extract the last part of the prefix in lower case boschpls and will use the Lambda in the folder with the same name boshpls.

Once the stack is deployed you can onboard your LoRaWAN sensors to AWS IoT Core for LoRaWAN. You will select the LoRa Destination created by this application (named ${thing_prefix}Destination) when onboarding your devices.


LoRa Destination


VoilĂ . You have everything ready.

List of Sensors

We provide ready to use stacks for a list of sensors. The list below will be updated over time.

You can find the Lambda Function that decodes and transform the payload for each sensor in the folder lib.

Indoor Environment Monitoring

This stack uses the Smart Data Models IndoorEnvironmentObserved including properties from AirQualityObserved

  • Indoor Environment Monitoring using SenseCAP S2103. The sensor measures co2, temperature and relative humidity.

  • Indoor Environment Monitoring using Milesight AM103. The sensor measures co2, temperature and relative humidity.

  • Indoor Environment Monitoring using Elsys ERS Sound. The sensor measures illuminance, noise level, temperature and relative humidity.

Smart Parking

This stack uses the Smart Data Models ParkingSpot


Additional Resources

This section provides links to additional resources that may help deploy and operate this application:

Security

See CONTRIBUTING for more information.

License

This library is licensed under the MIT-0 License. See the LICENSE file.

About

STF Core Data Producers

License:MIT No Attribution


Languages

Language:JavaScript 76.2%Language:TypeScript 23.8%