LORIOT Integration
Overview
LORIOT is LoRaWAN network designed for connecting your devices using LoRaWAN stack. After integrating LORIOT with the Tesenso IoT Cloud, you can connect, communicate, process and visualize data from devices in the Tesenso IoT Cloud.
Create LORIOT account
Choosing a package of services and server location. Then we register an account with LORIOT. For example, select the community public network server.
The LORIOT interface may change in the future.
Fill in the registration fields. The registration confirmation letter will be sent to the specified email. Follow the specified link.
Create Uplink Converter
Before creating the integration, you need to create an Uplink converter in Data converters. Uplink is necessary in order to convert the incoming data from the device into the required format for displaying them in Tesenso IoT Cloud. Click on the “plus” and on “Create new converter”. To view the events, enable Debug. In the function decoder field, specify a script to parse and transform data.
NOTE Although the Debug mode is very useful for development and troubleshooting, leaving it enabled in production mode may tremendously increase the disk space, used by the database, because all the debugging data is stored there. It is highly recommended to turn the Debug mode off when done debugging.
Let’s review sample uplink message from LORIOT:
As you can see the unique device id arrives in the “EUI” field. We will use it as a device name in Tesenso IoT Cloud. Device data is encoded in the “data” field. The encoded data here is:
Let’s convert them into temperature and humidity values.
2A is the value for temperature. In decoded form it will be 42
3F is the value for humidity. In decoded form it will be 63
In the converter it will be indicated like this:
Example for the Uplink converter:
You can change the decoder function while creating the converter or after creating it. If the converter has already been created, then click on the “pencil” icon to edit it. Copy the configuration example for the converter (or your own configuration) and insert it into the decoder function. Save changes by clicking on the “checkmark” icon
Create Integration
Now that the Uplink converter has been created, it is possible to create an integration
In order for data to be transferred from LORIOT to Tesenso IoT Cloud, you need to configure an Output for your LORIOT application. You can do this manually (recommended) or Tesenso IoT Cloud Integration can do this for you (you will need to specify login and password from your LORIOT account for us to be able to automatically provision the output). Configuration the Output options
We can create Output with LORIOT or in integration by enabling the Create Loriot Application output option or specifying the “Basic” credential. LORIOT Account RecommendedBasic Credential
Then we select HTTP Push and specify the target, which is taken from the integration. |
Enable security option
If necessary, you can specify additional parameters, without which the data will not be included in the integration. To do this, check the Enable security checkbox and click on the Headers filter. Specify an arbitrary value and save the changes.
Also need to specify this in LORIOT:
Once the Headers filter has been configured, it will also need to be specified in the uplink message as follows. Replace $VALUE with corresponding value.
Send test Uplink message
It may be useful to “emulate” the message from device using console instead of the LORIOT server. To send an uplink message, you need a HTTP endpoint URL from the integration, port and EUI from LORIOT.
Let`s go to the Integrations tab in Tesenso IoT Cloud. Find your LORIOT integration and click on it. There you can find the HTTP endpoint URL. Click on the icon to copy the url
A port can be from 1 to 223. EUI is device EUI and is taken from the device in LORIOT.
Use this command to send message. Replace $YOUR_EUI_DEVICE and $YOUR_HTTP_ENDPOINT_URL with corresponding values.
With the enable security option: replace $YOUR_EUI_DEVICE, $YOUR_HTTP_ENDPOINT_URL and $VALUE with corresponding values.
The created device with data can be seen in the section Device groups -> Al
Received data can be viewed in the Uplink converter. In the “In” and “Out” blocks of the Events tab.
Use the Dashboards to work with data. Dashboards are a modern format for collecting and visualizing data sets. Visibility of data presentation is achieved through a variety of widgets.
How to work with dashboards read here
Advanced Usage: Create Downlink Converter
Create Downlink in Data converters. To see events - enable Debug
You can customize the downlink according to your configuration. Let’s consider an example where we send an attribute update message. So we should change code in the downlink encoder function under line //downlink data input
Also, indicate the required parameters in the metadata:
Example for downlink converter:
where EUI is device EUI and is taken from the device in LORIOT. A port can be from 1 to 22
Add a converter to the integration. You can do this at the stage of creating an integration or editing it.
To send Downlink, enable the Send downlink option in the integration. Once we enable the “Send downlink” option, specify the Server, Application ID, Application Access Token in the fields
To get this data - go to your account in LORIOT.
Data to fill in the Server field = tesenso.loriot.io
Data to fill in the Application ID field
After that, go to Application and go to the Access Tokens section. Find the token that will be specified in the integration.
Last updated