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
1. Open MQTT Test Client
Please use this link or navigate to AWS IoT, Test and MQTT Client.
2. Subscribe to topic
Please input the topic name
dt/workshop_lorawanmessages in “Subscription topic” field and click on “Subscribe to topic”. Please ensure to use exactly the same topic name you created in Lab 6, part “Create IoT Rule”.
3. Trigger your device to send telemetry
Please consult your device’s user manual to learn how initiate a sending of a message from your LoRaWAN device.
4. Review the incoming message from your LoRaWAN device
Please find below an explanation for some of the attributes:
5. Optional: decode Base64 data into hexadecimal representation
You can run the following command in your shell to decode Base64 payload data into their hexadecimal representation.
echo -n "<Value of PayloadData>" | base64 -D | hexdump -v -e '/1 "%02x"'
echo -n "<Value of PayloadData>" | base64 -d | hexdump -v -e '/1 "%02x"'
$ echo -n "7WkoOEfwfTTioxG6CatHBw==" | base64 -D | hexdump -v -e '/1 "%02x"' ed69283847f07d34e2a311ba09ab4707
You have successfully built a private LoRaWAN network and connected your gateway and device to it.
As you see, the data from the LoRaWAN device is binary-encoded and needs to decoded (e.g. into JSON) before it can be further processed. In the next step, you will learn how to build and deploy a binary decoder in an IoT Rule, ss an example for one of possible approaches for binary decoding.