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.
1. What is JSON
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
- 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.
- In the server configuration interface, select the JSON configuration parameters, as shown in the red box in the following figure:
- 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.
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
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.