IoT News
IoT Applications

BLIIoT OPC UA IoT Gateway BL110 Application 56--How to Configure MQTT Client and View/Send Command with MQTT

Views : 7732
Author : Chris wu
Update time : 2022-12-28 09:22:36

MQTT Client Configuration

The "KingPigeon" JSON data format of MQTT Client and MQTT Client II is the same as King Pigeon MQTT. Refer to:King Pigeon MQTT Data Format

Connect to the ThingsBoard platform, select the JSON data format in the "thingsboard-telemetry-gateway" format. The ThingsBoard platform domain name is thingsboard.cloud.

Connect to a platform that supports Sparkplug B, such as the ignition platform, select the JSON data format in the "sparkplug b" format, click the button next to the data template item, enter configuration box to configure the group ID and edge node ID.

The difference between MQTT Client and MQTT Client II is that the subscription topic of MQTT Client II does not work. The purpose of MQTT Client II is that the platform can view the data but cannot control the data. Therefore, MQTT Client II connection is not introduced.

The configuration of MQTT Client is as follows: Connection without certificate and the JSON data format in KingPigeon format as an example.

(1) Double-click "MQTT Client" to enter configuration box. (2) Click the Enable button to enable MQTT Client. Default: off. Gray: Disabled, Green: enabled. (3) IP/domain: fill in the IP/domain name of the MQTT server. 4) Port: Fill in the MQTT server port, Default: 1883. (5) Client ID: The client identifier used in the MQTT connection message, and the server uses the client identifier to identify the client. (6) Username: The username used in the MQTT connection message, the server can use it for authentication and authorization. (7) Password: The password used in the MQTT connection message, which can be used by the server for authentication and authorization. (8) Data template: Select according to the JSON data format supported by the MQTT server, default is "KingPigeon". (9) Subscribe topic: The topic name used by the MQTT subscription message. After subscription, the server can send a publish message to the client for control. (10) Publish topic: The topic name used by MQTT to publish the message. The topic name is used to identify which information channel the payload data should be published to. (11) Upload cycle: The interval for regular data release, default is 30S. (12) Data retransmission: whether to enable data retransmission, Gray: disabled, Green: enabled. (13) Select data point upload: select the data point to be uploaded in the box on the right side of the configuration box, the default is blank means all upload.

(14) Click "OK" to confirm the configuration of King Pigeon MQTT. (15) Click "Write Configuration", the MQTT Client will not be enabled until the gateway device restarts. Re-open the configuration software to log in to the device, and you can see on the basic information page that the prompt light of "MQTT Client Online Status" is green, indicating that the MQTT Client is connected. The rightmost shows the online status of the slave device. 

View and Send Command with MQTT.fx

Note: Client ID can not be the same the Client ID in configuration software

Message received in MQTT.fx:

Subscription Topic of MQTT.fx is the Publishing Topic configured in MQTT Client

Use MQTT.fx to publish:

Public Topic is the Subscription Topic Configured in MQTT Client

 

Related News
Read More >>