LECPServer中文 ↗Free download

MQTT service and publishing

On this page
  1. How to configure MQTT Broker
  2. How to configure MQTT Client
  3. How to configure MQTT Client nodes

After LECPServer version 1.1.07Beta, it already supports MQTT services and publishes nodes configured by LECPServer through MQTT client. LECPServer version 1.1.07Beta requires JLean 2.3.6.45 or above to support it.

LECPServer provides two MQTT support:

  1. MQTT Broker (MQTT server), which can be enabled or disabled by configuring the mqtt.conf file
  2. MQTT Client (MQTT client), through page configuration, node data can be published by LECPServer, and subscribers can receive the latest node data

How to configure MQTT Broker

Configuring MQTT Broker is very simple, just open the mqtt.conf file

	"MQTTSERVER": {
		"PORT": 1883,
		"START": false
	}

For the configuration of MQTT Broker, PORT is the port number that the Broker needs to use. If START is true, the Broker will be running, otherwise, the Broker will not be run.

Users can use the Broker that comes with LECPServer, or use a third-party Broker to publish information

How to configure MQTT Client

A new MQTT client configuration page has been added to LECPServer after version 1.1.07 BETA

mqtt_02

Click on the configuration page, and we can configure MQTT published.

  1. Click the "Device" option, the "Add Device" option to add a new MQTT device
  2. Fill in the name of the MQTT client. The name of MQTT client cannot be repeated
  3. Click "Confirm, Add", the new device is added.
  4. Configure the MQTT client, Now input the Broker's IP address and PORT, Client_ID is the client ID (optional), TOPIC is the topic name to be published, other clients can subscribe data through this topic.
  5. SCAN_RATE, is the inspection node time, the unit is ms, the default is 1000ms, each inspection, triggers the release of device node data
  6. After configuring, click the "Apply" button to connect to the Broker

mqtt_03

mqtt_04

mqtt_05


How to configure MQTT Client nodes

Next, we can configure the node to let the MQTT Client realize information publishing

  1. Click the "Add" button in the node configuration
  2. Select the node to be added, and click "Apply" after the selection is complete.
  3. The nodes data will be published to the Broker at each inspection interval.

mqtt_06

mqtt_07

mqtt_08

The following figure is a demonstration of simulating the effect of MQTT publishing through HSL

mqtt_01 · Open original animation