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, 5 added, 0 removed)
Details
- Page properties
-
- Content
-
... ... @@ -5,11 +5,9 @@ 5 5 6 6 = 1. What is MQTT API? = 7 7 8 -{{{MQTT is a publish/subscribe model that runs over TCP/IP sockets or WebSockets. MQTT over WebSockets can be secured with SSL. 8 +{{{MQTT is a publish/subscribe model that runs over TCP/IP sockets or WebSockets. MQTT over WebSockets can be secured with SSL.}}} 9 9 10 -}}} 11 11 12 - 13 13 = 2. MQTT Features = 14 14 15 15 The MQTT protocol runs on TCP / IP or other network protocols and provides an ordered, lossless, bidirectional connection. Features include: ... ... @@ -27,20 +27,24 @@ 27 27 28 28 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. 29 29 30 -[[ ~[~[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]] 31 31 32 32 Message Queuing Telemetry Transport 33 33 34 -[[~[~[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]] 35 35 33 +[[image:image-20220531135449-2.png]] 34 + 36 36 working principle 37 37 38 -[[~[~[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]] 39 39 38 +[[image:image-20220531135521-3.png]] 39 + 40 40 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. 41 41 42 -[[~[~[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]] 43 43 43 + 44 +[[image:image-20220531135607-4.png]] 45 + 44 44 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. 45 45 46 46 MQTT agreement to achieve the need: client and server There are three identities in the MQTT protocol: Publish, Broker (server), Subscribe. Among them, the publisher and the subscriber of the message are all clients, the broker is the server, and the publisher can be both the subscriber and the subscriber. MQTT transmission of information is divided into: Topic and payload in two parts Topic, can be understood as the type of message subscribers Subscribe, you will receive the theme of the message content (payload) The payload, which can be understood as the content of the message, refers to the specific content to be used by the subscribers.
- 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
- image-20220531135650-5.png
-
- Author
-
... ... @@ -1,0 +1,1 @@ 1 +XWiki.Xiaoling - Size
-
... ... @@ -1,0 +1,1 @@ 1 +219.8 KB - Content