TTN - The Things Network LoRaWan
In this article, you will be instructed on how to create a LoRaWan device TTN integration with TagoIO. With this integration you are able to send data from your devices (uplink) to TagoIO and back to your devices (downlink).
TTN for Beginners
Make sure you already have configured your gateway and an application was created. If you need help to do that, take a look at this video tutorial .
Adding Integration at TTN
On the TTN console, go to your already created application, and then go to integrations and click add integration.
Select TagoIO from the integration list.
Here you fill in your Process ID, your access key and the Authorization.
The Authorization field is not required, but it adds security to your integration. Type any secret text there, and type the same text in the verification code when generating the token at TagoIO.
For your application to authenticate to TagoIO, you need to register your device at TagoIO.
Go to the Tago admin, then go to Device, add a Device, and select the type: LoRaWAN TTN.
Look for you specific device in the list, if it is not listed, you still can connect using the Custom TTN Device.
If you use the Authorization when doing the setup at the TTN, type the same secret text in the Authorization field here.
In some case you have the option 'Install Dashboard' if you want to add one default dashboard and edit it later.
When you're done, click on Create Device.
When your device sends data to TTN, a data package will be forwarded to TagoIO.
Check the device 'Payload Parser' tab to see how the information is extracted from the payload. A standard parse is added to this device, feel free to edit it in order to remove variables or do anything else.
More about Payload Parser can be found here.
To send data back to your device, just go to the device list, select the device, and go to the Configuration Parameters tab.
Here you can use two parameters for different data format.
It will send the raw payload to your device.
the payload fields value needs to be a valid JSON Object, and TagoIO will send that object to your device.
You can choose between these two data formats, or you can send both.
When your data is sent to TTN and scheduled to send to your device, your parameter will be marked as sent (Yes). To send the message again, set the switch to as not sent (No).