1-Integration via HTTP
TABLE OF CONTENTS
1-Integration via HTTP
Description
TagoIO is an end-to-end Internet of Things (IoT) cloud platform designed for the rapid deployment and management of IoT solutions. It supports the entire process including device connectivity, data collection, visualization, and user access management. A key feature of the platform is its “low-code” development approach, which combines drag-and-drop dashboards with customizable scripting, enabling both technical and non-technical users to quickly build IoT applications.
This document mainly describes how to connect the UG65 gateway to the TagoIO platform and view real-time data from a sensor connected to the gateway on the TagoIO platform. The sensor used in this example is the AM319 device.
Note: The AM319 device is used solely for demonstration purposes and does not imply that other sensors are unsupported. Readers should refer to the steps in this document according to their actual situation.
Requirement
- Gateway Model: UG65 (UG56, UG67 also supported)
Sensor Model: AM319
Gateway: Must already be connected to the Internet.
Configuration
Step 1: Register an Account
Visit IoT Cloud Platform | TagoIO and click the “Get Started. It's FREE” button:
Fill in the information as prompted in the pop-up interface:
For Server Region, select “United States East 1”.
After registration, click the activation link sent to your registered email to activate your account.
Step 2: First Login
Visit Admin enter your credentials, and follow the steps to create a Profile:
Once done, your personal Profile named “Milesight” will be created.
Under “Resources,” you can view the resource limits of your current Account Plan.
You may upgrade your plan as needed to fit your project requirements.
Step 3: Create a Device
Visit Admin, and under your “Milesight” profile:
Follow the steps shown below:
In the search bar, type “https”:
Then proceed as shown, and copy the token for this device, it will be needed later:
The token is typically in the format shown below.
2040aa18-b7a9-4179-94cf-a12ca6c6bed4
Note:
- The token used in this demo is shown here for reference only.
- Please do not share this token with any third party as exposing it could create a security vulnerability for your account.
The device creation is now complete.
Next, we will configure the gateway and sensor.
Step 4: Gateway Configuration
a) Enable Built-in Network Server
First, log in to your gateway management interface (refer to How to Login Web GUI of Milesight Gateway), then follow the steps shown below. (Skip this step if it’s already enabled):
As shown, if Embedded NS is Enabled and Connected, it means it has been successfully activated:
b) Add Sensor
Refer to How to Connect LoRaWAN Nodes to Milesight Gateway for detailed steps. After completion, it should look like this:
c) Create Decode Script
By default, the decoded data from the gateway is not recognized by TagoIO, so we need to modify the decode script. Follow the steps below (based on How to Use Payload Codec on Milesight Gateway):
Replace the Decode() function with the following code:
function Decode(fPort, bytes) { var output = []; var input = milesight(bytes); for (var key in input) { if (input.hasOwnProperty(key)) { output.push({ variable: key, value: input[key] }); } } return output; }
The final result should look like this:
Click “Save” to save:
Next, link the device to the decode script, as shown below:
The result should be:
d) Check Data Output
After configuring, check whether the sensor data is correctly parsed, as shown below:
Verify whether the JSON output matches the expected format.
If it is empty or in another format, the previous steps may have been misconfigured, please double-check:
e) Configure HTTP Parameters
Refer to How to Connect Milesight LoRaWAN Gateway to HTTP(s) Server?for this section.
Once done, the configuration screen should look like this:
Note:
- The Uplink data URL should be https://api.tago.io/data , do not enter it incorrectly.
- The Authorization value is the token obtained in Step 3.
At this point, the configuration of the gateway and sensor is complete. Next, return to the TagoIO platform to observe data reporting from the device.
Step 5: Observe Device Data
Follow the steps shown below:
After a short wait, you should see the following information:
This indicates that the TagoIO platform has successfully received the data.
Step 6: Create a Sample Dashboard
-END-