Last modified by Xiaoling on 2022/09/02 18:11

From version 39.3
edited by Xiaoling
on 2022/05/31 14:26
Change comment: There is no comment for this version
To version 19.1
edited by Xiaoling
on 2022/05/31 14:06
Change comment: Uploaded new attachment "image-20220531140651-18.png", version {1}

Summary

Details

Page properties
Content
... ... @@ -105,36 +105,36 @@
105 105  
106 106  [[image:image-20220531140248-11.png]]
107 107  
108 -**Overview**
108 +Overview
109 109  
110 110  
111 111  
112 112  [[image:image-20220531140425-14.png]]
113 113  
114 -**Senosor->IOT Server**
114 +Senosor->IOT Server
115 115  
116 116  
117 117  [[image:image-20220531140458-15.png]]
118 118  
119 -**MQTT->Configure MQTT Server**
119 +MQTT->Configure MQTT Server
120 120  
121 121  
122 122  
123 123  [[image:image-20220531140538-16.png]]
124 124  
125 -**MQTT->MQTT Channel**
125 +MQTT->MQTT Channel
126 126  
127 127  
128 128  
129 129  [[image:image-20220531140611-17.png]]
130 130  
131 -**Sensor->LoRa/LoraWAN**
131 +Sensor->LoRa/LoraWAN
132 132  
133 133  
134 134  
135 -[[image:image-20220531140651-18.png]]
135 +[[~[~[image:https://wiki.dragino.com/images/thumb/6/61/MQTT_LG01_Configure_5.png/400px-MQTT_LG01_Configure_5.png~|~|height="230" width="400"~]~]>>url:https://wiki.dragino.com/index.php/File:MQTT_LG01_Configure_5.png]]
136 136  
137 -Configure network access.**Network->Internet Access**
137 +Configure network access.Network->Internet Access
138 138  
139 139  
140 140  == 4.6 Try MQTT API call with LG01 Linux command ==
... ... @@ -141,77 +141,48 @@
141 141  
142 142  === 4.6.1 Input the command at the console ===
143 143  
144 -1. [[image:image-20220531140811-19.png]](((
144 +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]](((
145 145  Open this Application.
146 -
147 -
148 148  )))
149 -1. [[image:image-20220531140842-20.png]](((
147 +1. [[~[~[image:https://wiki.dragino.com/images/thumb/d/d7/3_2.png/400px-3_2.png~|~|height="230" width="400"~]~]>>url:https://wiki.dragino.com/index.php/File:3_2.png]](((
150 150  Input passward(dragino).After into the console.
151 -
152 -
153 153  )))
154 -1. [[image:image-20220531140915-21.png]](((
150 +1. [[~[~[image:https://wiki.dragino.com/images/thumb/5/5d/3_5.png/400px-3_5.png~|~|height="310" width="400"~]~]>>url:https://wiki.dragino.com/index.php/File:3_5.png]](((
155 155  First, we need to make sure the LG01 has internet access. We can log in the SSH and ping an Internet address and see if it get through. As below
156 -
157 -
158 158  )))
159 -1. [[image:image-20220531140955-22.png]](((
153 +1. [[~[~[image:https://wiki.dragino.com/images/thumb/6/63/3_3.png/400px-3_3.png~|~|height="213" width="400"~]~]>>url:https://wiki.dragino.com/index.php/File:3_3.png]](((
160 160  LG01 has built-in Linux tool mosquitto. It is a very powerful tool for http communication. We can use this tool to handle MQTT API call in LG01. Input this command and replace your keys.
161 -
162 -
163 -
164 164  )))
165 -1. [[image:image-20220531141026-23.png]](((
156 +1. [[~[~[image:https://wiki.dragino.com/images/thumb/3/35/3_4.png/500px-3_4.png~|~|height="180" width="500"~]~]>>url:https://wiki.dragino.com/index.php/File:3_4.png]](((
166 166  Go to Server check out result.We success to use LG01 to uplink data to ThingSpeak,the mosquitto_pub command is executed in the Linux side, finally, we will have to call mosquitto_pub command with sensor data variable in Arduino side. This is through the process class in Arduino and we will show it in the final sketch.
167 167  )))
168 168  
169 169  * This command:
170 170  
171 -(% class="box infomessage" %)
172 -(((
173 -**mosquitto_pub -h mqtt.thingspeak.com -p 1883 -u dragino -P UZ4NGHKJMKS9WR5E  -i dragino_Client -t channels/399171/publish/A4NNF6G8G63JOIUV -m "field1=23.5&field2=57.5&status=MQTTPUBLISH"**
174 -)))
162 +{{{mosquitto_pub -h mqtt.thingspeak.com -p 1883 -u dragino -P UZ4NGHKJMKS9WR5E -i dragino_Client -t channels/399171/publish/A4NNF6G8G63JOIUV -m "field1=23.5&field2=57.5&status=MQTTPUBLISH"
163 +}}}
175 175  
176 176  * Need replace:
177 177  
178 -(% class="box infomessage" %)
179 -(((
180 -**UZ4NGHKJMKS9WR5E  ~/~/MQTT API
181 -399171            ~/~/Channel ID
182 -A4NNF6G8G63JOIUV  ~/~/Write API Key**
183 -)))
167 +{{{UZ4NGHKJMKS9WR5E //MQTT API
168 +399171 //Channel ID
169 +A4NNF6G8G63JOIUV //Write API Key
170 +}}}
184 184  
185 185  
186 186  === 4.6.2 Input the command at the console(LG01 new version:4.3.4) ===
187 187  
188 -1. [[image:image-20220531141150-24.png]](((
175 +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]](((
189 189  Open this Application.
190 -
191 -
192 -
193 193  )))
194 -1. (((
195 -[[image:image-20220531141400-27.png]]
196 -
178 +1. [[~[~[image:https://wiki.dragino.com/images/thumb/6/6e/MQTT_Command_2.png/400px-MQTT_Command_2.png~|~|height="76" width="400"~]~]>>url:https://wiki.dragino.com/index.php/File:MQTT_Command_2.png]](((
197 197  Check the settings.
198 -
199 -
200 -
201 201  )))
202 -1. (((
203 -[[image:image-20220531141601-30.png]]
204 -
181 +1. [[~[~[image:https://wiki.dragino.com/images/thumb/8/8d/MQTT_Command_1.png/400px-MQTT_Command_1.png~|~|height="343" width="400"~]~]>>url:https://wiki.dragino.com/index.php/File:MQTT_Command_1.png]](((
205 205  input this command.
206 -
207 -
208 -
209 209  )))
210 -1. [[image:image-20220531141515-29.png]](((
184 +1. [[~[~[image:https://wiki.dragino.com/images/thumb/d/de/MQTT_Command_3.png/400px-MQTT_Command_3.png~|~|height="207" width="400"~]~]>>url:https://wiki.dragino.com/index.php/File:MQTT_Command_3.png]](((
211 211  Check the result.
212 -
213 -
214 -
215 215  )))
216 216  
217 217  == 4.7 Updata data to Server(Through MQTT) ==
... ... @@ -224,42 +224,24 @@
224 224  1. Sketch will write active content to /tmp/iot/status periodically (every 5 minutes).(Watchdog feature)
225 225  
226 226  
227 -1. [[image:image-20220531141656-31.png]](((
198 +1. [[~[~[image:https://wiki.dragino.com/images/thumb/8/82/MQTT_Sketch_2.png/400px-MQTT_Sketch_2.png~|~|height="233" width="400"~]~]>>url:https://wiki.dragino.com/index.php/File:MQTT_Sketch_2.png]](((
228 228  Open the sketch [[MQTT_Simple_Server>>url:https://github.com/dragino/Arduino-Profile-Examples/tree/master/libraries/Dragino/examples/LoRa/MQTT_Simple_Server]].(Board:Dragino Yun + UNO or LG01/OLG01,Port:Network ports.)and upload.
229 -
230 -
231 -
232 232  )))
233 -1. [[image:image-20220531141800-32.png]](((
201 +1. [[~[~[image:https://wiki.dragino.com/images/thumb/7/73/MQTT_Sketch2.png/400px-MQTT_Sketch2.png~|~|height="540" width="400"~]~]>>url:https://wiki.dragino.com/index.php/File:MQTT_Sketch2.png]](((
234 234  Open Serial monitor.
235 -
236 -
237 -
238 238  )))
239 -1. [[image:image-20220531141842-33.png]](((
204 +1. [[~[~[image:https://wiki.dragino.com/images/thumb/9/98/MQTT_Sketch_1.png/400px-MQTT_Sketch_1.png~|~|height="261" width="400"~]~]>>url:https://wiki.dragino.com/index.php/File:MQTT_Sketch_1.png]](((
240 240  Open the Sketch [[MQTT_Client>>url:https://github.com/dragino/Arduino-Profile-Examples/tree/master/libraries/Dragino/examples/IoTServer/ThingSpeak/MQTT_Client]]. (Board:Arduino/Genuino Uno.Port:Serial ports.)and upload.
241 -
242 -
243 -
244 244  )))
245 -1. [[image:image-20220531141927-34.png]](((
207 +1. [[~[~[image:https://wiki.dragino.com/images/thumb/3/3d/MQTT_Sketch3.png/400px-MQTT_Sketch3.png~|~|height="371" width="400"~]~]>>url:https://wiki.dragino.com/index.php/File:MQTT_Sketch3.png]](((
246 246  Open Serial monitor.
247 -
248 -
249 -
250 250  )))
251 251  1. Go to IoT Server to check the result.
252 252  1. (((
253 -[[image:image-20220531142023-35.png]]
254 -
255 -
256 -
212 +[[~[~[image:https://wiki.dragino.com/images/thumb/4/43/MQTT_result_1.png/400px-MQTT_result_1.png~|~|alt="MQTT result 1.png" height="181" width="400"~]~]>>url:https://wiki.dragino.com/index.php/File:MQTT_result_1.png]]
257 257  )))
258 258  1. (((
259 -[[image:image-20220531142155-36.png]]
260 -
261 -
262 -
215 +[[~[~[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]]
263 263  )))
264 264  
265 265  = 5. FAQ =
... ... @@ -270,25 +270,18 @@
270 270  
271 271  For example: for ThingSpeak, a MQTT publish command is:
272 272  
273 -(% class="box infomessage" %)
274 -(((
275 -**mosquitto_pub -h mqtt.thingspeak.com -p 1883 -u dragino -P QZXTAKE88V3S7O2J  -i dragino_Client -t channels/200893/publish/B9Z0R25QNVEBKIFY -m "field1=34&field2=89&status=MQTTPUBLISH"**
276 -)))
226 +{{{mosquitto_pub -h mqtt.thingspeak.com -p 1883 -u dragino -P QZXTAKE88V3S7O2J -i dragino_Client -t channels/200893/publish/B9Z0R25QNVEBKIFY -m "field1=34&field2=89&status=MQTTPUBLISH"
227 +}}}
277 277  
278 278  What now we need to put in the LG01 is how to combine this command.
279 279  
280 280  1. LG01 web console -> Sensor -> MQTT
281 281  1. Choose general Server
282 -1. [[image:image-20220531142342-37.png]](((
233 +1. [[~[~[image:https://wiki.dragino.com/images/thumb/e/ea/MQTT_Configure1.png/600px-MQTT_Configure1.png~|~|height="367" width="600"~]~]>>url:https://wiki.dragino.com/index.php/File:MQTT_Configure1.png]](((
283 283  Refer to your server to fill in.
284 -
285 -
286 -
287 287  )))
288 -1. [[image:image-20220531142447-38.png]](((
236 +1. [[~[~[image:https://wiki.dragino.com/images/0/07/MQTT_Configure2.png~|~|height="93" width="538"~]~]>>url:https://wiki.dragino.com/index.php/File:MQTT_Configure2.png]](((
289 289  Ex:ThingSpeak Server
290 -
291 -
292 292  )))
293 293  
294 294  According to MQTT commands: mosquitto_pub, we need to put
... ... @@ -307,7 +307,7 @@
307 307  
308 308  User can also enable MQTT debug in the LG01 ~-~-> IoT Server settings and run logread in Linux console to see how the mqtt command is compose. below is an example:
309 309  
310 -[[image:image-20220531142525-39.png]]
256 +[[~[~[image:https://wiki.dragino.com/images/thumb/8/81/MQTT_Configure3.png/600px-MQTT_Configure3.png~|~|height="114" width="600"~]~]>>url:https://wiki.dragino.com/index.php/File:MQTT_Configure3.png]]
311 311  
312 312  MQTT Logread example
313 313  
... ... @@ -316,11 +316,8 @@
316 316  
317 317  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.
318 318  
319 -* [[image:image-20220531142558-40.png]](((
265 +* [[~[~[image:https://wiki.dragino.com/images/thumb/f/f2/Wathcdog.png/400px-Wathcdog.png~|~|height="184" width="400"~]~]>>url:https://wiki.dragino.com/index.php/File:Wathcdog.png]](((
320 320  Enable Sensor->Micro-Controller settings
321 -
322 -
323 -
324 324  )))
325 325  * [[~[~[image:https://wiki.dragino.com/images/thumb/8/82/MQTT_Sketch_2.png/400px-MQTT_Sketch_2.png~|~|height="233" width="400"~]~]>>url:https://wiki.dragino.com/index.php/File:MQTT_Sketch_2.png]](((
326 326  Open the sketch [[MQTT_Simple_Server>>url:https://github.com/dragino/Arduino-Profile-Examples/tree/master/libraries/Dragino/examples/LoRa/MQTT_Simple_Server]].(Board:Dragino Yun + UNO or LG01/OLG01,Port:Network ports.)and upload.
image-20220531140811-19.png
Author
... ... @@ -1,1 +1,0 @@
1 -XWiki.Xiaoling
Size
... ... @@ -1,1 +1,0 @@
1 -14.5 KB
Content
image-20220531140842-20.png
Author
... ... @@ -1,1 +1,0 @@
1 -XWiki.Xiaoling
Size
... ... @@ -1,1 +1,0 @@
1 -21.4 KB
Content
image-20220531140915-21.png
Author
... ... @@ -1,1 +1,0 @@
1 -XWiki.Xiaoling
Size
... ... @@ -1,1 +1,0 @@
1 -29.9 KB
Content
image-20220531140955-22.png
Author
... ... @@ -1,1 +1,0 @@
1 -XWiki.Xiaoling
Size
... ... @@ -1,1 +1,0 @@
1 -36.1 KB
Content
image-20220531141026-23.png
Author
... ... @@ -1,1 +1,0 @@
1 -XWiki.Xiaoling
Size
... ... @@ -1,1 +1,0 @@
1 -22.8 KB
Content
image-20220531141150-24.png
Author
... ... @@ -1,1 +1,0 @@
1 -XWiki.Xiaoling
Size
... ... @@ -1,1 +1,0 @@
1 -14.6 KB
Content
image-20220531141303-26.png
Author
... ... @@ -1,1 +1,0 @@
1 -XWiki.Xiaoling
Size
... ... @@ -1,1 +1,0 @@
1 -35.4 KB
Content
image-20220531141400-27.png
Author
... ... @@ -1,1 +1,0 @@
1 -XWiki.Xiaoling
Size
... ... @@ -1,1 +1,0 @@
1 -17.0 KB
Content
image-20220531141515-29.png
Author
... ... @@ -1,1 +1,0 @@
1 -XWiki.Xiaoling
Size
... ... @@ -1,1 +1,0 @@
1 -36.1 KB
Content
image-20220531141601-30.png
Author
... ... @@ -1,1 +1,0 @@
1 -XWiki.Xiaoling
Size
... ... @@ -1,1 +1,0 @@
1 -34.5 KB
Content
image-20220531141656-31.png
Author
... ... @@ -1,1 +1,0 @@
1 -XWiki.Xiaoling
Size
... ... @@ -1,1 +1,0 @@
1 -38.8 KB
Content
image-20220531141800-32.png
Author
... ... @@ -1,1 +1,0 @@
1 -XWiki.Xiaoling
Size
... ... @@ -1,1 +1,0 @@
1 -32.9 KB
Content
image-20220531141842-33.png
Author
... ... @@ -1,1 +1,0 @@
1 -XWiki.Xiaoling
Size
... ... @@ -1,1 +1,0 @@
1 -39.2 KB
Content
image-20220531141927-34.png
Author
... ... @@ -1,1 +1,0 @@
1 -XWiki.Xiaoling
Size
... ... @@ -1,1 +1,0 @@
1 -26.8 KB
Content
image-20220531142023-35.png
Author
... ... @@ -1,1 +1,0 @@
1 -XWiki.Xiaoling
Size
... ... @@ -1,1 +1,0 @@
1 -34.5 KB
Content
image-20220531142155-36.png
Author
... ... @@ -1,1 +1,0 @@
1 -XWiki.Xiaoling
Size
... ... @@ -1,1 +1,0 @@
1 -42.9 KB
Content
image-20220531142342-37.png
Author
... ... @@ -1,1 +1,0 @@
1 -XWiki.Xiaoling
Size
... ... @@ -1,1 +1,0 @@
1 -27.4 KB
Content
image-20220531142447-38.png
Author
... ... @@ -1,1 +1,0 @@
1 -XWiki.Xiaoling
Size
... ... @@ -1,1 +1,0 @@
1 -4.7 KB
Content
image-20220531142525-39.png
Author
... ... @@ -1,1 +1,0 @@
1 -XWiki.Xiaoling
Size
... ... @@ -1,1 +1,0 @@
1 -69.1 KB
Content
image-20220531142558-40.png
Author
... ... @@ -1,1 +1,0 @@
1 -XWiki.Xiaoling
Size
... ... @@ -1,1 +1,0 @@
1 -43.9 KB
Content