Changes for page Through MQTT to upload data
Last modified by Xiaoling on 2022/09/02 18:11
Summary
-
Page properties (1 modified, 0 added, 0 removed)
-
Attachments (0 modified, 12 added, 0 removed)
- image-20220531141515-29.png
- image-20220531141601-30.png
- image-20220531141656-31.png
- image-20220531141800-32.png
- image-20220531141842-33.png
- image-20220531141927-34.png
- image-20220531142023-35.png
- image-20220531142155-36.png
- image-20220531142342-37.png
- image-20220531142447-38.png
- image-20220531142525-39.png
- image-20220531142558-40.png
Details
- Page properties
-
- Content
-
... ... @@ -191,14 +191,27 @@ 191 191 192 192 193 193 ))) 194 -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]]((( 194 +1. ((( 195 +[[image:image-20220531141400-27.png]] 196 + 195 195 Check the settings. 198 + 199 + 200 + 196 196 ))) 197 -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]]((( 202 +1. ((( 203 +[[image:image-20220531141601-30.png]] 204 + 198 198 input this command. 206 + 207 + 208 + 199 199 ))) 200 -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]](((210 +1. [[image:image-20220531141515-29.png]]((( 201 201 Check the result. 212 + 213 + 214 + 202 202 ))) 203 203 204 204 == 4.7 Updata data to Server(Through MQTT) == ... ... @@ -211,24 +211,42 @@ 211 211 1. Sketch will write active content to /tmp/iot/status periodically (every 5 minutes).(Watchdog feature) 212 212 213 213 214 -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]](((227 +1. [[image:image-20220531141656-31.png]]((( 215 215 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 + 216 216 ))) 217 -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]](((233 +1. [[image:image-20220531141800-32.png]]((( 218 218 Open Serial monitor. 235 + 236 + 237 + 219 219 ))) 220 -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]](((239 +1. [[image:image-20220531141842-33.png]]((( 221 221 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 + 222 222 ))) 223 -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]](((245 +1. [[image:image-20220531141927-34.png]]((( 224 224 Open Serial monitor. 247 + 248 + 249 + 225 225 ))) 226 226 1. Go to IoT Server to check the result. 227 227 1. ((( 228 -[[~[~[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]] 253 +[[image:image-20220531142023-35.png]] 254 + 255 + 256 + 229 229 ))) 230 230 1. ((( 231 -[[~[~[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]] 259 +[[image:image-20220531142155-36.png]] 260 + 261 + 262 + 232 232 ))) 233 233 234 234 = 5. FAQ = ... ... @@ -239,18 +239,25 @@ 239 239 240 240 For example: for ThingSpeak, a MQTT publish command is: 241 241 242 -{{{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" 243 -}}} 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 +))) 244 244 245 245 What now we need to put in the LG01 is how to combine this command. 246 246 247 247 1. LG01 web console -> Sensor -> MQTT 248 248 1. Choose general Server 249 -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]](((282 +1. [[image:image-20220531142342-37.png]]((( 250 250 Refer to your server to fill in. 284 + 285 + 286 + 251 251 ))) 252 -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]](((288 +1. [[image:image-20220531142447-38.png]]((( 253 253 Ex:ThingSpeak Server 290 + 291 + 254 254 ))) 255 255 256 256 According to MQTT commands: mosquitto_pub, we need to put ... ... @@ -269,7 +269,7 @@ 269 269 270 270 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: 271 271 272 -[[ ~[~[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]]310 +[[image:image-20220531142525-39.png]] 273 273 274 274 MQTT Logread example 275 275
- image-20220531141515-29.png
-
- Author
-
... ... @@ -1,0 +1,1 @@ 1 +XWiki.Xiaoling - Size
-
... ... @@ -1,0 +1,1 @@ 1 +36.1 KB - Content
- image-20220531141601-30.png
-
- Author
-
... ... @@ -1,0 +1,1 @@ 1 +XWiki.Xiaoling - Size
-
... ... @@ -1,0 +1,1 @@ 1 +34.5 KB - Content
- image-20220531141656-31.png
-
- Author
-
... ... @@ -1,0 +1,1 @@ 1 +XWiki.Xiaoling - Size
-
... ... @@ -1,0 +1,1 @@ 1 +38.8 KB - Content
- image-20220531141800-32.png
-
- Author
-
... ... @@ -1,0 +1,1 @@ 1 +XWiki.Xiaoling - Size
-
... ... @@ -1,0 +1,1 @@ 1 +32.9 KB - Content
- image-20220531141842-33.png
-
- Author
-
... ... @@ -1,0 +1,1 @@ 1 +XWiki.Xiaoling - Size
-
... ... @@ -1,0 +1,1 @@ 1 +39.2 KB - Content
- image-20220531141927-34.png
-
- Author
-
... ... @@ -1,0 +1,1 @@ 1 +XWiki.Xiaoling - Size
-
... ... @@ -1,0 +1,1 @@ 1 +26.8 KB - Content
- image-20220531142023-35.png
-
- Author
-
... ... @@ -1,0 +1,1 @@ 1 +XWiki.Xiaoling - Size
-
... ... @@ -1,0 +1,1 @@ 1 +34.5 KB - Content
- image-20220531142155-36.png
-
- Author
-
... ... @@ -1,0 +1,1 @@ 1 +XWiki.Xiaoling - Size
-
... ... @@ -1,0 +1,1 @@ 1 +42.9 KB - Content
- image-20220531142342-37.png
-
- Author
-
... ... @@ -1,0 +1,1 @@ 1 +XWiki.Xiaoling - Size
-
... ... @@ -1,0 +1,1 @@ 1 +27.4 KB - Content
- image-20220531142447-38.png
-
- Author
-
... ... @@ -1,0 +1,1 @@ 1 +XWiki.Xiaoling - Size
-
... ... @@ -1,0 +1,1 @@ 1 +4.7 KB - Content
- image-20220531142525-39.png
-
- Author
-
... ... @@ -1,0 +1,1 @@ 1 +XWiki.Xiaoling - Size
-
... ... @@ -1,0 +1,1 @@ 1 +69.1 KB - Content
- image-20220531142558-40.png
-
- Author
-
... ... @@ -1,0 +1,1 @@ 1 +XWiki.Xiaoling - Size
-
... ... @@ -1,0 +1,1 @@ 1 +43.9 KB - Content