<
From version < 1.2 >
edited by Xiaoling
on 2022/05/31 13:50
To version < 5.1 >
edited by Xiaoling
on 2022/05/31 13:56
>
Change comment: Uploaded new attachment "image-20220531135607-4.png", version {1}

Summary

Details

Page properties
Content
... ... @@ -1,12 +1,13 @@
1 -
1 +{{toc/}}
2 2  
3 -= 1. What is MQTT API? =
4 4  
5 -{{{MQTT is a publish/subscribe model that runs over TCP/IP sockets or WebSockets. MQTT over WebSockets can be secured with SSL.
6 6  
7 -}}}
8 8  
6 += 1. What is MQTT API? =
9 9  
8 +{{{MQTT is a publish/subscribe model that runs over TCP/IP sockets or WebSockets. MQTT over WebSockets can be secured with SSL.}}}
9 +
10 +
10 10  = 2. MQTT Features =
11 11  
12 12  The MQTT protocol runs on TCP / IP or other network protocols and provides an ordered, lossless, bidirectional connection. Features include:
... ... @@ -24,18 +24,22 @@
24 24  
25 25  The server we use here is ThingSpeak which has an intuitive chart to show the test result for our test.The ThingSpeak IoT service now supports MQTT subscriptions to receive instant updates when [[ThingSpeak>>url:https://thingspeak.com/]] channel gets updated. The method here is general and can be used with other IoT servers for MQTT connection as well.
26 26  
27 -[[~[~[image:https://wiki.dragino.com/images/3/3d/MQTT_1.png~|~|height="68" width="260"~]~]>>url:https://wiki.dragino.com/index.php/File:MQTT_1.png]]
28 +[[image:image-20220531135402-1.png]]
28 28  
29 29  Message Queuing Telemetry Transport
30 30  
31 -[[~[~[image:https://wiki.dragino.com/images/thumb/c/cb/YuanliMQTT.png/400px-YuanliMQTT.png~|~|height="139" width="400"~]~]>>url:https://wiki.dragino.com/index.php/File:YuanliMQTT.png]]
32 32  
33 +[[image:image-20220531135449-2.png]]
34 +
33 33  working principle
34 34  
35 -[[~[~[image:https://wiki.dragino.com/images/thumb/f/f9/MQTT_2.png/400px-MQTT_2.png~|~|height="160" width="400"~]~]>>url:https://wiki.dragino.com/index.php/File:MQTT_2.png]]
36 36  
38 +[[image:image-20220531135521-3.png]]
39 +
37 37  Schematic diagram: uplink.In this section, we will try to program LG01 to uplink data to ThingSpeak. The data flow in this example.We have already tried ① and ② in the above simple LoRa example. Now we will try the step ③ first, after it work as expect, we will integrate these three steps together for a complete uplink example.
38 38  
42 +
43 +
39 39  [[~[~[image:https://wiki.dragino.com/images/thumb/d/de/MQTT_3.png/400px-MQTT_3.png~|~|height="160" width="400"~]~]>>url:https://wiki.dragino.com/index.php/File:MQTT_3.png]]
40 40  
41 41  Schematic diagram:downlink.In this section, we will try to program LG01 to fetch download data from ThingSpeak, then broadcast this data to local LoRa network. The end node will get this message and check if they need to do something. Similar with Uplink Example, we will first try to do it in PC, then do it in Linux side, and finally integrate it with LoRa.
... ... @@ -71,7 +71,7 @@
71 71  * [[ThingSpeak>>url:https://thingspeak.com/]]
72 72  
73 73  
74 -== Configure IoT Server ==
79 +== 4.4 Configure IoT Server ==
75 75  
76 76  * Need this keys:
77 77  
... ... @@ -86,7 +86,7 @@
86 86  )))
87 87  
88 88  
89 -== Configure LG01 settings ==
94 +== 4.5 Configure LG01 settings ==
90 90  
91 91  Tips:Please confirm that your LG01 version is 4.3.3.
92 92  
... ... @@ -115,9 +115,9 @@
115 115  Configure network access.Network->Internet Access
116 116  
117 117  
118 -== Try MQTT API call with LG01 Linux command ==
123 +== 4.6 Try MQTT API call with LG01 Linux command ==
119 119  
120 -=== Input the command at the console ===
125 +=== 4.6.1 Input the command at the console ===
121 121  
122 122  1. [[~[~[image:https://wiki.dragino.com/images/8/84/3_1.png~|~|height="99" width="93"~]~]>>url:https://wiki.dragino.com/index.php/File:3_1.png]](((
123 123  Open this Application.
... ... @@ -148,7 +148,7 @@
148 148  }}}
149 149  
150 150  
151 -=== Input the command at the console(LG01 new version:4.3.4) ===
156 +=== 4.6.2 Input the command at the console(LG01 new version:4.3.4) ===
152 152  
153 153  1. [[~[~[image:https://wiki.dragino.com/images/8/84/3_1.png~|~|height="99" width="93"~]~]>>url:https://wiki.dragino.com/index.php/File:3_1.png]](((
154 154  Open this Application.
... ... @@ -163,7 +163,7 @@
163 163  Check the result.
164 164  )))
165 165  
166 -== Updata data to Server(Through MQTT) ==
171 +== 4.7 Updata data to Server(Through MQTT) ==
167 167  
168 168  * This version of Sketch implements these features:
169 169  
... ... @@ -193,9 +193,9 @@
193 193  [[~[~[image:https://wiki.dragino.com/images/thumb/7/70/MQTT_result_2.png/400px-MQTT_result_2.png~|~|alt="MQTT result 2.png" height="190" width="400"~]~]>>url:https://wiki.dragino.com/index.php/File:MQTT_result_2.png]]
194 194  )))
195 195  
196 -= FAQ =
201 += 5. FAQ =
197 197  
198 -== Configure to support general mqtt server ==
203 +== 5.1 Configure to support general mqtt server ==
199 199  
200 200  First, try to run **mosquitto_pub** in Linux console to send a data to MQTT server.
201 201  
... ... @@ -236,7 +236,7 @@
236 236  MQTT Logread example
237 237  
238 238  
239 -== What is Watchdog feature? ==
244 +== 5.2 What is Watchdog feature? ==
240 240  
241 241  LG01 for 4.3.3 version,we have added watchdog feature. In order to avoid the gateway running process will get stuck. So add writing action on every times.
242 242  
image-20220531135402-1.png
Author
... ... @@ -1,0 +1,1 @@
1 +XWiki.Xiaoling
Size
... ... @@ -1,0 +1,1 @@
1 +13.1 KB
Content
image-20220531135449-2.png
Author
... ... @@ -1,0 +1,1 @@
1 +XWiki.Xiaoling
Size
... ... @@ -1,0 +1,1 @@
1 +13.5 KB
Content
image-20220531135521-3.png
Author
... ... @@ -1,0 +1,1 @@
1 +XWiki.Xiaoling
Size
... ... @@ -1,0 +1,1 @@
1 +32.7 KB
Content
image-20220531135607-4.png
Author
... ... @@ -1,0 +1,1 @@
1 +XWiki.Xiaoling
Size
... ... @@ -1,0 +1,1 @@
1 +42.4 KB
Content
Copyright ©2010-2024 Dragino Technology Co., LTD. All rights reserved
Dragino Wiki v2.0