Things MQTT gateway application and configuration testing Introduction

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:

 

MQTT application principle .png

 

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.

 

Industrial Wireless Gateway .png

 

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

 

Modbus slave software .png

 

2) serial link

 

Serial link .png

 

Set serial port information

 

Set serial port information .png

 

Set Modbus device parameters

 

Modbus device parameters .png

 

3) Set Modbus device number, function code and register address, the number of registers

 

Set Modbus devices .png

 

2, industrial wireless gateways set MQTT

 

Industrial Wireless Gateway MQTT set .png

 

Industrial Wireless Gateway MQTT set 2.png

 

Industrial Wireless Gateway MQTT set 3.png

 

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

 

MQTT client configuration .png

 

1) The client establishes a connection, and post messages

 

The client establishes a connection .png

 

2) The client establishes a connection, subscription news

 

The client establishes a connection 2.png

 

Guess you like

Origin www.cnblogs.com/biamatech77/p/11242093.html