test IoT Rule invocation

In this step we will use an MQTT Test client in the AWS management console to simulate an invocation of AWS IoT Rule, and see the outcome of binary transformation published to the MQTT topic lorawanworkshop/transformed:

Please use this link or navigate to AWS IoT, Test and MQTT Client.

1. Subscribe to topic lorawanworkshop/transformed

Please input the topic name lorawanworkshop/transformed in “Topic filter” field and click on “Subscribe”.

AWS Management Console

2. Prepare invocation of AWS IoT Rule

Please click on the “Publish to topic” tab and paste the following payload into the “Message payload” field:

    {
        "PayloadData": "<Sample PayloadData>",
        "WirelessDeviceId": "57728ff8-5d1d-4130-9de2-f004d8722bc2",
        "WirelessMetadata": {
          "LoRaWAN": {
            "DataRate": 0,
            "DevEui": "a84041d55182720b",
            "FPort": 2,
            "Frequency": 867900000,
            "Gateways": [
              {
                "GatewayEui": "dca632fffe45b3c0",
                "Rssi": -76,
                "Snr": 9.75
              }
            ],
            "Timestamp": "2020-12-07T14:41:48Z"
          }
        } 
    }

The result should look like: AWS Management Console

3. Replace a test payload

Please replace the string <Sample PayloadData> with a sample payload according to this table.

Manufacturer Device name Sample “PayloadData”
Axioma W1 eoFaXxADAAAAwKRZXwMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=
Dragino LHT65 y6QHxgG4AQhmf/8=
Dragino LSE01 AuHtlACmawQPVGM=
Dragino LGT92 DSEAAAEVCMUGpAA=
Dragino LBT1 DxwAAAIDQUJCQ0NEREVFRkYwMjcxMjFGNkFDMy0wNTk=
Browan Tabs Object Locator Ae48SPbhAgRupmA=
Other device or no device available yet Ae48SPbhAgRupmA=

The result should look like: AWS Management Console

4. Update the topic name
On the “Publish to topic” tab, please update the topic name with the following value:$aws/rules/MyWorkshopLoRaWANRuleWithDecoder_<Decoder name>

Please replace <Decoder name> with an appropriate name based on the table below, e.g. $aws/rules/MyWorkshopLoRaWANRuleWithDecoder_sample_device

Manufacturer Device name Decoder name
Axioma W1 axioma_w1
Dragino LHT65 dragino_lht65
Dragino LSE01 dragino_lse01
Dragino LGT92 dragino_lgt92
Dragino LBT1 dragino_lbt1
Browan Tabs Object Locator tabs_objectlocator
Other device or no device available yet sample_device

The result should look like: AWS Management Console

5. Invoke AWS IoT Rule
Please double-check that you have completed the following tasks:

  • a. Pasted the sample message payload into “Message payload” field
  • b. Updated the value of the attribute “PayloadData”
  • c. Updated the value of the field “Topic name”

Your console should look like this: AWS Management Console

Now please click on the “Publish” button to invoke the AWS IoT Rule “MyWorkshopLoRaWANRuleWithDecoder_sample_device” with a payload similar to the one which will be used by AWS IoT Core for LoRaWAN. You will see a new message arriving on the topic lorawanworkshop/transformed.

AWS Management Console

4. Review result of binary decoding
Please scroll down and review the TransformedPayloadData attributr of the message that was published to the topic lorawanworkshop/transformed. It contains the decoder payload in JSON:

AWS Management Console

Please keep the MQTT client open, as it will be required in the next section.