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, 17 added, 0 removed)
- image-20220531140054-8.png
- image-20220531140120-9.png
- image-20220531140154-10.png
- image-20220531140248-11.png
- image-20220531140304-12.png
- image-20220531140326-13.png
- image-20220531140425-14.png
- image-20220531140458-15.png
- image-20220531140538-16.png
- image-20220531140611-17.png
- image-20220531140651-18.png
- image-20220531140811-19.png
- image-20220531140842-20.png
- image-20220531140915-21.png
- image-20220531140955-22.png
- image-20220531141026-23.png
- image-20220531141150-24.png
Details
- Page properties
-
- Content
-
... ... @@ -73,7 +73,6 @@ 73 73 1. [[DHTlib>>url:https://github.com/goodcheney/Lora/blob/patch-1/Lora%20Shield/Examples/DHTlib.zip]] 74 74 75 75 76 - 77 77 == 4.3 Server(For example) == 78 78 79 79 * [[ThingSpeak>>url:https://thingspeak.com/]] ... ... @@ -83,14 +83,20 @@ 83 83 84 84 * Need this keys: 85 85 86 -1. [[ ~[~[image:https://wiki.dragino.com/images/thumb/b/bc/Server1.png/400px-Server1.png~|~|height="185" width="400"~]~]>>url:https://wiki.dragino.com/index.php/File:Server1.png]](((85 +1. [[image:image-20220531140054-8.png]]((( 87 87 Channel ID,Write API Key 87 + 88 + 89 + 88 88 ))) 89 -1. [[ ~[~[image:https://wiki.dragino.com/images/thumb/e/e2/Server2.png/400px-Server2.png~|~|height="128" width="400"~]~]>>url:https://wiki.dragino.com/index.php/File:Server2.png]](((91 +1. [[image:image-20220531140326-13.png]]((( 90 90 Account->My Profile,MQTT API Key 93 + 94 + 95 + 91 91 ))) 92 92 1. ((( 93 -[[ ~[~[image:https://wiki.dragino.com/images/thumb/f/f3/IOT_Configure1.png/400px-IOT_Configure1.png~|~|alt="IOT Configure1.png" height="132" width="400"~]~]>>url:https://wiki.dragino.com/index.php/File:IOT_Configure1.png]]98 +[[image:image-20220531140304-12.png]] 94 94 ))) 95 95 96 96 ... ... @@ -98,62 +98,84 @@ 98 98 99 99 Tips:Please confirm that your LG01 version is 4.3.3. 100 100 101 -[[ ~[~[image:https://wiki.dragino.com/images/thumb/e/eb/LG01_Version.png/400px-LG01_Version.png~|~|height="219" width="400"~]~]>>url:https://wiki.dragino.com/index.php/File:LG01_Version.png]]106 +[[image:image-20220531140248-11.png]] 102 102 103 -Overview 108 +**Overview** 104 104 105 -[[~[~[image:https://wiki.dragino.com/images/thumb/f/f6/MQTT_LG01_Configure_1.png/400px-MQTT_LG01_Configure_1.png~|~|height="281" width="400"~]~]>>url:https://wiki.dragino.com/index.php/File:MQTT_LG01_Configure_1.png]] 106 106 107 -Senosor->IOT Server 108 108 109 -[[ ~[~[image:https://wiki.dragino.com/images/thumb/6/64/MQTT_LG01_Configure_2.png/400px-MQTT_LG01_Configure_2.png~|~|height="152" width="400"~]~]>>url:https://wiki.dragino.com/index.php/File:MQTT_LG01_Configure_2.png]]112 +[[image:image-20220531140425-14.png]] 110 110 111 - MQTT->Configure MQTTServer114 +**Senosor->IOT Server** 112 112 113 -[[~[~[image:https://wiki.dragino.com/images/thumb/6/6a/MQTT_LG01_Configure_3.png/400px-MQTT_LG01_Configure_3.png~|~|height="91" width="400"~]~]>>url:https://wiki.dragino.com/index.php/File:MQTT_LG01_Configure_3.png]] 114 114 115 - MQTT->MQTT Channel117 +[[image:image-20220531140458-15.png]] 116 116 117 - [[~[~[image:https://wiki.dragino.com/images/thumb/3/36/MQTT_LG01_Configure_4.png/400px-MQTT_LG01_Configure_4.png~|~|height="257"width="400"~]~]>>url:https://wiki.dragino.com/index.php/File:MQTT_LG01_Configure_4.png]]119 +**MQTT->Configure MQTT Server** 118 118 119 -Sensor->LoRa/LoraWAN 120 120 121 -[[~[~[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]] 122 122 123 - Configurenetworkaccess.Network->Internet Access123 +[[image:image-20220531140538-16.png]] 124 124 125 +**MQTT->MQTT Channel** 125 125 127 + 128 + 129 +[[image:image-20220531140611-17.png]] 130 + 131 +**Sensor->LoRa/LoraWAN** 132 + 133 + 134 + 135 +[[image:image-20220531140651-18.png]] 136 + 137 +Configure network access.**Network->Internet Access** 138 + 139 + 126 126 == 4.6 Try MQTT API call with LG01 Linux command == 127 127 128 128 === 4.6.1 Input the command at the console === 129 129 130 -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]](((144 +1. [[image:image-20220531140811-19.png]]((( 131 131 Open this Application. 146 + 147 + 132 132 ))) 133 -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]](((149 +1. [[image:image-20220531140842-20.png]]((( 134 134 Input passward(dragino).After into the console. 151 + 152 + 135 135 ))) 136 -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]](((154 +1. [[image:image-20220531140915-21.png]]((( 137 137 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 + 138 138 ))) 139 -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]]((( 140 140 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 + 141 141 ))) 142 -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]]((( 143 143 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. 144 144 ))) 145 145 146 146 * This command: 147 147 148 -{{{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" 149 -}}} 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 +))) 150 150 151 151 * Need replace: 152 152 153 -{{{UZ4NGHKJMKS9WR5E //MQTT API 154 -399171 //Channel ID 155 -A4NNF6G8G63JOIUV //Write API Key 156 -}}} 178 +(% class="box infomessage" %) 179 +((( 180 +**UZ4NGHKJMKS9WR5E ~/~/MQTT API 181 +399171 ~/~/Channel ID 182 +A4NNF6G8G63JOIUV ~/~/Write API Key** 183 +))) 157 157 158 158 159 159 === 4.6.2 Input the command at the console(LG01 new version:4.3.4) ===
- image-20220531140054-8.png
-
- Author
-
... ... @@ -1,0 +1,1 @@ 1 +XWiki.Xiaoling - Size
-
... ... @@ -1,0 +1,1 @@ 1 +78.9 KB - Content
- image-20220531140120-9.png
-
- Author
-
... ... @@ -1,0 +1,1 @@ 1 +XWiki.Xiaoling - Size
-
... ... @@ -1,0 +1,1 @@ 1 +33.5 KB - Content
- image-20220531140154-10.png
-
- Author
-
... ... @@ -1,0 +1,1 @@ 1 +XWiki.Xiaoling - Size
-
... ... @@ -1,0 +1,1 @@ 1 +16.3 KB - Content
- image-20220531140248-11.png
-
- Author
-
... ... @@ -1,0 +1,1 @@ 1 +XWiki.Xiaoling - Size
-
... ... @@ -1,0 +1,1 @@ 1 +20.3 KB - Content
- image-20220531140304-12.png
-
- Author
-
... ... @@ -1,0 +1,1 @@ 1 +XWiki.Xiaoling - Size
-
... ... @@ -1,0 +1,1 @@ 1 +16.4 KB - Content
- image-20220531140326-13.png
-
- Author
-
... ... @@ -1,0 +1,1 @@ 1 +XWiki.Xiaoling - Size
-
... ... @@ -1,0 +1,1 @@ 1 +33.4 KB - Content
- image-20220531140425-14.png
-
- Author
-
... ... @@ -1,0 +1,1 @@ 1 +XWiki.Xiaoling - Size
-
... ... @@ -1,0 +1,1 @@ 1 +33.4 KB - Content
- image-20220531140458-15.png
-
- Author
-
... ... @@ -1,0 +1,1 @@ 1 +XWiki.Xiaoling - Size
-
... ... @@ -1,0 +1,1 @@ 1 +32.8 KB - Content
- image-20220531140538-16.png
-
- Author
-
... ... @@ -1,0 +1,1 @@ 1 +XWiki.Xiaoling - Size
-
... ... @@ -1,0 +1,1 @@ 1 +35.1 KB - Content
- image-20220531140611-17.png
-
- Author
-
... ... @@ -1,0 +1,1 @@ 1 +XWiki.Xiaoling - Size
-
... ... @@ -1,0 +1,1 @@ 1 +96.6 KB - Content
- image-20220531140651-18.png
-
- Author
-
... ... @@ -1,0 +1,1 @@ 1 +XWiki.Xiaoling - Size
-
... ... @@ -1,0 +1,1 @@ 1 +35.0 KB - Content
- image-20220531140811-19.png
-
- Author
-
... ... @@ -1,0 +1,1 @@ 1 +XWiki.Xiaoling - Size
-
... ... @@ -1,0 +1,1 @@ 1 +14.5 KB - Content
- image-20220531140842-20.png
-
- Author
-
... ... @@ -1,0 +1,1 @@ 1 +XWiki.Xiaoling - Size
-
... ... @@ -1,0 +1,1 @@ 1 +21.4 KB - Content
- image-20220531140915-21.png
-
- Author
-
... ... @@ -1,0 +1,1 @@ 1 +XWiki.Xiaoling - Size
-
... ... @@ -1,0 +1,1 @@ 1 +29.9 KB - Content
- 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
- image-20220531141150-24.png
-
- Author
-
... ... @@ -1,0 +1,1 @@ 1 +XWiki.Xiaoling - Size
-
... ... @@ -1,0 +1,1 @@ 1 +14.6 KB - Content