{"id":79122,"date":"2024-01-03T18:46:08","date_gmt":"2024-01-03T10:46:08","guid":{"rendered":"https:\/\/www.techphant.cn\/?p=79122"},"modified":"2024-01-03T18:46:08","modified_gmt":"2024-01-03T10:46:08","slug":"srljmfwqdl","status":"publish","type":"post","link":"https:\/\/www.techphant.cn\/blog\/79122.html","title":{"rendered":"\u6df1\u5165\u7406\u89e3MQTT\u670d\u52a1\u5668\u767b\u5f55"},"content":{"rendered":"
MQTT\uff08Message Queuing Telemetry Transport\uff09\u662f\u4e00\u79cd\u8f7b\u91cf\u7ea7\u7684\u6d88\u606f\u4f20\u8f93\u534f\u8bae\uff0c\u5e7f\u6cdb\u5e94\u7528\u4e8e\u7269\u8054\u7f51\u8bbe\u5907\u95f4\u7684\u901a\u4fe1\u3002\u800cMQTT\u670d\u52a1\u5668\u767b\u5f55\u5219\u662f\u4f7f\u7528\u8be5\u534f\u8bae\u8fdb\u884c\u8fde\u63a5\u548c\u8ba4\u8bc1\u7684\u8fc7\u7a0b\u3002\u672c\u6587\u5c06\u4eceMQTT\u670d\u52a1\u5668\u767b\u5f55\u7684\u539f\u7406\u3001\u6d41\u7a0b\u4ee5\u53ca\u5b89\u5168\u6027\u89d2\u5ea6\u8fdb\u884c\u6df1\u5165\u63a2\u8ba8\u3002<\/p>\n
MQTT\u534f\u8bae\u662f\u57fa\u4e8e\u53d1\u5e03\/\u8ba2\u9605\u6a21\u5f0f\u7684\u901a\u4fe1\u534f\u8bae\uff0c\u5b83\u5141\u8bb8\u5ba2\u6237\u7aef\u8ba2\u9605\u4e00\u4e2a\u7279\u5b9a\u4e3b\u9898\uff0c\u5e76\u5728\u8be5\u4e3b\u9898\u6709\u6d88\u606f\u53d1\u5e03\u65f6\u63a5\u6536\u5230\u901a\u77e5\u3002\u8fd9\u79cd\u6a21\u5f0f\u4f7f\u5f97\u8bbe\u5907\u95f4\u7684\u901a\u4fe1\u53d8\u5f97\u7b80\u5355\u9ad8\u6548\uff0c\u7279\u522b\u9002\u7528\u4e8e\u8d44\u6e90\u53d7\u9650\u7684\u73af\u5883\uff0c\u5982\u7269\u8054\u7f51\u8bbe\u5907\u3002<\/p>\n
\u5728MQTT\u4e2d\uff0c\u5ba2\u6237\u7aef\u8981\u4e0e\u670d\u52a1\u5668\u5efa\u7acb\u8fde\u63a5\u9700\u8981\u5b8c\u6210\u4e09\u4e2a\u6b65\u9aa4\uff1a\u8fde\u63a5\u5efa\u7acb\u3001\u8eab\u4efd\u9a8c\u8bc1\u548c\u8ba2\u9605\u4e3b\u9898\u3002\u5728\u767b\u5f55\u8fc7\u7a0b\u4e2d\uff0c\u5ba2\u6237\u7aef\u5c06\u53d1\u9001\u8fde\u63a5\u8bf7\u6c42\u5e76\u643a\u5e26\u8eab\u4efd\u4fe1\u606f\uff0c\u670d\u52a1\u5668\u7aef\u6536\u5230\u8bf7\u6c42\u540e\u8fdb\u884c\u8eab\u4efd\u9a8c\u8bc1\uff0c\u9a8c\u8bc1\u901a\u8fc7\u540e\uff0c\u5ba2\u6237\u7aef\u5373\u53ef\u4e0e\u670d\u52a1\u5668\u5efa\u7acb\u53ef\u9760\u7684\u901a\u4fe1\u8fde\u63a5\u3002<\/p>\n
\u5ba2\u6237\u7aef\u901a\u8fc7TCP\u8fde\u63a5\u5411\u670d\u52a1\u5668\u53d1\u8d77\u8fde\u63a5\u8bf7\u6c42\uff0c\u8bf7\u6c42\u4e2d\u5305\u542b\u5ba2\u6237\u7aefID\u3001\u7528\u6237\u540d\u548c\u5bc6\u7801\u7b49\u4fe1\u606f\u3002\u5982\u679c\u670d\u52a1\u5668\u5141\u8bb8\u533f\u540d\u8fde\u63a5\uff0c\u5ba2\u6237\u7aefID\u53ef\u4ee5\u7701\u7565\u3002<\/p>\n
\u670d\u52a1\u5668\u6536\u5230\u8fde\u63a5\u8bf7\u6c42\u540e\uff0c\u9996\u5148\u5bf9\u5ba2\u6237\u7aef\u63d0\u4f9b\u7684\u8eab\u4efd\u4fe1\u606f\u8fdb\u884c\u9a8c\u8bc1\u3002\u9a8c\u8bc1\u901a\u8fc7\u540e\uff0c\u670d\u52a1\u5668\u4f1a\u5411\u5ba2\u6237\u7aef\u8fd4\u56de\u4e00\u4e2aCONNACK\u62a5\u6587\uff0c\u8868\u660e\u8fde\u63a5\u6210\u529f\u5efa\u7acb\u3002<\/p>\n
\u5728\u767b\u5f55\u6210\u529f\u540e\uff0c\u5ba2\u6237\u7aef\u53ef\u4ee5\u5411\u670d\u52a1\u5668\u53d1\u9001\u8ba2\u9605\u4e3b\u9898\u7684\u8bf7\u6c42\uff0c\u670d\u52a1\u5668\u6536\u5230\u8bf7\u6c42\u540e\u5c06\u5411\u5ba2\u6237\u7aef\u63a8\u9001\u4e0e\u8ba2\u9605\u4e3b\u9898\u76f8\u5173\u7684\u6d88\u606f\u3002<\/p>\n
MQTT\u652f\u6301TLS\/SSL\u8fde\u63a5\uff0c\u80fd\u591f\u5bf9\u901a\u4fe1\u6570\u636e\u8fdb\u884c\u52a0\u5bc6\u4f20\u8f93\uff0c\u786e\u4fdd\u6570\u636e\u7684\u5b89\u5168\u6027\u3002<\/p>\n
MQTT\u670d\u52a1\u5668\u652f\u6301\u7528\u6237\u540d\u5bc6\u7801\u7684\u8eab\u4efd\u8ba4\u8bc1\u65b9\u5f0f\uff0c\u5e76\u4e14\u8fd8\u80fd\u591f\u4e0e\u5176\u5b83\u8eab\u4efd\u8ba4\u8bc1\u673a\u5236\uff08\u5982OAuth\uff09\u7ed3\u5408\u4f7f\u7528\uff0c\u589e\u5f3a\u5b89\u5168\u6027\u3002<\/p>\n
\u901a\u8fc7\u5408\u7406\u914d\u7f6e\uff0cMQTT\u670d\u52a1\u5668\u53ef\u4ee5\u5b9e\u73b0\u5bf9\u4e0d\u540c\u4e3b\u9898\u7684\u8bbf\u95ee\u6743\u9650\u63a7\u5236\uff0c\u786e\u4fdd\u6570\u636e\u53ea\u80fd\u88ab\u6388\u6743\u7684\u8bbe\u5907\u8ba2\u9605\u548c\u8bbf\u95ee\u3002<\/strong><\/p>\n","protected":false},"excerpt":{"rendered":" MQTT\uff08MessageQueuingTelemetryTransport\uff09\u662f\u4e00\u79cd\u8f7b\u91cf\u7ea7\u7684\u6d88\u606f\u4f20\u8f93\u534f\u8bae\uff0c\u5e7f\u6cdb\u5e94\u7528\u4e8e\u7269\u8054\u7f51\u8bbe\u5907\u95f4\u7684\u901a\u4fe1\u3002\u800cMQTT\u670d\u52a1\u5668\u767b\u5f55\u5219\u662f\u4f7f\u7528\u8be5<\/p>\n","protected":false},"author":1,"featured_media":64183,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"site-sidebar-layout":"default","site-content-layout":"default","ast-global-header-display":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","footnotes":""},"categories":[36],"tags":[46],"class_list":["post-79122","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-blog","tag-m"],"_links":{"self":[{"href":"https:\/\/www.techphant.cn\/wp-json\/wp\/v2\/posts\/79122","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.techphant.cn\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.techphant.cn\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.techphant.cn\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.techphant.cn\/wp-json\/wp\/v2\/comments?post=79122"}],"version-history":[{"count":0,"href":"https:\/\/www.techphant.cn\/wp-json\/wp\/v2\/posts\/79122\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.techphant.cn\/wp-json\/wp\/v2\/media\/64183"}],"wp:attachment":[{"href":"https:\/\/www.techphant.cn\/wp-json\/wp\/v2\/media?parent=79122"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.techphant.cn\/wp-json\/wp\/v2\/categories?post=79122"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.techphant.cn\/wp-json\/wp\/v2\/tags?post=79122"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}