1.MQTT description:
MQTT (Message Queuing Telemetry Transport, Message Queuing Telemetry Transport Protocol), except as one of the most commonly used Modbus protocol, because based publish / subscribe model, with less consumption of resources, high efficiency advantages, so widely within the industry use.
2.MQTT application principle:
As shown in FIG. MQTT application principle, Modbus protocol with the host computer (e.g., PLC), Ma Bai industrial wireless access to the gateway through the serial port (RS485) BMG500-A, the gateway up the collected data into Modbus JSON format data, and then uploaded to the cloud platform by MQTT.
3. Bai Ma industrial wireless presentation gateway
Bai Ma industrial wireless gateways, CE, EMC certification four, MQTT protocol support, network coverage 5G / 4G / 3G. Harsh environments applicable patents, VPN patents. Widely used in remote monitoring, remote control and other fields.
Two, MQTT specific application environment to build and configure
According to the above MQTT figure shows the practical application of the principle, to set up a simulated environmental testing to verify MQTT function, you need the following corresponding software and hardware:
◆ software Modbus Slave, used to simulate the lower machine (such as PLC, meters, etc.);
◆ Bai Ma industrial wireless gateways BMG500 (or BMG520) a;
◆ to apache-apollo as an auxiliary tool, respectively, to build client and server, release simulated data / subscribe.
1, Modbus Slave Set
1) Open Modbus slave software, create a Modbus device
2) serial link
Set serial port information
Set Modbus device parameters
3) Set Modbus device number, function code and register address, the number of registers
2, industrial wireless gateways set MQTT
3, publish and subscribe
To apache-apollo as an auxiliary tool, respectively, to build client and server, and then open the two clients, as the publisher clients with subscription
1, apache-apollo tools to download, install here are not described in detail, you can participate online information: https: //www.cnblogs.com/huhongy/p/7929299.html
2, MQTT client configuration
Run software paho.exe, click on the "+", two new clients, as a release, as a subscription
1) The client establishes a connection, and post messages
2) The client establishes a connection, subscription news