Changes for page MQTT Forward Instruction
Last modified by Kilight Cao on 2024/08/31 16:26
Summary
-
Page properties (1 modified, 0 added, 0 removed)
Details
- Page properties
-
- Content
-
... ... @@ -284,19 +284,15 @@ 284 284 ))) 285 285 286 286 287 += 4. Example to communicate to a simple MQTT server = 287 287 288 -= 4. Exampleto communicate to a simple MQTT server=289 +== 4.1 Overview == 289 289 290 - 291 -== 4.1 Overview == 292 - 293 - 294 294 This section is an example to show how to set up LG01-N to communicate with a MQTT server. The MQTT server is a simple utility set up in a local PC. Note: User can set up same server via [[this instruction>>url:http://www.steves-internet-guide.com/install-mosquitto-broker/]]. 295 295 296 296 297 -== 4.2 294 +== 4.2 Simulate via MQTT.fx utility == 298 298 299 - 300 300 The [[MQTT.fx>>url:http://mqttfx.jensd.de/index.php/download]] is a MQTT client tool. We can use this to simulate a MQTT connection to our MQTT broker first to make sure the MQTT broker works. This will also help us understand how it works. 301 301 302 302 ((( ... ... @@ -322,15 +322,14 @@ 322 322 Downstream: Subscribe a topic to get downstream 323 323 324 324 321 +== 4.3 Simulate via Dragino Command Line == 325 325 326 -== 4.3 Simulate via Dragino Command Line == 327 - 328 328 For first try of MQTT connection, simulate via command line is recommend, there are many servers / connection type for MQTT. They are using different connection parameters. Simulating the connection via command line will help us rapidly connect to server and debug. 329 329 330 330 In the Dragino Gateway, we use [[mosquitto client>>url:https://mosquitto.org/]] for MQTT connection. 331 331 332 332 333 -(% style="color:b lue" %)**For Upstream**328 +(% style="color:#4f81bd" %)**For Upstream** 334 334 335 335 command is [[mosquitto_pub>>url:https://mosquitto.org/man/mosquitto_pub-1.html]] 336 336 ... ... @@ -343,9 +343,8 @@ 343 343 mosquitto_pub 344 344 345 345 341 +(% style="color:#4f81bd" %)**For Downstream** 346 346 347 -(% style="color:blue" %)**For Downstream** 348 - 349 349 Use [[mosquitto_sub>>url:https://mosquitto.org/man/mosquitto_sub-1.html]] to subscribe the change on the topic. 350 350 351 351 [[image:image-20220527135440-10.png]]