diff --git a/README.md b/README.md index 2485a2e..a83e003 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ AWS IoT Core for LoRaWAN connects sensors with LoRaWAN gateways, allowing for de - [How to analyse LoRaWAN payloads with Amazon Timestream and visualize them with Grafana](timestream) - You can use "AWS IoT Core for LoRaWAN" to ingest time series data from your LoRaWAN devices into Amazon Timestream. After that you can visualize your data in Grafana using a [Grafana timestream plugin](https://grafana.com/grafana/plugins/grafana-timestream-datasource/installation). This repository how to build a sample solution for storing your times eries data and visualizing them. + You can use "AWS IoT Core for LoRaWAN" to ingest time series data from your LoRaWAN devices into Amazon Timestream. After that you can visualize your data in Grafana using a [Grafana timestream plugin](https://grafana.com/grafana/plugins/grafana-timestream-datasource/installation). This repository how to build a sample solution for storing your times series data and visualizing them. - [Sample soil moisture alarming application based on AWS IoT Core, AWS IoT Events and Amazon SNS ](soilmoisture_alarming) Detecting events based on telemetry data from connected devices is a common use case in IoT across many industries. This repository contains a sample for integrating AWS IoT Events with LoRaWAN for IoT Core. You can learn how to translate telemetry values from a LoRaWAN device into events and notify users about these events using E-Mail and SMS. diff --git a/soilmoisture_alarming/README.md b/soilmoisture_alarming/README.md index 8466c78..61c2869 100644 --- a/soilmoisture_alarming/README.md +++ b/soilmoisture_alarming/README.md @@ -41,7 +41,7 @@ For this sample to work, your LoRaWAN devices have to publish payloads to a topi "payload": { "transformed_payload": { "water_soil": 10.1, - "DeviceId": "33a9fdf8-e7ac-406f-9517-df4807603" + "WirelessDeviceId": "33a9fdf8-e7ac-406f-9517-df4807603" } } } @@ -52,7 +52,7 @@ Additional JSON attributes are ignored. The name of the topic can be adjusted by If you have not implemented publishing of payloads from your LoRaWAN devices yet, please consider the following options: - You can test this sample by simulating ingestion from your LoRaWAN devices with an [AWS IoT Test client](https://docs.aws.amazon.com/iot/latest/developerguide/view-mqtt-messages.html) as described in [this section](#option-1-test-by-ingesting-sample-payload-via-aws-iot-mqtt-test-client) -- You can use [transform a binary LoRaWAN payload into JSON sample](../integration/transform_binary_payload_custom) to learn how to use binary decoders to convert binary payloads from your LoRaWAN device into JSON and publish these payloads to above mentioned topic in above mentioned JSON structure. +- You can use [transform a binary LoRaWAN payload into JSON sample](../integration/transform_binary_payload) to learn how to use binary decoders to convert binary payloads from your LoRaWAN device into JSON and publish these payloads to above mentioned topic in above mentioned JSON structure. ## Quick setup - deploy a sample application in your AWS Account @@ -74,8 +74,7 @@ Please perform following steps: 1. Check out this repository on your computer ```shell - # git clone https://github.com/aws-samples/aws-iotcore-lorawan , Not published yet! - git clone ssh://git.amazon.com/pkg/Aws-iot-lorawansb-sample + git clone https://github.com/aws-samples/aws-iot-core-lorawan , Not published yet! cd sample_applications/soilmoisture_alarming ``` @@ -114,7 +113,7 @@ Following resources have been deployed to your AWS account: **3.AWS IoT Events input `MoistureSensorMeasurement`** Please refer to section [How the IoT Event detector model works](#how-the-iot-event-detector-model-works) for details of detector model implementation -**4. Amazon SNS topic `SBDemoAlarmTopic`** +**4. Amazon SNS topic `AlarmingTopic`** This topic is pre-configured with two subscriptions (SMS and E-Mail) according to your parameter inputs in a CloudFormation template. ## How to run the application @@ -132,7 +131,7 @@ To put detector in a "Dry" state, please ingest following payload to the above m "payload": { "transformed_payload": { "water_soil": 1, - "DeviceId": "33a9fdf8-e7ac-406f-9517-df4807603" + "WirelessDeviceId": "33a9fdf8-e7ac-406f-9517-df4807603" } } } @@ -146,7 +145,7 @@ To put detector in a "Healthy" state, please ingest following payload to the abo "payload": { "transformed_payload": { "water_soil": 70, - "DeviceId": "33a9fdf8-e7ac-406f-9517-df4807603" + "WirelessDeviceId": "33a9fdf8-e7ac-406f-9517-df4807603" } } } @@ -165,7 +164,7 @@ To connect the application to your LoRaWAN devices, you have to ensure that the "payload": { "transformed_payload": { "water_soil": 10.1, - "DeviceId": "33a9fdf8-e7ac-406f-9517-df4807603" + "WirelessDeviceId": "33a9fdf8-e7ac-406f-9517-df4807603" } } } @@ -174,9 +173,9 @@ To connect the application to your LoRaWAN devices, you have to ensure that the Attribute values: - `water_soil` value is a float between 0 and 100 and reflects the relative soil moisture between 0% (dry) and 100% (full moistured). -- `DeviceId` value is a string with a maximum length of 128 which uniquely identifies the device. For example, you could use LoRaWAN DeviceId or any other unique string. +- `WirelessDeviceId` value is a string with a maximum length of 128 which uniquely identifies the device. For example, you could use LoRaWAN WirelessDeviceId or any other unique string. -The aforementioned payload is expected to be published to an MQTT topic `dt/lorawantransformed/moisture/` as defined in the AWS IoT Core Rule `ForwardLoRaWANTelemetryToIoTEvents`. +The aforementioned payload is expected to be published to an MQTT topic `dt/lorawantransformed/moisture/` as defined in the AWS IoT Core Rule `ForwardLoRaWANTelemetryToIoTEvents`. ## Advanced technical information diff --git a/timestream/template.yaml b/timestream/template.yaml index 25671ca..52753c2 100644 --- a/timestream/template.yaml +++ b/timestream/template.yaml @@ -8,12 +8,7 @@ Parameters: Type: String Default: sample_device Description: Name of binary decoder as configured in src-iotrule-transformation/app.py - - TopicIncomingBinaryMessages: - Type: String - Default: + - Description: Topic pattern for subscription to messages from a AWS IoT Core for LoRaWAN destination. - + TopicError: Type: String Default: dt/lorawanerror @@ -136,7 +131,6 @@ Resources: WirelessDeviceId as lns_message.WirelessDeviceId, WirelessMetadata as lns_message.WirelessMetadata, PayloadData as lns_message.PayloadData - from '${TopicIncomingBinaryMessages}' - { LambdaARN: !GetAtt TransformLoRaWANBinaryPayloadForTimestreamFunction.Arn } Actions: - Lambda: diff --git a/transform_binary_payload/src-payload-decoders/python/requirements.txt b/transform_binary_payload/src-payload-decoders/python/requirements.txt new file mode 100644 index 0000000..e69de29