This package contains AWS CDK L2 constructs for IoT Wireless.
For a Gateway being able to work properly, you need a specific IAM role.
new GatewayCertManagerIamRole(this, "GatewayIamRole");
Create an IoT Wireless Gateway:
new Gateway(this, 'gw', {
gatewayEui: 'a123123123123123'
description: 'my gateway'
});
To allow IoT Destinations to publish to an IoT rule there is a IAM role required. This role allows all Destinations to publish to all Rules.
const destRole = new DestinationIamRole(this, "destRole");
The Dragino sensor transmits an encoded payload. To decode it we use a IoT topic that decodes the payload with a Lambda function and republishes it to the provided topic by using the Republish rule action. You can use the returned ruleName
as a destination for Iot Wireless Devices.
const rule = new LHT65PayloadDecoderRule(this, "decoder", {
republishTopic: "republish/${topic()}",
});
new CfnOutput(this, "ruleName", {
value: rule.ruleName,
});
republishTopic
The message will be republished to the provided topic. For permission reasons, do not use Substitution Templates on the first level. Otherwise permissions will not be set correctly.
Creates a Device Profile and a Service Profile for Dragino LHT65 sensors. All properties have a default value that fits with the current generation of sensors, but can be set individually if needed.
const lht65profiles = new LHT65Profiles(this, "profiles", {
rfRegion: "US915",
});
Creates a Lambda function that lets you send a Downlink Payload to the sensors. Currently it's just possible to adjust the intervall of the trasmitted sensor data and it the Lambda function sets it on all available LoRaWAN devices.
new LHT65DownlinkPayloadLambda(this, "dlpl");
The Lambda can be invoked with a event containing a JSON like this:
{
"FPort": 2,
"IntervalInSeconds": "900",
"TransmitMode": 1
}
- Make sure you have the latest commits locally pulled (Github actions create new commits on the server).
- make your changes
- If there are only commits with fix: prefix, projen bumps only the PATCH version.
- If there is at least one commit with feat: prefix, projen bumps the MINOR version
- run the command
yarn build
locally - commit the latest changes
git push
your changes
Grants all Wireless Destinations to forward messages to IoT rules (aka MQTT topics).
import { DestinationIamRole } from '@cloudxs/cdk-iot-wireless'
new DestinationIamRole(scope: Construct, id: string)
Name | Type | Description |
---|---|---|
scope |
constructs.Construct |
No description. |
id |
string |
No description. |
- Type: constructs.Construct
- Type: string
Name | Description |
---|---|
toString |
Returns a string representation of this construct. |
public toString(): string
Returns a string representation of this construct.
Name | Description |
---|---|
isConstruct |
Checks if x is a construct. |
import { DestinationIamRole } from '@cloudxs/cdk-iot-wireless'
DestinationIamRole.isConstruct(x: any)
Checks if x
is a construct.
- Type: any
Any object.
Name | Type | Description |
---|---|---|
node |
constructs.Node |
The tree node. |
role |
aws-cdk-lib.aws_iam.Role |
IAM Role object. |
public readonly node: Node;
- Type: constructs.Node
The tree node.
public readonly role: Role;
- Type: aws-cdk-lib.aws_iam.Role
IAM Role object.
Creates an IoT Wireless Gateway.
import { Gateway } from '@cloudxs/cdk-iot-wireless'
new Gateway(scope: Construct, id: string, props: IGatewayProps)
Name | Type | Description |
---|---|---|
scope |
constructs.Construct |
No description. |
id |
string |
No description. |
props |
IGatewayProps |
No description. |
- Type: constructs.Construct
- Type: string
- Type: IGatewayProps
Name | Description |
---|---|
toString |
Returns a string representation of this construct. |
public toString(): string
Returns a string representation of this construct.
Name | Description |
---|---|
isConstruct |
Checks if x is a construct. |
import { Gateway } from '@cloudxs/cdk-iot-wireless'
Gateway.isConstruct(x: any)
Checks if x
is a construct.
- Type: any
Any object.
Name | Type | Description |
---|---|---|
node |
constructs.Node |
The tree node. |
public readonly node: Node;
- Type: constructs.Node
The tree node.
Creates a role called 'IoTWirelessGatewayCertManagerRole' that is needed by the IoT Wireless gateway.
import { GatewayCertManagerIamRole } from '@cloudxs/cdk-iot-wireless'
new GatewayCertManagerIamRole(scope: Construct, id: string)
Name | Type | Description |
---|---|---|
scope |
constructs.Construct |
No description. |
id |
string |
No description. |
- Type: constructs.Construct
- Type: string
Name | Description |
---|---|
toString |
Returns a string representation of this construct. |
public toString(): string
Returns a string representation of this construct.
Name | Description |
---|---|
isConstruct |
Checks if x is a construct. |
import { GatewayCertManagerIamRole } from '@cloudxs/cdk-iot-wireless'
GatewayCertManagerIamRole.isConstruct(x: any)
Checks if x
is a construct.
- Type: any
Any object.
Name | Type | Description |
---|---|---|
node |
constructs.Node |
The tree node. |
public readonly node: Node;
- Type: constructs.Node
The tree node.
Creates a Lambda function that sends a payload to all available LoRaWAN devices.
Currently it allows only adjusting the interval of the devices.
import { LHT65DownlinkPayloadLambda } from '@cloudxs/cdk-iot-wireless'
new LHT65DownlinkPayloadLambda(scope: Construct, id: string)
Name | Type | Description |
---|---|---|
scope |
constructs.Construct |
No description. |
id |
string |
No description. |
- Type: constructs.Construct
- Type: string
Name | Description |
---|---|
toString |
Returns a string representation of this construct. |
public toString(): string
Returns a string representation of this construct.
Name | Description |
---|---|
isConstruct |
Checks if x is a construct. |
import { LHT65DownlinkPayloadLambda } from '@cloudxs/cdk-iot-wireless'
LHT65DownlinkPayloadLambda.isConstruct(x: any)
Checks if x
is a construct.
- Type: any
Any object.
Name | Type | Description |
---|---|---|
node |
constructs.Node |
The tree node. |
public readonly node: Node;
- Type: constructs.Node
The tree node.
Creates an IoT Wireless Rule.
It decodes the encoded Payload from Dragino Sensors and republishes it to a topic.
import { LHT65PayloadDecoderRule } from '@cloudxs/cdk-iot-wireless'
new LHT65PayloadDecoderRule(scope: Construct, id: string, props: ILHT65PayloadDecoderRuleProps)
Name | Type | Description |
---|---|---|
scope |
constructs.Construct |
No description. |
id |
string |
No description. |
props |
ILHT65PayloadDecoderRuleProps |
No description. |
- Type: constructs.Construct
- Type: string
Name | Description |
---|---|
toString |
Returns a string representation of this construct. |
public toString(): string
Returns a string representation of this construct.
Name | Description |
---|---|
isConstruct |
Checks if x is a construct. |
import { LHT65PayloadDecoderRule } from '@cloudxs/cdk-iot-wireless'
LHT65PayloadDecoderRule.isConstruct(x: any)
Checks if x
is a construct.
- Type: any
Any object.
Name | Type | Description |
---|---|---|
node |
constructs.Node |
The tree node. |
ruleName |
string |
returns the IoT rule name, which can be used as a topic to send encoded sensor data to. |
public readonly node: Node;
- Type: constructs.Node
The tree node.
public readonly ruleName: string;
- Type: string
returns the IoT rule name, which can be used as a topic to send encoded sensor data to.
Creates a device and a service profile for Dragino LHT65 Temperature Sensors.
import { LHT65Profiles } from '@cloudxs/cdk-iot-wireless'
new LHT65Profiles(scope: Construct, id: string, props?: IAWSIotProfiles)
Name | Type | Description |
---|---|---|
scope |
constructs.Construct |
No description. |
id |
string |
No description. |
props |
IAWSIotProfiles |
No description. |
- Type: constructs.Construct
- Type: string
- Type: IAWSIotProfiles
Name | Description |
---|---|
toString |
Returns a string representation of this construct. |
public toString(): string
Returns a string representation of this construct.
Name | Description |
---|---|
isConstruct |
Checks if x is a construct. |
import { LHT65Profiles } from '@cloudxs/cdk-iot-wireless'
LHT65Profiles.isConstruct(x: any)
Checks if x
is a construct.
- Type: any
Any object.
Name | Type | Description |
---|---|---|
node |
constructs.Node |
The tree node. |
deviceProfile |
string |
Device profile ID for LHT65 sensors. |
serviceProfile |
string |
Service profile ID for LHT65 sensors. |
public readonly node: Node;
- Type: constructs.Node
The tree node.
public readonly deviceProfile: string;
- Type: string
Device profile ID for LHT65 sensors.
public readonly serviceProfile: string;
- Type: string
Service profile ID for LHT65 sensors.
Creates an IoT Wireless Rule.
It decodes the encoded Payload from Dragino Sensors and republishes it to a topic.
import { MiromicoInsightPayloadDecoderRule } from '@cloudxs/cdk-iot-wireless'
new MiromicoInsightPayloadDecoderRule(scope: Construct, id: string, props: IMiromicoInsightPayloadDecoderRuleProps)
Name | Type | Description |
---|---|---|
scope |
constructs.Construct |
No description. |
id |
string |
No description. |
props |
IMiromicoInsightPayloadDecoderRuleProps |
No description. |
- Type: constructs.Construct
- Type: string
Name | Description |
---|---|
toString |
Returns a string representation of this construct. |
public toString(): string
Returns a string representation of this construct.
Name | Description |
---|---|
isConstruct |
Checks if x is a construct. |
import { MiromicoInsightPayloadDecoderRule } from '@cloudxs/cdk-iot-wireless'
MiromicoInsightPayloadDecoderRule.isConstruct(x: any)
Checks if x
is a construct.
- Type: any
Any object.
Name | Type | Description |
---|---|---|
node |
constructs.Node |
The tree node. |
ruleName |
string |
returns the IoT rule name, which can be used as a topic to send encoded sensor data to. |
public readonly node: Node;
- Type: constructs.Node
The tree node.
public readonly ruleName: string;
- Type: string
returns the IoT rule name, which can be used as a topic to send encoded sensor data to.
Creates a device and a service profile for Miromico Insight Sensors.
import { MiromicoInsightProfiles } from '@cloudxs/cdk-iot-wireless'
new MiromicoInsightProfiles(scope: Construct, id: string, props?: IAWSIotProfiles)
Name | Type | Description |
---|---|---|
scope |
constructs.Construct |
No description. |
id |
string |
No description. |
props |
IAWSIotProfiles |
No description. |
- Type: constructs.Construct
- Type: string
- Type: IAWSIotProfiles
Name | Description |
---|---|
toString |
Returns a string representation of this construct. |
public toString(): string
Returns a string representation of this construct.
Name | Description |
---|---|
isConstruct |
Checks if x is a construct. |
import { MiromicoInsightProfiles } from '@cloudxs/cdk-iot-wireless'
MiromicoInsightProfiles.isConstruct(x: any)
Checks if x
is a construct.
- Type: any
Any object.
Name | Type | Description |
---|---|---|
node |
constructs.Node |
The tree node. |
deviceProfile |
string |
Device profile ID for MiromicoInsight. |
serviceProfile |
string |
Service profile ID for MiromicoInsight. |
public readonly node: Node;
- Type: constructs.Node
The tree node.
public readonly deviceProfile: string;
- Type: string
Device profile ID for MiromicoInsight.
public readonly serviceProfile: string;
- Type: string
Service profile ID for MiromicoInsight.
- Implemented By: IAWSIotProfiles
Properties for AWS Iot Profiles.
Name | Type | Description |
---|---|---|
dpProfileName |
string |
The name of the device profile. |
macVersion |
string |
MAC version. |
maxEirp |
number |
MaxEIRP. |
regParamsRevision |
string |
Regional parameters version. |
rfRegion |
string |
The frequency band (RFRegion) value. |
spAddGWMetaData |
boolean |
Service profile - Add additional gateway metadata (RSSI, SNR, GW geoloc., etc.) to the packets sent by devices. |
spProfileName |
string |
Service profile name. |
supportsJoin |
boolean |
Supports Join. |
public readonly dpProfileName: string;
- Type: string
The name of the device profile.
public readonly macVersion: string;
- Type: string
- Default: '1.0.3'
MAC version.
public readonly maxEirp: number;
- Type: number
- Default: 15
MaxEIRP.
public readonly regParamsRevision: string;
- Type: string
- Default: 'RP002-1.0.1'
Regional parameters version.
public readonly rfRegion: string;
- Type: string
- Default: 'EU868'
The frequency band (RFRegion) value.
public readonly spAddGWMetaData: boolean;
- Type: boolean
- Default: true
Service profile - Add additional gateway metadata (RSSI, SNR, GW geoloc., etc.) to the packets sent by devices.
public readonly spProfileName: string;
- Type: string
- Default: none
Service profile name.
public readonly supportsJoin: boolean;
- Type: boolean
- Default: true
Supports Join.
Choose to enter the values for Join support (OTAA) or not (ABP).
- Implemented By: IGatewayProps
Properties for a Gateway.
Name | Type | Description |
---|---|---|
gatewayEui |
string |
Gateway EUI. |
description |
string |
Gateway description. |
rfRegion |
string |
The frequency band (RFRegion) value. |
public readonly gatewayEui: string;
- Type: string
Gateway EUI.
public readonly description: string;
- Type: string
Gateway description.
public readonly rfRegion: string;
- Type: string
- Default: 'EU868'
The frequency band (RFRegion) value.
- Implemented By: ILHT65PayloadDecoderRuleProps
Properties for a PayloadDecoderTopic.
Name | Type | Description |
---|---|---|
republishTopic |
string |
Republish topic. |
public readonly republishTopic: string;
- Type: string
- Default: 'republish/${topic()}'
Republish topic.
The encoded message will be republished to this MQTT topic. For a correct permission granting, please make sure that the first level does not contain a Substitution Template.
- Implemented By: IMiromicoInsightPayloadDecoderRuleProps
Properties for a PayloadDecoderTopic.
Name | Type | Description |
---|---|---|
republishTopic |
string |
Republish topic. |
public readonly republishTopic: string;
- Type: string
- Default: 'republish/${topic()}'
Republish topic.
The encoded message will be republished to this MQTT topic. For a correct permission granting, please make sure that the first level does not contain a Substitution Template.