当前位置:网站首页>Learning Tai Chi maker mqtt (II) basic principles of mqtt

Learning Tai Chi maker mqtt (II) basic principles of mqtt

2022-06-25 17:14:00 xuechanba

Video tutorial Links : https://www.bilibili.com/video/BV1pv411r7Cv?spm_id_from=333.999.0.0&vd_source=b91967c499b23106586d7aa35af46413

Materials tutorial link : http://www.taichi-maker.com/homepage/esp8266-nodemcu-iot/iot-tuttorial/mqtt-tutorial/2-mqtt-basics/

stay MQTT Protocol communication in progress , There are two most important roles . They are server and client respectively . First of all, let's have a preliminary understanding of them .

 Insert picture description here
 Insert picture description here
 Insert picture description here
below , Look at a scene like this .
 Insert picture description here
Some people will ask why the car does not directly send information to the mobile phone or computer ?

1、 This is because MQTT The protocol is usually applied to the Internet of things , One of the great differences between the Internet of things and the Internet is that the Internet of things is not as stable as the Internet , Maybe the Internet of things is composed of the data network of mobile phones , therefore , If the cell phone signal is bad , The network is unstable , When the network connection is unstable , If you let clients send messages directly to each other , Then the data information will be lost . therefore , It adds MQTT The server . This MQTT It is equivalent to a transfer station .

2、 Usually MQTT client ( The car in the figure above ) The loaded on is responsible for sending MQTT The computing power of the information IOT module is not very strong , Besides , In the application scenario in the above figure , Only two clients receive information about the car speed , But in practice , There may be thousands or more clients that will receive this message , therefore , under these circumstances , If you use this IOT module , It is difficult to achieve such strong computing power . So it increases MQTT The server , Its computing power is much greater than that of the IOT module of the actual client .

 Insert picture description here

It is worth noting that ,MQTT When the client communicates , Often the role is not single . It can be used as both information publisher and information subscriber .

 Insert picture description here
 Insert picture description here
 Insert picture description here

原网站

版权声明
本文为[xuechanba]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/176/202206251643435739.html