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, 2 added, 0 removed)
Details
- Page properties
-
- Content
-
... ... @@ -156,24 +156,31 @@ 156 156 157 157 158 158 ))) 159 -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]](((159 +1. [[image:image-20220531140955-22.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 + 161 161 ))) 162 -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]](((165 +1. [[image:image-20220531141026-23.png]]((( 163 163 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. 164 164 ))) 165 165 166 166 * This command: 167 167 168 -{{{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" 169 -}}} 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 +))) 170 170 171 171 * Need replace: 172 172 173 -{{{UZ4NGHKJMKS9WR5E //MQTT API 174 -399171 //Channel ID 175 -A4NNF6G8G63JOIUV //Write API Key 176 -}}} 178 +(% class="box infomessage" %) 179 +((( 180 +**UZ4NGHKJMKS9WR5E ~/~/MQTT API 181 +399171 ~/~/Channel ID 182 +A4NNF6G8G63JOIUV ~/~/Write API Key** 183 +))) 177 177 178 178 179 179 === 4.6.2 Input the command at the console(LG01 new version:4.3.4) ===
- image-20220531140955-22.png
-
- Author
-
... ... @@ -1,0 +1,1 @@ 1 +XWiki.Xiaoling - Size
-
... ... @@ -1,0 +1,1 @@ 1 +36.1 KB - Content
- image-20220531141026-23.png
-
- Author
-
... ... @@ -1,0 +1,1 @@ 1 +XWiki.Xiaoling - Size
-
... ... @@ -1,0 +1,1 @@ 1 +22.8 KB - Content