{"id":4363,"date":"2023-05-25T21:12:57","date_gmt":"2023-05-25T13:12:57","guid":{"rendered":"\/?p=4363"},"modified":"2023-06-12T21:13:07","modified_gmt":"2023-06-12T13:13:07","slug":"21-mqtt%e5%8d%8f%e8%ae%ae%e7%9a%84%e5%ae%9e%e8%b7%b5","status":"publish","type":"post","link":"http:\/\/xinblog.ltd\/?p=4363","title":{"rendered":"21.MQTT\u534f\u8bae\u7684\u5b9e\u8df5"},"content":{"rendered":"\n<p><\/p>\n\n\n<p>IoT,\u7269\u8054\u7f51\u7684\u534f\u8bae\u4ea4\u4e92,\u91c7\u7528\u7684\u662fMQTT\u534f\u8bae,\u56e0\u4e3a\u4ea4\u4e92\u4fe1\u606f\u5c0f,\u6240\u6709MQTT\u6d89\u53ca\u7684\u4e5f\u6781\u5176\u7684\u7cbe\u7b80,\u57fa\u672c\u4e0a\u7684\u529f\u80fd\u5c31\u662f\u53d1\u5e03\u8ba2\u9605\u4e3b\u9898\u548c\u6536\u53d1\u6d88\u606f,\u4e0d\u8fc7\u8fd8\u6709\u7740\u5fc3\u8df3\u548c\u4f1a\u8bdd\u7684\u673a\u5236<\/p>\n<p>\u5fc3\u8df3\u673a\u5236\u6765\u68c0\u6d4b\u8bbe\u5907\u662f\u5426\u65ad\u7ebf,\u4f1a\u8bdd\u673a\u5236\u5219\u4fdd\u5b58\u5728\u4e86\u670d\u52a1\u7aef,\u5c06\u590d\u6742\u5ea6\u8f6c\u79fb\u5230\u4e86\u670d\u52a1\u7aef,\u7b80\u5316\u5ba2\u6237\u7aef\u7684\u5b9e\u73b0<\/p>\n<p>MQTT\u9762\u4e34\u7684\u573a\u666f,\u5c31\u662f\u670d\u52a1\u7aef\u7684\u8981\u652f\u6301\u6d77\u91cf\u7684LoT\u8bbe\u5907\u540c\u65f6\u5728\u7ebf,\u5bf9\u4e8e\u666e\u901a\u7684\u6d88\u606f\u961f\u5217\u96c6\u7fa4,\u6570\u91cf\u5341\u5206\u5e9e\u5927<\/p>\n<p>\u5e38\u89c1\u7684\u6d88\u606f\u961f\u5217\u53ef\u4ee5\u53d8\u4e3aMQTT Server,\u5e76\u4e0d\u662f\u5f88\u597d\u7684\u652f\u6301\u6d77\u91cf\u7684\u8bbe\u5907,\u800c\u4e14\u4fdd\u5b58\u5927\u91cf\u7684\u6570\u636e\u4e5f\u4e0d\u662f\u5f88\u597d,\u5bf9\u4e8e\u5982\u6b64\u591a\u7684\u5ba2\u6237\u7aef\u548c\u4e3b\u9898\u4e5f\u4e0d\u662f\u5f88\u597d\u7684\u652f\u6301<\/p>\n<p>\u53e6\u5916\u7684MQTT Server,\u5bf9\u4e8e\u96c6\u7fa4\u7684\u652f\u6301\u5e76\u4e0d\u597d,\u96c6\u7fa4\u505a\u7684\u597d\u7684,\u5219\u662f\u5728\u6536\u8d39\u7248\u672c\u4e2d\u5f00\u653e<\/p>\n<p>\u4f46\u662f\u6211\u4eec\u53ef\u4ee5\u8003\u8651\u81ea\u5df1\u53bb\u8bbe\u8ba1\u4e00\u4e2aMQTT Server<\/p>\n<p>\u5e38\u89c1\u7684\u6d88\u606f\u961f\u5217\u96c6\u7fa4,\u53ef\u4ee5\u8003\u8651\u5982\u4e0b\u7684\u8bbe\u8ba1<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" width=\"4266\" height=\"2087\" class=\"wp-image-4364\" src=\"\/wp-content\/uploads\/2023\/06\/unnamed-file-3.png\" alt=\"\u56fe\u7247\" srcset=\"http:\/\/xinblog.ltd\/wp-content\/uploads\/2023\/06\/unnamed-file-3.png 4266w, http:\/\/xinblog.ltd\/wp-content\/uploads\/2023\/06\/unnamed-file-3-300x147.png 300w, http:\/\/xinblog.ltd\/wp-content\/uploads\/2023\/06\/unnamed-file-3-1024x501.png 1024w, http:\/\/xinblog.ltd\/wp-content\/uploads\/2023\/06\/unnamed-file-3-768x376.png 768w, http:\/\/xinblog.ltd\/wp-content\/uploads\/2023\/06\/unnamed-file-3-1536x751.png 1536w, http:\/\/xinblog.ltd\/wp-content\/uploads\/2023\/06\/unnamed-file-3-2048x1002.png 2048w\" sizes=\"(max-width: 4266px) 100vw, 4266px\" \/><\/p>\n<p>\u4ece\u5de6\u5f80\u53f3,\u63a5\u5165\u7684\u5730\u5740\u53ef\u4ee5\u662f\u4e00\u4e2a\u57df\u540d,\u6216\u8005\u662f\u4e00\u4e2a\u8d1f\u8d23\u5747\u8861\u5668,\u8d1f\u8f7d\u5747\u8861\u5668\u53ef\u4ee5\u662fF5\u8fd9\u6837\u7684\u8d1f\u8f7d\u5747\u8861\u786c\u4ef6,\u6216\u8005Nginx\u8fd9\u6837\u7684\u8f6f\u4ef6,\u53ea\u8981\u662f\u652f\u6301MQTT\u534f\u8bae\u5373\u53ef<\/p>\n<p>\u8d1f\u8d23\u5747\u8861\u5668\u540e\u9762,\u662f\u4e00\u4e2aProxy\u96c6\u7fa4,\u627f\u62c5\u4e86\u4e09\u4e2a\u4f5c\u7528,\u8d1f\u8d23\u548cIOT\u7684\u4ea4\u4e92,\u7ef4\u62a4\u5ba2\u6237\u7aef\u4f1a\u8bdd,\u5c06\u6d88\u606f\u8f6c\u53d1\u7ed9Broker<\/p>\n<p>\u6216\u8005\u76f4\u63a5\u780d\u6389Proxy,\u5c06Proxy\u548cBroker\u7684\u529f\u80fd\u96c6\u6210\u5230\u4e00\u4e2a\u8fdb\u7a0b\u4e2d<\/p>\n<p>\u524d\u7f6eProxy\u53ef\u4ee5\u89e3\u51b3\u6d77\u91cf\u7684\u8fde\u63a5,\u56e0\u4e3aBorker\u548cProxy\u8fdb\u884c\u901a\u4fe1,\u8fd9\u6837\u5bf9\u4e8eBroker\u6765\u8bf4,\u53ea\u9700\u8981\u8fde\u63a5\u4e00\u5b9a\u6570\u91cf\u7684Proxy<\/p>\n<p>\u4f46\u662fProxy\u7684\u538b\u529b\u5f88\u9ad8,\u8fd8\u9700\u8981\u4fdd\u5b58\u4f1a\u8bdd,\u6bcf\u4e2aProxy\u90fd\u53ea\u7ef4\u62a4\u8fde\u63a5\u5230\u81ea\u5df1\u7684\u5ba2\u6237\u7aef\u7684\u4f1a\u8bdd.\u4f46\u662f\u9700\u8981\u914d\u5408\u8d1f\u8f7d\u5747\u8861\u4f7f\u7528,\u5229\u7528\u8d1f\u8f7d\u5747\u8861\u5c06\u76f8\u540c\u7684\u8fde\u63a5\u8f6c\u53d1\u7ed9\u540c\u4e00\u4e2aProxyjieidan<\/p>\n<p>\u7136\u540e\u662f\u5bf9\u4e8e\u6d77\u91cf\u4e3b\u9898\u7684\u652f\u6301,\u6211\u4eec\u53ef\u4ee5\u518dProxy\u96c6\u7fa4\u540e\u9762,\u90e8\u7f72\u591a\u7ec4Broker\u5c0f\u96c6\u7fa4,\u6bcf\u4e2a\u96c6\u7fa4\u8d1f\u8d23\u90e8\u5206\u7684\u4e3b\u9898,\u8fd9\u6837\u5c31\u53ef\u4ee5\u5c06\u5206\u6563\u4e3b\u9898\u7684\u538b\u529b<\/p>","protected":false},"excerpt":{"rendered":"<p>IoT,\u7269\u8054\u7f51\u7684\u534f\u8bae\u4ea4\u4e92,\u91c7\u7528 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[35],"tags":[],"_links":{"self":[{"href":"http:\/\/xinblog.ltd\/index.php?rest_route=\/wp\/v2\/posts\/4363"}],"collection":[{"href":"http:\/\/xinblog.ltd\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/xinblog.ltd\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/xinblog.ltd\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/xinblog.ltd\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=4363"}],"version-history":[{"count":0,"href":"http:\/\/xinblog.ltd\/index.php?rest_route=\/wp\/v2\/posts\/4363\/revisions"}],"wp:attachment":[{"href":"http:\/\/xinblog.ltd\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=4363"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/xinblog.ltd\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=4363"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/xinblog.ltd\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=4363"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}