Use JSON format to report data to industrial gateway

At present, MQTT industrial gateways are widely sought after, and the Iot industry is the mainstream of MQTT plus JSON data reporting. TG462 is an IoT data transmission device that supports MQTT, edge computing and other powerful functions in one. It can use JSON, 212 and other data formats to report the collected data to the cloud platform to help customers effectively and quickly The front-end manages and obtains data. This article uses the JSON data format as an example to introduce the configuration of each corresponding parameter when the CSG TG462 reports in the JSON mode.

TG462-Edge-Gateways

1. What is JSON

JSON (JavaScript Object Notation) is a lightweight data exchange format. Easy to read and write. At the same time, it is easy to parse and generate by machine.

2. Why choose JSON

When we want to transmit multiple sets of IoT node attribute information, we can package and republish the data, and unpackage the data on the subscription side. The advantage of this is: determine which attribute the information we subscribe to belongs to, and prevent the information from being Wrongly attributed to other attributes to ensure the accuracy of the information. JSON provides us with a good data encoding format. The use of MQTT + JSON for IoT communication has become the main method for major IoT platforms.

3.  Setting up JSON protocol of PCCom Industrial Gateway

  1.  Connect the edge computing gateway of CTC through a network cable, enter the gateway management system (192.168.1.1), select the data collection setting column in the gateway management system, and enter the server configuration interface.
Use JSON format to report data to industrial gateway
  1. In the server configuration interface, select the JSON configuration parameters, as shown in the red box in the following figure:
  2.  Set parameters such as custom variable name, custom variable value, time stamp, equipment number, factor and factor data, equipment number, etc. in the management system.

 

JSON data

The reporting format is as follows:

JSON data format

Custom variable name: publish id, as shown above

Top definition variable value: terminal serial ID, as shown above

Ts: Timestamp

Params: parameters, use curly brackets to include device number, factor and factor data

DeviceNum: device number

The format of the JSON body reported by the TG462 Industrial Gateway TG462 can be flexibly adjusted according to actual needs. The collection process can also support various methods such as reporting from time to time, reporting periodically, reporting changes, and reporting alarms. At the same time, it supports powerful edge computing, which can process data at the edge to ensure data security.

Print Email

1 Comment

Leave a Reply

We use cookies to deliver you the best experience. By browsing our website you agree to our use of cookies.