{"id":2150,"date":"2026-05-03T18:41:50","date_gmt":"2026-05-03T10:41:50","guid":{"rendered":"https:\/\/hueil.top\/?p=2150"},"modified":"2026-05-03T18:43:56","modified_gmt":"2026-05-03T10:43:56","slug":"emqx%e4%b8%8emqtt%e5%8d%8f%e8%ae%ae%e5%ae%9e%e7%8e%b0%e7%89%a9%e8%81%94%e7%bd%91%e6%95%b0%e6%8d%ae%e4%bc%a0%e8%be%93","status":"publish","type":"post","link":"https:\/\/hueil.top\/?p=2150","title":{"rendered":"EMQX\u4e0eMQTT\u534f\u8bae\u5b9e\u73b0\u7269\u8054\u7f51\u6570\u636e\u4f20\u8f93"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">\u5728\u7269\u8054\u7f51\uff08IoT\uff09\u5f00\u53d1\u4e2d\uff0c\u6570\u636e\u7684\u9ad8\u6548\u3001\u53ef\u9760\u4f20\u8f93\u662f\u6838\u5fc3\u9700\u6c42\uff0c\u800cMQTT\u534f\u8bae\u4f5c\u4e3a\u8f7b\u91cf\u7ea7\u7269\u8054\u7f51\u901a\u4fe1\u6807\u51c6\uff0cEMQX\u4f5c\u4e3a\u9ad8\u6027\u80fdMQTT\u670d\u52a1\u5668\uff0cESP32\u4f5c\u4e3a\u9ad8\u6027\u4ef7\u6bd4\u5355\u7247\u673a\uff0c\u4e09\u8005\u7ed3\u5408\u6784\u6210\u4e86\u4e00\u5957\u4f4e\u6210\u672c\u3001\u6613\u5b9e\u73b0\u3001\u53ef\u6269\u5c55\u7684\u7269\u8054\u7f51\u57fa\u7840\u65b9\u6848\u3002\u672c\u6587\u5c06\u4ece\u7406\u8bba\u5230\u5b9e\u64cd\uff0c\u8be6\u7ec6\u8bb2\u89e3MQTT\u534f\u8bae\u3001EMQX\u670d\u52a1\u5668\u4e0eESP32\u5355\u7247\u673a\u7684\u534f\u540c\u5de5\u4f5c\u539f\u7406\uff0c\u4ee5\u53ca\u5b8c\u6574\u7684\u5b9e\u6218\u90e8\u7f72\u6d41\u7a0b\uff0c\u5e2e\u52a9\u5f00\u53d1\u8005\u5feb\u901f\u4e0a\u624b\u7269\u8054\u7f51\u6570\u636e\u4f20\u8f93\u9879\u76ee\u3002<\/p>\n\n\n\n<h1 class=\"wp-block-heading\">\u4e00\u3001\u6838\u5fc3\u7ec4\u4ef6\u89e3\u6790\uff1aESP32\u3001MQTT\u3001EMQX\u4e09\u8005\u5173\u7cfb<\/h1>\n\n\n\n<p class=\"wp-block-paragraph\">\u5728\u7269\u8054\u7f51\u67b6\u6784\u4e2d\uff0cESP32\u4f5c\u4e3a<strong>\u611f\u77e5\u5c42\u6838\u5fc3\u8bbe\u5907<\/strong>\uff0c\u8d1f\u8d23\u91c7\u96c6\u6570\u636e\uff08\u5982\u4f20\u611f\u5668\u6570\u636e\uff09\u3001\u6267\u884c\u63a7\u5236\u6307\u4ee4\uff1bMQTT\u4f5c\u4e3a<strong>\u901a\u4fe1\u534f\u8bae<\/strong>\uff0c\u8d1f\u8d23\u89c4\u8303\u8bbe\u5907\u4e0e\u670d\u52a1\u5668\u4e4b\u95f4\u7684\u6570\u636e\u4f20\u8f93\u683c\u5f0f\uff1bEMQX\u4f5c\u4e3a<strong>\u6d88\u606f\u4e2d\u95f4\u4ef6\uff08MQTT Broker\uff09<\/strong>\uff0c\u8d1f\u8d23\u63a5\u6536\u3001\u8f6c\u53d1\u3001\u5b58\u50a8\u8bbe\u5907\u4e0e\u5ba2\u6237\u7aef\u4e4b\u95f4\u7684\u6d88\u606f\uff0c\u4e09\u8005\u5404\u53f8\u5176\u804c\u3001\u534f\u540c\u5de5\u4f5c\uff0c\u6784\u6210\u201c\u8bbe\u5907-\u534f\u8bae-\u670d\u52a1\u5668\u201d\u7684\u5b8c\u6574\u901a\u4fe1\u94fe\u8def\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">1.1 ESP32\u5355\u7247\u673a\uff1a\u7269\u8054\u7f51\u7ec8\u7aef\u6838\u5fc3<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">ESP32\u662f\u4e50\u946b\u79d1\u6280\u63a8\u51fa\u7684\u9ad8\u6027\u80fd\u3001\u4f4e\u529f\u8017\u5355\u7247\u673a\uff0c\u76f8\u8f83\u4e8e\u4f20\u7edf\u5355\u7247\u673a\uff0c\u5b83\u96c6\u6210\u4e86Wi-Fi\u548c\u84dd\u72594.0\u53cc\u6a21\u901a\u4fe1\u6a21\u5757\uff0c\u65e0\u9700\u989d\u5916\u6dfb\u52a0\u65e0\u7ebf\u6a21\u5757\u5373\u53ef\u5b9e\u73b0\u7f51\u7edc\u8fde\u63a5\uff0c\u540c\u65f6\u642d\u8f7d\u53cc\u6838CPU\uff08\u5de5\u4f5c\u9891\u738780-240MHz\uff09\uff0c\u62e5\u6709\u4e30\u5bcc\u7684\u8f93\u5165\u8f93\u51fa\u5f15\u811a\uff0c\u652f\u6301\u591a\u79cd\u4f20\u611f\u5668\u3001\u6267\u884c\u5668\u7684\u8fde\u63a5\uff0c\u662f\u7269\u8054\u7f51\u7ec8\u7aef\u8bbe\u5907\u7684\u7406\u60f3\u9009\u62e9\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">ESP32\u7684\u6838\u5fc3\u4f18\u52bf\u7684\u5728\u4e8e\u5176\u5f3a\u5927\u7684\u65e0\u7ebf\u901a\u4fe1\u80fd\u529b\u548c\u7075\u6d3b\u7684\u5f00\u53d1\u652f\u6301\uff0c\u53ef\u901a\u8fc7Arduino IDE\u3001ESP-IDF\u3001MicroPython\u7b49\u591a\u79cd\u5f00\u53d1\u73af\u5883\u8fdb\u884c\u7f16\u7a0b\uff0c\u9002\u914d\u4e0d\u540c\u5f00\u53d1\u8005\u7684\u4f7f\u7528\u4e60\u60ef\uff0c\u4e14\u6210\u672c\u4f4e\u5ec9\u3001\u4f53\u79ef\u5c0f\u5de7\uff0c\u5e7f\u6cdb\u5e94\u7528\u4e8e\u667a\u80fd\u5bb6\u5c45\u3001\u73af\u5883\u76d1\u6d4b\u3001\u5de5\u4e1a\u63a7\u5236\u7b49\u573a\u666f\u3002\u622a\u81f32023\u5e74\uff0cESP32\u7cfb\u5217\u82af\u7247\u5168\u7403\u7d2f\u8ba1\u51fa\u8d27\u91cf\u5df2\u7a81\u783410\u4ebf\u7247\uff0c\u6210\u4e3a\u7269\u8054\u7f51\u7ec8\u7aef\u7684\u4e3b\u6d41\u9009\u62e9\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">1.2 MQTT\u534f\u8bae\uff1a\u8f7b\u91cf\u7ea7\u7269\u8054\u7f51\u901a\u4fe1\u6807\u51c6<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">MQTT\uff08Message Queuing Telemetry Transport\uff0c\u6d88\u606f\u961f\u5217\u9065\u6d4b\u4f20\u8f93\uff09\u662f1999\u5e74\u7531IBM\u5f00\u53d1\u7684\u4e00\u79cd\u57fa\u4e8e\u53d1\u5e03\/\u8ba2\u9605\uff08Publish\/Subscribe\uff09\u6a21\u5f0f\u7684\u8f7b\u91cf\u7ea7\u5e94\u7528\u5c42\u534f\u8bae\uff0c\u4e13\u95e8\u9488\u5bf9\u5e26\u5bbd\u53d7\u9650\u3001\u7f51\u7edc\u4e0d\u7a33\u5b9a\u3001\u529f\u8017\u654f\u611f\u7684\u7269\u8054\u7f51\u573a\u666f\u8bbe\u8ba1\uff0c\u4e5f\u662f\u76ee\u524d\u7269\u8054\u7f51\u9886\u57df\u5e94\u7528\u6700\u5e7f\u6cdb\u7684\u901a\u4fe1\u534f\u8bae\u4e4b\u4e00\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">MQTT\u534f\u8bae\u7684\u6838\u5fc3\u7279\u6027\u7684\u5982\u4e0b\uff0c\u4f7f\u5176\u5b8c\u7f8e\u9002\u914dESP32\u8fd9\u7c7b\u5d4c\u5165\u5f0f\u8bbe\u5907\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u8f7b\u91cf\u7ea7\uff1a\u534f\u8bae\u5934\u90e8\u7cbe\u7b80\uff0c\u6d88\u606f\u4f53\u79ef\u5c0f\uff0c\u5360\u7528\u5e26\u5bbd\u5c11\uff0c\u9002\u5408ESP32\u7b49\u8d44\u6e90\u6709\u9650\u7684\u8bbe\u5907\uff1b<\/li>\n\n\n\n<li>\u53d1\u5e03\/\u8ba2\u9605\u6a21\u5f0f\uff1a\u8bbe\u5907\uff08\u53d1\u5e03\u8005\uff09\u65e0\u9700\u76f4\u63a5\u4e0e\u63a5\u6536\u7aef\uff08\u8ba2\u9605\u8005\uff09\u5efa\u7acb\u8fde\u63a5\uff0c\u901a\u8fc7\u670d\u52a1\u5668\uff08Broker\uff09\u8f6c\u53d1\u6d88\u606f\uff0c\u5b9e\u73b0\u8bbe\u5907\u4e0e\u8bbe\u5907\u3001\u8bbe\u5907\u4e0e\u4e91\u7aef\u7684\u89e3\u8026\uff0c\u63d0\u5347\u7cfb\u7edf\u6269\u5c55\u6027\uff1b<\/li>\n\n\n\n<li>\u4f4e\u529f\u8017\uff1a\u652f\u6301\u5fc3\u8df3\u673a\u5236\uff08Keep-Alive\uff09\uff0c\u8bbe\u5907\u53ef\u5728\u4f11\u7720\u72b6\u6001\u4e0b\u7ef4\u6301\u8fde\u63a5\uff0c\u964d\u4f4e\u529f\u8017\uff0c\u9002\u914d\u7535\u6c60\u4f9b\u7535\u573a\u666f\uff1b<\/li>\n\n\n\n<li>\u591a\u670d\u52a1\u8d28\u91cf\uff08QoS\uff09\uff1a\u652f\u6301QoS 0\uff08\u6700\u591a\u4e00\u6b21\uff09\u3001QoS 1\uff08\u81f3\u5c11\u4e00\u6b21\uff09\u3001QoS 2\uff08\u6070\u597d\u4e00\u6b21\uff09\u4e09\u79cd\u7b49\u7ea7\uff0c\u53ef\u6839\u636e\u573a\u666f\u9009\u62e9\u4e0d\u540c\u7684\u53ef\u9760\u6027\u8981\u6c42\uff0c\u5176\u4e2dESP32\u5e38\u7528\u7684PubSubClient\u3001esp-mqtt\u5e93\u5747\u652f\u6301\u8fd9\u4e09\u79cdQoS\u7b49\u7ea7\uff1b<\/li>\n\n\n\n<li>\u8de8\u5e73\u53f0\uff1a\u652f\u6301\u591a\u79cd\u786c\u4ef6\u548c\u64cd\u4f5c\u7cfb\u7edf\uff0c\u53ef\u4e0eESP32\u3001Arduino\u3001\u6811\u8393\u6d3e\u3001\u4e91\u7aef\u670d\u52a1\u5668\u65e0\u7f1d\u5bf9\u63a5\u3002<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">\u76ee\u524dMQTT\u534f\u8bae\u5df2\u66f4\u65b0\u81f35.0\u7248\u672c\uff0c\u8fdb\u4e00\u6b65\u589e\u5f3a\u4e86\u534f\u8bae\u7684\u529f\u80fd\u6027\u548c\u53ef\u6269\u5c55\u6027\uff0c\u800cESP32\u7684esp-mqtt\u5e93\u5df2\u652f\u6301MQTT v5.0\uff0c\u53ef\u6ee1\u8db3\u66f4\u590d\u6742\u7684\u7269\u8054\u7f51\u573a\u666f\u9700\u6c42\u3002\u6839\u636eEclipse\u57fa\u91d1\u4f1a2023\u5e74\u53d1\u5e03\u7684\u62a5\u544a\uff0cMQTT\u5728\u5de5\u4e1a\u7269\u8054\u7f51\u573a\u666f\u4e2d\u7684\u91c7\u7528\u7387\u8fbe\u523068%\uff0c\u8fdc\u8d85\u5176\u4ed6\u7ade\u4e89\u534f\u8bae\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">1.3 EMQX\uff1a\u9ad8\u6027\u80fdMQTT\u670d\u52a1\u5668\uff08Broker\uff09<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">MQTT\u534f\u8bae\u7684\u5de5\u4f5c\u4f9d\u8d56\u4e8eBroker\uff08\u6d88\u606f\u670d\u52a1\u5668\uff09\uff0c\u8d1f\u8d23\u63a5\u6536\u6240\u6709\u8bbe\u5907\u53d1\u5e03\u7684\u6d88\u606f\uff0c\u518d\u8f6c\u53d1\u7ed9\u8ba2\u9605\u4e86\u5bf9\u5e94\u4e3b\u9898\uff08Topic\uff09\u7684\u8bbe\u5907\u6216\u5ba2\u6237\u7aef\u3002EMQX\u662f\u4e00\u6b3e\u5f00\u6e90\u3001\u9ad8\u6027\u80fd\u3001\u53ef\u6269\u5c55\u7684MQTT\u670d\u52a1\u5668\uff0c\u652f\u6301MQTT 3.1.1\u3001MQTT 5.0\u534f\u8bae\uff0c\u80fd\u591f\u627f\u8f7d\u767e\u4e07\u7ea7\u8bbe\u5907\u7684\u5e76\u53d1\u8fde\u63a5\uff0c\u540c\u65f6\u63d0\u4f9b\u4e30\u5bcc\u7684\u529f\u80fd\uff08\u5982\u8bbe\u5907\u7ba1\u7406\u3001\u6743\u9650\u63a7\u5236\u3001\u6570\u636e\u6301\u4e45\u5316\u3001\u89c4\u5219\u5f15\u64ce\u7b49\uff09\uff0c\u662f\u7269\u8054\u7f51\u9879\u76ee\u4e2d\u9996\u9009\u7684MQTT Broker\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">EMQX\u9488\u5bf9ESP32\u7b49\u5d4c\u5165\u5f0f\u8bbe\u5907\u8fdb\u884c\u4e86\u4f18\u5316\uff0c\u652f\u6301TCP\u3001TLS\/SSL\u3001WebSocket\u7b49\u591a\u79cd\u8fde\u63a5\u65b9\u5f0f\uff0c\u53ef\u901a\u8fc7EMQX Cloud\uff08\u4e91\u7aef\u90e8\u7f72\uff09\u6216\u672c\u5730\u90e8\u7f72\u4e24\u79cd\u65b9\u5f0f\u4f7f\u7528\uff0c\u5176\u4e2dEMQX Cloud\u63d0\u4f9bServerless\u3001\u4e13\u6709\u7248\u7b49\u591a\u79cd\u90e8\u7f72\u6a21\u5f0f\uff0c\u65e0\u9700\u642d\u5efa\u672c\u5730\u670d\u52a1\u5668\uff0c\u5373\u53ef\u5feb\u901f\u5b9e\u73b0\u8bbe\u5907\u63a5\u5165\uff0c\u964d\u4f4e\u5f00\u53d1\u95e8\u69db[3]\u3002<\/p>\n\n\n\n<h1 class=\"wp-block-heading\">\u4e8c\u3001\u6838\u5fc3\u539f\u7406\uff1a\u4e09\u8005\u534f\u540c\u5de5\u4f5c\u6d41\u7a0b<\/h1>\n\n\n\n<p class=\"wp-block-paragraph\">ESP32\u3001EMQX\u3001MQTT\u7684\u534f\u540c\u5de5\u4f5c\u6d41\u7a0b\u53ef\u7b80\u5316\u4e3a\u201c\u8bbe\u5907\u63a5\u5165-\u6d88\u606f\u53d1\u5e03-\u6d88\u606f\u8f6c\u53d1-\u6d88\u606f\u63a5\u6536\u201d\u56db\u4e2a\u6b65\u9aa4\uff0c\u5168\u7a0b\u9075\u5faaMQTT\u534f\u8bae\u89c4\u8303\uff0c\u7531EMQX\u627f\u62c5\u6d88\u606f\u4e2d\u8f6c\u6838\u5fc3\u4f5c\u7528\uff0c\u5177\u4f53\u6d41\u7a0b\u5982\u4e0b\uff1a<\/p>\n\n\n\n<ol start=\"1\" class=\"wp-block-list\">\n<li>ESP32\u8bbe\u5907\u542f\u52a8\u540e\uff0c\u901a\u8fc7Wi-Fi\u8fde\u63a5\u5230\u7f51\u7edc\uff0c\u968f\u540e\u57fa\u4e8eMQTT\u534f\u8bae\u4e0eEMQX\u670d\u52a1\u5668\u5efa\u7acb\u8fde\u63a5\uff08\u9700\u914d\u7f6eEMQX\u670d\u52a1\u5668\u5730\u5740\u3001\u7aef\u53e3\u3001\u5ba2\u6237\u7aefID\u3001\u7528\u6237\u540d\/\u5bc6\u7801\u7b49\u4fe1\u606f\uff09\uff1b\u82e5\u4f7f\u7528EMQX Cloud Serverless\u90e8\u7f72\uff0c\u9700\u901a\u8fc7TLS 8883\u7aef\u53e3\u8fde\u63a5\uff0c\u5e76\u914d\u7f6eCA\u8bc1\u4e66\u8fdb\u884c\u5b89\u5168\u6821\u9a8c[3]\u3002<\/li>\n\n\n\n<li>ESP32\u4f5c\u4e3a<strong>\u53d1\u5e03\u8005\uff08Publisher\uff09<\/strong>\uff0c\u91c7\u96c6\u4f20\u611f\u5668\u6570\u636e\uff08\u5982\u6e29\u6e7f\u5ea6\u3001\u5149\u7167\u5f3a\u5ea6\uff09\u540e\uff0c\u6309\u7167MQTT\u534f\u8bae\u683c\u5f0f\uff0c\u5c06\u6570\u636e\u53d1\u5e03\u5230\u6307\u5b9a\u7684\u4e3b\u9898\uff08Topic\uff0c\u5982\u201cesp32\/temp\u201d\uff09\uff0c\u53d1\u9001\u81f3EMQX\u670d\u52a1\u5668\uff1b\u53d1\u5e03\u6d88\u606f\u65f6\u53ef\u9009\u62e9\u4e0d\u540c\u7684QoS\u7b49\u7ea7\uff0c\u5176\u4e2dQoS 1\u548cQoS 2\u652f\u6301\u6d88\u606f\u91cd\u4f20\uff0c\u907f\u514d\u8fde\u63a5\u9519\u8bef\u5bfc\u81f4\u7684\u6570\u636e\u4e22\u5931\u3002<\/li>\n\n\n\n<li>EMQX\u670d\u52a1\u5668\u63a5\u6536ESP32\u53d1\u5e03\u7684\u6d88\u606f\u540e\uff0c\u6839\u636e\u4e3b\u9898\uff08Topic\uff09\u8fdb\u884c\u7b5b\u9009\uff0c\u5c06\u6d88\u606f\u8f6c\u53d1\u7ed9\u6240\u6709\u8ba2\u9605\u4e86\u8be5\u4e3b\u9898\u7684<strong>\u8ba2\u9605\u8005\uff08Subscriber\uff09<\/strong>\uff08\u53ef\u4ee5\u662f\u5176\u4ed6ESP32\u8bbe\u5907\u3001\u7535\u8111\u5ba2\u6237\u7aef\u3001\u624b\u673aAPP\u7b49\uff09\uff1b\u540c\u65f6EMQX\u53ef\u5bf9\u6d88\u606f\u8fdb\u884c\u6301\u4e45\u5316\u5b58\u50a8\uff0c\u907f\u514d\u8bbe\u5907\u79bb\u7ebf\u65f6\u6d88\u606f\u4e22\u5931\u3002<\/li>\n\n\n\n<li>\u8ba2\u9605\u8005\u63a5\u6536EMQX\u8f6c\u53d1\u7684\u6d88\u606f\u540e\uff0c\u89e3\u6790\u6d88\u606f\u5185\u5bb9\uff0c\u6267\u884c\u76f8\u5e94\u7684\u64cd\u4f5c\uff08\u5982\u663e\u793a\u6570\u636e\u3001\u63a7\u5236\u6267\u884c\u5668\uff09\uff1b\u82e5\u8ba2\u9605\u8005\u662fESP32\u8bbe\u5907\uff0c\u53ef\u6839\u636e\u63a5\u6536\u7684\u6307\u4ee4\u63a7\u5236LED\u3001\u7ee7\u7535\u5668\u7b49\u5916\u8bbe\u3002<\/li>\n<\/ol>\n\n\n\n<p class=\"wp-block-paragraph\">\u5173\u952e\u8bf4\u660e\uff1a\u4e3b\u9898\uff08Topic\uff09\u662fMQTT\u6d88\u606f\u7684\u6838\u5fc3\u6807\u8bc6\uff0c\u91c7\u7528\u5c42\u7ea7\u7ed3\u6784\uff08\u5982\u201cesp32\/device1\/temp\u201d\u201cesp32\/device2\/light\u201d\uff09\uff0c\u53ef\u5b9e\u73b0\u6d88\u606f\u7684\u5206\u7c7b\u8f6c\u53d1\uff0c\u786e\u4fdd\u4e0d\u540c\u8bbe\u5907\u53ea\u63a5\u6536\u81ea\u5df1\u5173\u6ce8\u7684\u6d88\u606f\uff0c\u63d0\u5347\u7cfb\u7edf\u6548\u7387\u3002EMQX\u652f\u6301\u901a\u8fc7\u8bbf\u95ee\u63a7\u5236\u5217\u8868\uff08ACL\uff09\u9650\u5236\u8bbe\u5907\u5bf9\u4e3b\u9898\u7684\u53d1\u5e03\/\u8ba2\u9605\u6743\u9650\uff0c\u4fdd\u969c\u6570\u636e\u5b89\u5168\u3002<\/p>\n\n\n\n<h1 class=\"wp-block-heading\">\u4e09\u3001\u5b9e\u6218\u90e8\u7f72\uff1aESP32\u901a\u8fc7MQTT\u8fde\u63a5EMQX\u5b9e\u73b0\u6570\u636e\u4f20\u8f93<\/h1>\n\n\n\n<p class=\"wp-block-paragraph\">\u672c\u8282\u5c06\u4ee5\u201cESP32\u91c7\u96c6\u6e29\u6e7f\u5ea6\u6570\u636e\uff0c\u901a\u8fc7MQTT\u534f\u8bae\u53d1\u9001\u81f3EMQX\u670d\u52a1\u5668\uff0c\u7535\u8111\u5ba2\u6237\u7aef\u63a5\u6536\u5e76\u663e\u793a\u6570\u636e\u201d\u4e3a\u4f8b\uff0c\u5b8c\u6210\u5b8c\u6574\u7684\u5b9e\u6218\u90e8\u7f72\uff0c\u6db5\u76d6EMQX\u670d\u52a1\u5668\u90e8\u7f72\u3001ESP32\u5f00\u53d1\u73af\u5883\u914d\u7f6e\u3001\u4ee3\u7801\u7f16\u5199\u3001\u6d4b\u8bd5\u9a8c\u8bc1\u56db\u4e2a\u73af\u8282\uff0c\u63d0\u4f9b\u4e24\u79cd\u5f00\u53d1\u65b9\u5f0f\uff08Arduino IDE\u3001MicroPython\uff09\u4f9b\u9009\u62e9\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">3.1 \u524d\u7f6e\u51c6\u5907<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u786c\u4ef6\uff1aESP32\u5f00\u53d1\u677f\uff08\u5982ESP32-WROOM-32\uff09\u3001DHT11\u6e29\u6e7f\u5ea6\u4f20\u611f\u5668\u3001\u675c\u90a6\u7ebf\u3001USB\u6570\u636e\u7ebf\uff1b<\/li>\n\n\n\n<li>\u8f6f\u4ef6\uff1aEMQX\u670d\u52a1\u5668\uff08\u672c\u5730\u90e8\u7f72\u6216EMQX Cloud\uff09\u3001Arduino IDE\uff08\u6216MicroPython\u73af\u5883\uff09\u3001MQTT\u5ba2\u6237\u7aef\uff08\u5982MQTT X\uff09\uff1b<\/li>\n\n\n\n<li>\u7f51\u7edc\uff1a\u786e\u4fddESP32\u4e0eEMQX\u670d\u52a1\u5668\u5904\u4e8e\u540c\u4e00\u7f51\u7edc\uff08\u672c\u5730\u90e8\u7f72\uff09\uff0c\u6216ESP32\u80fd\u8bbf\u95ee\u4e92\u8054\u7f51\uff08EMQX Cloud\uff09\u3002<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">3.2 \u6b65\u9aa41\uff1a\u90e8\u7f72EMQX\u670d\u52a1\u5668<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\u63a8\u8350\u4f7f\u7528EMQX Cloud Serverless\u90e8\u7f72\uff0c\u65e0\u9700\u642d\u5efa\u672c\u5730\u670d\u52a1\u5668\uff0c\u64cd\u4f5c\u7b80\u5355\uff0c\u9002\u5408\u65b0\u624b\uff1a<\/p>\n\n\n\n<ol start=\"1\" class=\"wp-block-list\">\n<li>\u8bbf\u95eeEMQX Cloud\u5b98\u7f51\uff0c\u6ce8\u518c\u5e76\u767b\u5f55\uff0c\u521b\u5efa\u4e00\u4e2aServerless\u90e8\u7f72\uff1b<\/li>\n\n\n\n<li>\u90e8\u7f72\u521b\u5efa\u5b8c\u6210\u540e\uff0c\u8fdb\u5165\u201c\u6982\u89c8\u201d\u9875\u9762\uff0c\u83b7\u53d6MQTT\u8fde\u63a5\u4fe1\u606f\uff1aBroker\u5730\u5740\u3001\u7aef\u53e3\uff08Serverless\u4ec5\u652f\u6301TLS\u7aef\u53e38883\uff09\uff1b<\/li>\n\n\n\n<li>\u4e0b\u8f7dCA\u8bc1\u4e66\uff08\u7528\u4e8eTLS\u8fde\u63a5\u6821\u9a8c\uff09\uff0c\u5e76\u901a\u8fc7\u201c\u8bbf\u95ee\u63a7\u5236-\u5ba2\u6237\u7aef\u8ba4\u8bc1\u201d\u914d\u7f6e\u7528\u6237\u540d\u548c\u5bc6\u7801\uff08\u5982\u7528\u6237\u540demqx\uff0c\u5bc6\u7801public\uff09\uff1b<\/li>\n\n\n\n<li>\u5f00\u542f\u670d\u52a1\u5668\u8bbf\u95ee\u6743\u9650\uff0c\u786e\u4fddESP32\u80fd\u6b63\u5e38\u8bbf\u95ee\u8be5Broker\u5730\u5740\u548c\u7aef\u53e3\u3002<\/li>\n<\/ol>\n\n\n\n<p class=\"wp-block-paragraph\">\u82e5\u9009\u62e9\u672c\u5730\u90e8\u7f72\uff0c\u53ef\u901a\u8fc7Docker\u5feb\u901f\u542f\u52a8EMQX\uff0c\u547d\u4ee4\u5982\u4e0b\uff08\u9002\u5408\u6709\u670d\u52a1\u5668\u57fa\u7840\u7684\u5f00\u53d1\u8005\uff09\uff1a<code>docker run -d --name emqx -p 1883:1883 -p 8083:8083 -p 8883:8883 -p 8084:8084 emqx\/emqx:latest<\/code>\uff0c\u542f\u52a8\u540e\u901a\u8fc7<code>http:\/\/localhost:18083<\/code>\u8bbf\u95eeEMQX\u63a7\u5236\u53f0\uff08\u9ed8\u8ba4\u7528\u6237\u540dadmin\uff0c\u5bc6\u7801public\uff09\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">3.3 \u6b65\u9aa42\uff1a\u914d\u7f6eESP32\u5f00\u53d1\u73af\u5883<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">\u65b9\u5f0f1\uff1aArduino IDE\u914d\u7f6e\uff08\u9002\u5408\u65b0\u624b\uff09<\/h3>\n\n\n\n<ol start=\"1\" class=\"wp-block-list\">\n<li>\u5b89\u88c5Arduino IDE\uff0c\u6253\u5f00\u540e\u70b9\u51fb\u201c\u5de5\u5177-\u5f00\u53d1\u677f-\u5f00\u53d1\u677f\u7ba1\u7406\u201d\uff0c\u641c\u7d22\u201cESP32\u201d\uff0c\u5b89\u88c5ESP32\u5f00\u53d1\u677f\u652f\u6301\u5305\uff1b<\/li>\n\n\n\n<li>\u70b9\u51fb\u201c\u9879\u76ee-\u52a0\u8f7d\u5e93-\u7ba1\u7406\u5e93\u201d\uff0c\u641c\u7d22\u201cPubSubClient\u201d\uff08MQTT\u5ba2\u6237\u7aef\u5e93\uff09\u548c\u201cDHT sensor library\u201d\uff08\u6e29\u6e7f\u5ea6\u4f20\u611f\u5668\u5e93\uff09\uff0c\u5206\u522b\u5b89\u88c5\uff1b<\/li>\n\n\n\n<li>\u5c06ESP32\u5f00\u53d1\u677f\u901a\u8fc7USB\u6570\u636e\u7ebf\u8fde\u63a5\u7535\u8111\uff0c\u5728Arduino IDE\u4e2d\u9009\u62e9\u5bf9\u5e94\u7684\u5f00\u53d1\u677f\uff08\u5982\u201cESP32 Dev Module\u201d\uff09\u548c\u7aef\u53e3\u3002<\/li>\n<\/ol>\n\n\n\n<h3 class=\"wp-block-heading\">\u65b9\u5f0f2\uff1aMicroPython\u73af\u5883\u914d\u7f6e\uff08\u9002\u5408Python\u5f00\u53d1\u8005\uff09<\/h3>\n\n\n\n<ol start=\"1\" class=\"wp-block-list\">\n<li>\u7ed9ESP32\u5237\u5165MicroPython\u56fa\u4ef6\uff08\u53c2\u8003MicroPython\u5b98\u7f51\u6559\u7a0b\uff09\uff1b<\/li>\n\n\n\n<li>\u5b89\u88c5PyCharm\u6216Thonny\u5f00\u53d1\u5de5\u5177\uff0c\u914d\u7f6e\u4e32\u53e3\u8fde\u63a5ESP32\uff1b<\/li>\n\n\n\n<li>\u5b89\u88c5umqtt\u5e93\uff08MicroPython\u7684MQTT\u5ba2\u6237\u7aef\u5e93\uff09\uff0c\u901a\u8fc7<code>upip.install('umqtt.simple')<\/code>\u547d\u4ee4\u5b89\u88c5\uff0c\u8be5\u5e93\u652f\u6301\u6d88\u606f\u56de\u8c03\uff0c\u76ee\u524d\u4ec5\u652f\u6301MQTT v3.1.1\uff0c\u4e0d\u652f\u6301QoS 2\u3002<\/li>\n<\/ol>\n\n\n\n<h2 class=\"wp-block-heading\">3.4 \u6b65\u9aa43\uff1aESP32\u4ee3\u7801\u7f16\u5199\uff08\u4ee5Arduino IDE\u4e3a\u4f8b\uff09<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\u4ee3\u7801\u529f\u80fd\uff1aESP32\u8fde\u63a5Wi-Fi\uff0c\u8fde\u63a5EMQX\u670d\u52a1\u5668\uff0c\u901a\u8fc7DHT11\u91c7\u96c6\u6e29\u6e7f\u5ea6\u6570\u636e\uff0c\u6bcf\u96945\u79d2\u5c06\u6570\u636e\u53d1\u5e03\u5230\u201cesp32\/dht11\u201d\u4e3b\u9898\uff0c\u540c\u65f6\u8ba2\u9605\u8be5\u4e3b\u9898\uff0c\u63a5\u6536\u670d\u52a1\u5668\u8f6c\u53d1\u7684\u6d88\u606f\uff08\u53ef\u9009\uff09\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>#include &lt;WiFi.h>\n#include &lt;PubSubClient.h>\n#include &lt;DHT.h>\n\n\/\/ Wi-Fi\u914d\u7f6e\nconst char* ssid = \"\u4f60\u7684Wi-Fi\u540d\u79f0\";\nconst char* password = \"\u4f60\u7684Wi-Fi\u5bc6\u7801\";\n\n\/\/ EMQX\u670d\u52a1\u5668\u914d\u7f6e\uff08\u6839\u636e\u5b9e\u9645\u90e8\u7f72\u4fee\u6539\uff09\nconst char* mqtt_broker = \"\u4f60\u7684EMQX Broker\u5730\u5740\";\nconst int mqtt_port = 8883; \/\/ Serverless\u90e8\u7f72\u4ec5\u652f\u63018883\u7aef\u53e3\uff08TLS\uff09\nconst char* mqtt_username = \"emqx\";\nconst char* mqtt_password = \"public\";\nconst char* mqtt_topic = \"esp32\/dht11\"; \/\/ \u6d88\u606f\u4e3b\u9898\n\n\/\/ DHT11\u4f20\u611f\u5668\u914d\u7f6e\uff08\u8fde\u63a5ESP32\u7684GPIO2\u5f15\u811a\uff09\n#define DHTPIN 2\n#define DHTTYPE DHT11\nDHT dht(DHTPIN, DHTTYPE);\n\n\/\/ MQTT\u5ba2\u6237\u7aef\u5bf9\u8c61\nWiFiClientSecure espClient; \/\/ TLS\u8fde\u63a5\u4f7f\u7528WiFiClientSecure\uff0cTCP\u8fde\u63a5\u4f7f\u7528WiFiClient\nPubSubClient client(espClient);\n\n\/\/ \u8fde\u63a5Wi-Fi\u51fd\u6570\nvoid connectToWiFi() {\n  Serial.begin(115200);\n  WiFi.begin(ssid, password);\n  while (WiFi.status() != WL_CONNECTED) {\n    delay(500);\n    Serial.print(\".\");\n  }\n  Serial.println(\"\\nWi-Fi\u8fde\u63a5\u6210\u529f\uff0cIP\u5730\u5740\uff1a\" + WiFi.localIP().toString());\n}\n\n\/\/ \u8fde\u63a5EMQX\u670d\u52a1\u5668\u51fd\u6570\nvoid connectToEMQX() {\n  while (!client.connected()) {\n    String client_id = \"esp32-client-\" + String(WiFi.macAddress()); \/\/ \u552f\u4e00\u5ba2\u6237\u7aefID\n    Serial.printf(\"\u6b63\u5728\u8fde\u63a5EMQX\u670d\u52a1\u5668\uff0c\u5ba2\u6237\u7aefID\uff1a%s\\n\", client_id.c_str());\n    \/\/ \u8fde\u63a5EMQX\uff0c\u4f20\u5165\u5ba2\u6237\u7aefID\u3001\u7528\u6237\u540d\u3001\u5bc6\u7801\n    if (client.connect(client_id.c_str(), mqtt_username, mqtt_password)) {\n      Serial.println(\"EMQX\u670d\u52a1\u5668\u8fde\u63a5\u6210\u529f\");\n      client.subscribe(mqtt_topic); \/\/ \u8ba2\u9605\u4e3b\u9898\n    } else {\n      Serial.print(\"\u8fde\u63a5\u5931\u8d25\uff0c\u9519\u8bef\u4ee3\u7801\uff1a\");\n      Serial.println(client.state());\n      delay(2000);\n    }\n  }\n}\n\n\/\/ MQTT\u6d88\u606f\u63a5\u6536\u56de\u8c03\u51fd\u6570\uff08\u63a5\u6536\u8ba2\u9605\u7684\u6d88\u606f\uff09\nvoid callback(char* topic, byte* payload, unsigned int length) {\n  Serial.print(\"\u6536\u5230\u6d88\u606f\uff0c\u4e3b\u9898\uff1a\");\n  Serial.println(topic);\n  Serial.print(\"\u6d88\u606f\u5185\u5bb9\uff1a\");\n  for (int i = 0; i &lt; length; i++) {\n    Serial.print((char)payload&#91;i]);\n  }\n  Serial.println(\"\\n\");\n}\n\nvoid setup() {\n  dht.begin(); \/\/ \u521d\u59cb\u5316DHT11\u4f20\u611f\u5668\n  connectToWiFi(); \/\/ \u8fde\u63a5Wi-Fi\n  client.setServer(mqtt_broker, mqtt_port); \/\/ \u8bbe\u7f6eEMQX\u670d\u52a1\u5668\u5730\u5740\u548c\u7aef\u53e3\n  client.setCallback(callback); \/\/ \u8bbe\u7f6e\u6d88\u606f\u63a5\u6536\u56de\u8c03\n  \/\/ \u914d\u7f6eTLS\u8bc1\u4e66\uff08Serverless\u90e8\u7f72\u5fc5\u987b\u914d\u7f6e\uff09\n  espClient.setCACert(\"\/path\/to\/ca.crt\"); \/\/ \u66ff\u6362\u4e3aCA\u8bc1\u4e66\u8def\u5f84\n}\n\nvoid loop() {\n  if (!client.connected()) {\n    connectToEMQX(); \/\/ \u82e5\u65ad\u5f00\u8fde\u63a5\uff0c\u91cd\u65b0\u8fde\u63a5\n  }\n  client.loop(); \/\/ \u7ef4\u6301MQTT\u8fde\u63a5\uff0c\u5904\u7406\u6d88\u606f\n\n  \/\/ \u91c7\u96c6\u6e29\u6e7f\u5ea6\u6570\u636e\n  float temp = dht.readTemperature(); \/\/ \u8bfb\u53d6\u6e29\u5ea6\n  float humi = dht.readHumidity(); \/\/ \u8bfb\u53d6\u6e7f\u5ea6\n\n  \/\/ \u6821\u9a8c\u6570\u636e\u6709\u6548\u6027\n  if (isnan(temp) || isnan(humi)) {\n    Serial.println(\"\u4f20\u611f\u5668\u6570\u636e\u91c7\u96c6\u5931\u8d25\");\n    delay(1000);\n    return;\n  }\n\n  \/\/ \u62fc\u63a5\u6d88\u606f\u5185\u5bb9\n  String message = \"\u6e29\u5ea6\uff1a\" + String(temp) + \"\u2103\uff0c\u6e7f\u5ea6\uff1a\" + String(humi) + \"%\";\n  Serial.print(\"\u53d1\u5e03\u6d88\u606f\uff1a\");\n  Serial.println(message);\n\n  \/\/ \u53d1\u5e03\u6d88\u606f\u5230EMQX\u670d\u52a1\u5668\n  client.publish(mqtt_topic, message.c_str());\n\n  delay(5000); \/\/ \u6bcf\u96945\u79d2\u53d1\u5e03\u4e00\u6b21\n}\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u8bf4\u660e\uff1a\u82e5\u4f7f\u7528\u672c\u5730EMQX\u90e8\u7f72\uff08TCP\u8fde\u63a5\uff09\uff0c\u5c06<code>WiFiClientSecure espClient<\/code>\u6539\u4e3a<code>WiFiClient espClient<\/code>\uff0c\u7aef\u53e3\u6539\u4e3a1883\uff0c\u65e0\u9700\u914d\u7f6eCA\u8bc1\u4e66\uff1b\u4ee3\u7801\u4e2d\u9700\u66ff\u6362Wi-Fi\u540d\u79f0\u3001\u5bc6\u7801\u3001EMQX Broker\u5730\u5740\u3001CA\u8bc1\u4e66\u8def\u5f84\u7b49\u4fe1\u606f\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">MicroPython\u4ee3\u7801\uff08\u53ef\u9009\uff09<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>import network\nimport time\nimport dht\nimport machine\nfrom umqtt.simple import MQTTClient\nimport ssl\n\n# Wi-Fi\u914d\u7f6e\nssid = \"\u4f60\u7684Wi-Fi\u540d\u79f0\"\npassword = \"\u4f60\u7684Wi-Fi\u5bc6\u7801\"\n\n# EMQX\u670d\u52a1\u5668\u914d\u7f6e\nSERVER = \"\u4f60\u7684EMQX Broker\u5730\u5740\"\nPORT = 8883\nCLIENT_ID = \"esp32-micropython-\" + str(machine.unique_id())\nUSERNAME = \"emqx\"\nPASSWORD = \"public\"\nTOPIC = \"esp32\/dht11\"\n\n# \u521d\u59cb\u5316DHT11\u4f20\u611f\u5668\uff08GPIO2\uff09\nd = dht.DHT11(machine.Pin(2))\n\n# \u8fde\u63a5Wi-Fi\ndef connect_wifi():\n    wlan = network.WLAN(network.STA_IF)\n    wlan.active(True)\n    if not wlan.isconnected():\n        print(\"\u6b63\u5728\u8fde\u63a5Wi-Fi...\")\n        wlan.connect(ssid, password)\n        while not wlan.isconnected():\n            time.sleep(0.5)\n    print(\"Wi-Fi\u8fde\u63a5\u6210\u529f\uff0cIP\uff1a\", wlan.ifconfig()&#91;0])\n\n# \u8fde\u63a5EMQX\u670d\u52a1\u5668\ndef connect_emqx():\n    client = MQTTClient(CLIENT_ID, SERVER, PORT, USERNAME, PASSWORD, ssl=True)\n    # \u914d\u7f6eTLS\u8bc1\u4e66\n    with open('emqxsl-ca.crt', 'rb') as f:\n        cadata = f.read()\n    ssl_params = {'cert_reqs': ssl.CERT_REQUIRED, 'cadata': cadata, 'server_hostname': SERVER}\n    client.ssl_params = ssl_params\n    client.connect()\n    print(\"EMQX\u670d\u52a1\u5668\u8fde\u63a5\u6210\u529f\")\n    return client\n\n# \u4e3b\u51fd\u6570\ndef main():\n    connect_wifi()\n    client = connect_emqx()\n    while True:\n        try:\n            d.measure()\n            temp = d.temperature()\n            humi = d.humidity()\n            message = f\"\u6e29\u5ea6\uff1a{temp}\u2103\uff0c\u6e7f\u5ea6\uff1a{humi}%\"\n            print(f\"\u53d1\u5e03\u6d88\u606f\uff1a{message}\")\n            client.publish(TOPIC, message)\n            time.sleep(5)\n        except Exception as e:\n            print(\"\u5f02\u5e38\uff1a\", e)\n            time.sleep(1)\n\nif __name__ == \"__main__\":\n    main()\n<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">3.5 \u6b65\u9aa44\uff1a\u6d4b\u8bd5\u9a8c\u8bc1<\/h2>\n\n\n\n<ol start=\"1\" class=\"wp-block-list\">\n<li>\u5c06ESP32\u5f00\u53d1\u677f\u4e0eDHT11\u4f20\u611f\u5668\u8fde\u63a5\uff08VCC\u63a53.3V\uff0cGND\u63a5GND\uff0cDATA\u63a5GPIO2\uff09\uff1b<\/li>\n\n\n\n<li>\u5c06\u7f16\u5199\u597d\u7684\u4ee3\u7801\u4e0a\u4f20\u5230ESP32\uff08Arduino IDE\u70b9\u51fb\u201c\u4e0a\u4f20\u201d\uff0cMicroPython\u901a\u8fc7\u5f00\u53d1\u5de5\u5177\u4e0a\u4f20\u6587\u4ef6\uff09\uff1b<\/li>\n\n\n\n<li>\u6253\u5f00Arduino IDE\u7684\u4e32\u53e3\u76d1\u89c6\u5668\uff08\u6ce2\u7279\u7387115200\uff09\uff0c\u67e5\u770bESP32\u662f\u5426\u6210\u529f\u8fde\u63a5Wi-Fi\u548cEMQX\u670d\u52a1\u5668\uff1b<\/li>\n\n\n\n<li>\u6253\u5f00MQTT\u5ba2\u6237\u7aef\uff08\u5982MQTT X\uff09\uff0c\u8fde\u63a5EMQX\u670d\u52a1\u5668\uff08\u8f93\u5165Broker\u5730\u5740\u3001\u7aef\u53e3\u3001\u7528\u6237\u540d\u3001\u5bc6\u7801\uff09\uff0c\u8ba2\u9605\u201cesp32\/dht11\u201d\u4e3b\u9898\uff1b<\/li>\n\n\n\n<li>\u89c2\u5bdfMQTT\u5ba2\u6237\u7aef\uff0c\u6bcf\u96945\u79d2\u4f1a\u6536\u5230ESP32\u53d1\u5e03\u7684\u6e29\u6e7f\u5ea6\u6570\u636e\uff0c\u8bf4\u660e\u6574\u4e2a\u7cfb\u7edf\u8fd0\u884c\u6b63\u5e38\uff1b\u540c\u65f6\u53ef\u5728EMQX\u63a7\u5236\u53f0\u67e5\u770b\u8bbe\u5907\u8fde\u63a5\u72b6\u6001\u548c\u6d88\u606f\u6d41\u8f6c\u60c5\u51b5\u3002<\/li>\n<\/ol>\n\n\n\n<h1 class=\"wp-block-heading\">\u56db\u3001\u5e38\u89c1\u95ee\u9898\u4e0e\u89e3\u51b3\u65b9\u6848<\/h1>\n\n\n\n<h2 class=\"wp-block-heading\">4.1 ESP32\u65e0\u6cd5\u8fde\u63a5EMQX\u670d\u52a1\u5668<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u539f\u56e01\uff1aWi-Fi\u8fde\u63a5\u5931\u8d25\uff0c\u68c0\u67e5Wi-Fi\u540d\u79f0\u3001\u5bc6\u7801\u662f\u5426\u6b63\u786e\uff0c\u786e\u4fddESP32\u4e0eEMQX\u670d\u52a1\u5668\u5904\u4e8e\u540c\u4e00\u7f51\u7edc\uff08\u672c\u5730\u90e8\u7f72\uff09\uff1b<\/li>\n\n\n\n<li>\u539f\u56e02\uff1aEMQX\u670d\u52a1\u5668\u5730\u5740\u3001\u7aef\u53e3\u914d\u7f6e\u9519\u8bef\uff0c\u68c0\u67e5Broker\u5730\u5740\u662f\u5426\u6b63\u786e\uff0cServerless\u90e8\u7f72\u9700\u4f7f\u75288883\u7aef\u53e3\uff0c\u672c\u5730\u90e8\u7f72\u4f7f\u75281883\u7aef\u53e3\uff1b<\/li>\n\n\n\n<li>\u539f\u56e03\uff1a\u7528\u6237\u540d\/\u5bc6\u7801\u9519\u8bef\uff0c\u68c0\u67e5EMQX\u5ba2\u6237\u7aef\u8ba4\u8bc1\u914d\u7f6e\uff0c\u786e\u4fdd\u4ee3\u7801\u4e2d\u7684\u7528\u6237\u540d\u3001\u5bc6\u7801\u4e0e\u670d\u52a1\u5668\u4e00\u81f4\uff1b<\/li>\n\n\n\n<li>\u539f\u56e04\uff1aTLS\u8fde\u63a5\u672a\u914d\u7f6eCA\u8bc1\u4e66\uff0cServerless\u90e8\u7f72\u5fc5\u987b\u914d\u7f6eCA\u8bc1\u4e66\uff0c\u786e\u4fdd\u8bc1\u4e66\u8def\u5f84\u6b63\u786e\u3002<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">4.2 \u65e0\u6cd5\u91c7\u96c6\u4f20\u611f\u5668\u6570\u636e<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u539f\u56e01\uff1a\u4f20\u611f\u5668\u63a5\u7ebf\u9519\u8bef\uff0c\u68c0\u67e5DHT11\u7684VCC\u3001GND\u3001DATA\u5f15\u811a\u662f\u5426\u63a5\u5bf9\uff0c\u907f\u514d\u63a5\u53cd\u5bfc\u81f4\u4f20\u611f\u5668\u635f\u574f\uff1b<\/li>\n\n\n\n<li>\u539f\u56e02\uff1a\u4f20\u611f\u5668\u5e93\u672a\u5b89\u88c5\uff0c\u91cd\u65b0\u5b89\u88c5DHT sensor library\uff08Arduino\uff09\u6216\u786e\u4fddumqtt\u5e93\u6b63\u5e38\u52a0\u8f7d\uff08MicroPython\uff09\uff1b<\/li>\n\n\n\n<li>\u539f\u56e03\uff1aGPIO\u5f15\u811a\u914d\u7f6e\u9519\u8bef\uff0c\u68c0\u67e5\u4ee3\u7801\u4e2dDHTPIN\u662f\u5426\u4e0e\u5b9e\u9645\u63a5\u7ebf\u7684GPIO\u5f15\u811a\u4e00\u81f4\u3002<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">4.3 MQTT\u5ba2\u6237\u7aef\u65e0\u6cd5\u63a5\u6536\u6d88\u606f<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u539f\u56e01\uff1a\u4e3b\u9898\u8ba2\u9605\u9519\u8bef\uff0c\u786e\u4fddMQTT\u5ba2\u6237\u7aef\u8ba2\u9605\u7684\u4e3b\u9898\u4e0eESP32\u53d1\u5e03\u7684\u4e3b\u9898\u5b8c\u5168\u4e00\u81f4\uff08\u533a\u5206\u5927\u5c0f\u5199\uff09\uff1b<\/li>\n\n\n\n<li>\u539f\u56e02\uff1aEMQX\u670d\u52a1\u5668\u672a\u8f6c\u53d1\u6d88\u606f\uff0c\u68c0\u67e5EMQX\u63a7\u5236\u53f0\u7684\u6d88\u606f\u6d41\u8f6c\u8bb0\u5f55\uff0c\u786e\u8ba4\u6d88\u606f\u5df2\u88ab\u670d\u52a1\u5668\u63a5\u6536\uff1b<\/li>\n\n\n\n<li>\u539f\u56e03\uff1aQoS\u7b49\u7ea7\u914d\u7f6e\u4e0d\u5f53\uff0c\u82e5\u9009\u62e9QoS 1\u6216QoS 2\uff0c\u786e\u4fdd\u5ba2\u6237\u7aef\u652f\u6301\u6d88\u606f\u786e\u8ba4\u673a\u5236\u3002<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">4.4 \u70e7\u5f55\u51fa\u73b0\u62a5\u9519<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u539f\u56e01\uff1a\u7a0b\u5e8f\u5361\u6b7b\u70e7\u5f55\u53e3\uff0c\u957f\u6309boot\uff0c\u7136\u540e\u5355\u70b9result\u952e\u3002<\/li>\n<\/ul>\n\n\n\n<h1 class=\"wp-block-heading\">\u4e94\u3001\u6269\u5c55\u5e94\u7528\u4e0e\u4f18\u5316\u5efa\u8bae<\/h1>\n\n\n\n<h2 class=\"wp-block-heading\">5.1 \u6269\u5c55\u5e94\u7528\u573a\u666f<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u591a\u8bbe\u5907\u534f\u540c\uff1a\u591a\u4e2aESP32\u8bbe\u5907\u8fde\u63a5\u540c\u4e00EMQX\u670d\u52a1\u5668\uff0c\u901a\u8fc7\u4e0d\u540c\u4e3b\u9898\u5b9e\u73b0\u8bbe\u5907\u95f4\u7684\u901a\u4fe1\uff08\u5982\u706f\u5149\u63a7\u5236\u3001\u7a97\u5e18\u63a7\u5236\uff09\uff1b<\/li>\n\n\n\n<li>\u4e91\u7aef\u8054\u52a8\uff1a\u901a\u8fc7EMQX\u7684\u89c4\u5219\u5f15\u64ce\uff0c\u5c06ESP32\u91c7\u96c6\u7684\u6570\u636e\u8f6c\u53d1\u81f3\u963f\u91cc\u4e91\u3001\u817e\u8baf\u4e91\u7b49\u5e73\u53f0\uff0c\u5b9e\u73b0\u6570\u636e\u5b58\u50a8\u3001\u5206\u6790\u548c\u53ef\u89c6\u5316\uff1b<\/li>\n\n\n\n<li>\u8fdc\u7a0b\u63a7\u5236\uff1a\u901a\u8fc7MQTT\u5ba2\u6237\u7aef\u5411ESP32\u53d1\u5e03\u63a7\u5236\u6307\u4ee4\uff08\u5982\u201c\u6253\u5f00LED\u201d\u201c\u5173\u95ed\u7ee7\u7535\u5668\u201d\uff09\uff0c\u5b9e\u73b0\u8fdc\u7a0b\u8bbe\u5907\u63a7\u5236\uff0c\u53ef\u7ed3\u5408Web\u540e\u53f0\u6216\u624b\u673aAPP\u4f18\u5316\u64cd\u4f5c\u4f53\u9a8c[6]\uff1b<\/li>\n\n\n\n<li>\u4f4e\u529f\u8017\u4f18\u5316\uff1a\u5229\u7528ESP32\u7684\u4f11\u7720\u6a21\u5f0f\uff0c\u5728\u4e0d\u91c7\u96c6\u6570\u636e\u65f6\u8fdb\u5165\u4f11\u7720\uff0c\u901a\u8fc7MQTT\u5fc3\u8df3\u673a\u5236\u7ef4\u6301\u8fde\u63a5\uff0c\u964d\u4f4e\u8bbe\u5907\u529f\u8017\uff0c\u5ef6\u957f\u7535\u6c60\u4f7f\u7528\u5bff\u547d\u3002<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">5.2 \u4f18\u5316\u5efa\u8bae<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u6570\u636e\u52a0\u5bc6\uff1a\u4f7f\u7528TLS\/SSL\u52a0\u5bc6ESP32\u4e0eEMQX\u4e4b\u95f4\u7684\u901a\u4fe1\uff0c\u9632\u6b62\u6570\u636e\u88ab\u7a83\u542c\u3001\u7be1\u6539\uff0cEMQX Cloud\u9ed8\u8ba4\u652f\u6301TLS\u52a0\u5bc6\uff0c\u672c\u5730\u90e8\u7f72\u53ef\u624b\u52a8\u914d\u7f6e\uff1b<\/li>\n\n\n\n<li>\u6743\u9650\u63a7\u5236\uff1a\u5728EMQX\u670d\u52a1\u5668\u4e2d\u914d\u7f6e\u7cbe\u7ec6\u5316\u7684\u5ba2\u6237\u7aef\u6743\u9650\uff0c\u9650\u5236\u8bbe\u5907\u53ea\u80fd\u53d1\u5e03\/\u8ba2\u9605\u6307\u5b9a\u4e3b\u9898\uff0c\u63d0\u5347\u7cfb\u7edf\u5b89\u5168\u6027\uff1b<\/li>\n\n\n\n<li>\u6d88\u606f\u6301\u4e45\u5316\uff1a\u5f00\u542fEMQX\u7684\u6d88\u606f\u6301\u4e45\u5316\u529f\u80fd\uff0c\u786e\u4fddESP32\u79bb\u7ebf\u540e\uff0c\u91cd\u65b0\u4e0a\u7ebf\u80fd\u63a5\u6536\u79bb\u7ebf\u671f\u95f4\u7684\u6d88\u606f\uff1b<\/li>\n\n\n\n<li>\u4ee3\u7801\u4f18\u5316\uff1a\u5728ESP32\u4ee3\u7801\u4e2d\u6dfb\u52a0\u5f02\u5e38\u5904\u7406\uff08\u5982\u91cd\u8fde\u673a\u5236\u3001\u6570\u636e\u6821\u9a8c\uff09\uff0c\u63d0\u5347\u7cfb\u7edf\u7a33\u5b9a\u6027\uff0c\u907f\u514d\u56e0\u7f51\u7edc\u6ce2\u52a8\u5bfc\u81f4\u7a0b\u5e8f\u5d29\u6e83\uff1b<\/li>\n\n\n\n<li>\u91c7\u6837\u7387\u4f18\u5316\uff1a\u6839\u636e\u5b9e\u9645\u573a\u666f\u8c03\u6574\u4f20\u611f\u5668\u91c7\u6837\u9891\u7387\uff0c\u907f\u514d\u8fc7\u9ad8\u91c7\u6837\u7387\u589e\u52a0\u7f51\u7edc\u8d1f\u62c5\u548c\u8bbe\u5907\u529f\u8017\uff0c\u53ef\u91c7\u7528\u81ea\u9002\u5e94\u91c7\u6837\u7b56\u7565\u52a8\u6001\u8c03\u6574\u3002<\/li>\n<\/ul>\n\n\n\n<h1 class=\"wp-block-heading\">\u516d\u3001\u603b\u7ed3<\/h1>\n\n\n\n<p class=\"wp-block-paragraph\">ESP32\u3001EMQX\u4e0eMQTT\u534f\u8bae\u7684\u7ed3\u5408\uff0c\u662f\u4e00\u5957\u4f4e\u6210\u672c\u3001\u9ad8\u53ef\u9760\u3001\u6613\u6269\u5c55\u7684\u7269\u8054\u7f51\u6570\u636e\u4f20\u8f93\u65b9\u6848\uff0c\u5b8c\u7f8e\u9002\u914d\u5d4c\u5165\u5f0f\u8bbe\u5907\u7684\u8f7b\u91cf\u5316\u9700\u6c42\u548c\u7269\u8054\u7f51\u573a\u666f\u7684\u9ad8\u5e76\u53d1\u3001\u4f4e\u529f\u8017\u8981\u6c42\u3002\u672c\u6587\u4ece\u6838\u5fc3\u7ec4\u4ef6\u89e3\u6790\u3001\u534f\u540c\u5de5\u4f5c\u539f\u7406\u3001\u5b9e\u6218\u90e8\u7f72\u4e09\u4e2a\u7ef4\u5ea6\uff0c\u8be6\u7ec6\u8bb2\u89e3\u4e86\u4e09\u8005\u7684\u5e94\u7528\u65b9\u6cd5\uff0c\u901a\u8fc7\u7b80\u5355\u7684\u6e29\u6e7f\u5ea6\u91c7\u96c6\u6848\u4f8b\uff0c\u5e2e\u52a9\u5f00\u53d1\u8005\u5feb\u901f\u4e0a\u624b\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u968f\u7740\u7269\u8054\u7f51\u6280\u672f\u7684\u53d1\u5c55\uff0c\u8fd9\u5957\u65b9\u6848\u53ef\u7075\u6d3b\u6269\u5c55\u81f3\u667a\u80fd\u5bb6\u5c45\u3001\u5de5\u4e1a\u76d1\u6d4b\u3001\u73af\u5883\u4f20\u611f\u7b49\u591a\u79cd\u573a\u666f\uff0c\u5f00\u53d1\u8005\u53ef\u6839\u636e\u5b9e\u9645\u9700\u6c42\uff0c\u4f18\u5316\u4ee3\u7801\u3001\u6269\u5c55\u529f\u80fd\uff0c\u5b9e\u73b0\u66f4\u590d\u6742\u7684\u7269\u8054\u7f51\u5e94\u7528\u3002\u65e0\u8bba\u662f\u65b0\u624b\u5165\u95e8\u8fd8\u662f\u9879\u76ee\u5f00\u53d1\uff0cESP32+EMQX+MQTT\u90fd\u662f\u503c\u5f97\u4f18\u5148\u9009\u62e9\u7684\u7ec4\u5408\uff0c\u5176\u4e30\u5bcc\u7684\u5f00\u53d1\u8d44\u6e90\u548c\u5b8c\u5584\u7684\u751f\u6001\u4f53\u7cfb\uff0c\u80fd\u5927\u5e45\u964d\u4f4e\u7269\u8054\u7f51\u9879\u76ee\u7684\u5f00\u53d1\u6210\u672c\u548c\u96be\u5ea6\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5728\u7269\u8054\u7f51\uff08IoT\uff09\u5f00\u53d1\u4e2d\uff0c\u6570\u636e\u7684\u9ad8\u6548\u3001\u53ef\u9760\u4f20\u8f93\u662f\u6838\u5fc3\u9700\u6c42\uff0c\u800cMQTT\u534f\u8bae\u4f5c\u4e3a\u8f7b\u91cf\u7ea7\u7269\u8054\u7f51\u901a\u4fe1\u6807\u51c6\uff0cEMQX\u4f5c\u4e3a [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-2150","post","type-post","status-publish","format-standard","hentry","category-learn"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.0 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>EMQX\u4e0eMQTT\u534f\u8bae\u5b9e\u73b0\u7269\u8054\u7f51\u6570\u636e\u4f20\u8f93 - Hueil\u306e\u5c0f\u7a9d<\/title>\n<meta name=\"description\" content=\"\u8ba1\u7b97\u673a\u5e94\u7528\uff0cPython\uff0cJava\uff0c\u4fe1\u606f\u5b89\u5168\uff0c\u7f51\u7ad9\u7f8e\u5316,\u7269\u8054\u7f51\uff0cC\/C++\u7b97\u6cd5\u5206\u6790,\u7f51\u7ad9\u5b9e\u6218\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/hueil.top\/?p=2150\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"EMQX\u4e0eMQTT\u534f\u8bae\u5b9e\u73b0\u7269\u8054\u7f51\u6570\u636e\u4f20\u8f93 - Hueil\u306e\u5c0f\u7a9d\" \/>\n<meta property=\"og:description\" content=\"\u8ba1\u7b97\u673a\u5e94\u7528\uff0cPython\uff0cJava\uff0c\u4fe1\u606f\u5b89\u5168\uff0c\u7f51\u7ad9\u7f8e\u5316,\u7269\u8054\u7f51\uff0cC\/C++\u7b97\u6cd5\u5206\u6790,\u7f51\u7ad9\u5b9e\u6218\" \/>\n<meta property=\"og:url\" content=\"https:\/\/hueil.top\/?p=2150\" \/>\n<meta property=\"og:site_name\" content=\"Hueil\u306e\u5c0f\u7a9d\" \/>\n<meta property=\"article:published_time\" content=\"2026-05-03T10:41:50+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2026-05-03T10:43:56+00:00\" \/>\n<meta name=\"author\" content=\"\u5c0f\u5f20\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"\u5c0f\u5f20\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/hueil.top\/?p=2150#article\",\"isPartOf\":{\"@id\":\"https:\/\/hueil.top\/?p=2150\"},\"author\":{\"name\":\"\u5c0f\u5f20\",\"@id\":\"https:\/\/hueil.top\/#\/schema\/person\/b3ed2232564570b957865ad1cefe7b88\"},\"headline\":\"EMQX\u4e0eMQTT\u534f\u8bae\u5b9e\u73b0\u7269\u8054\u7f51\u6570\u636e\u4f20\u8f93\",\"datePublished\":\"2026-05-03T10:41:50+00:00\",\"dateModified\":\"2026-05-03T10:43:56+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/hueil.top\/?p=2150\"},\"wordCount\":334,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/hueil.top\/#\/schema\/person\/b3ed2232564570b957865ad1cefe7b88\"},\"articleSection\":[\"\u6587\u7ae0\"],\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/hueil.top\/?p=2150#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/hueil.top\/?p=2150\",\"url\":\"https:\/\/hueil.top\/?p=2150\",\"name\":\"EMQX\u4e0eMQTT\u534f\u8bae\u5b9e\u73b0\u7269\u8054\u7f51\u6570\u636e\u4f20\u8f93 - Hueil\u306e\u5c0f\u7a9d\",\"isPartOf\":{\"@id\":\"https:\/\/hueil.top\/#website\"},\"datePublished\":\"2026-05-03T10:41:50+00:00\",\"dateModified\":\"2026-05-03T10:43:56+00:00\",\"description\":\"\u8ba1\u7b97\u673a\u5e94\u7528\uff0cPython\uff0cJava\uff0c\u4fe1\u606f\u5b89\u5168\uff0c\u7f51\u7ad9\u7f8e\u5316,\u7269\u8054\u7f51\uff0cC\/C++\u7b97\u6cd5\u5206\u6790,\u7f51\u7ad9\u5b9e\u6218\",\"breadcrumb\":{\"@id\":\"https:\/\/hueil.top\/?p=2150#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/hueil.top\/?p=2150\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/hueil.top\/?p=2150#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/hueil.top\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"EMQX\u4e0eMQTT\u534f\u8bae\u5b9e\u73b0\u7269\u8054\u7f51\u6570\u636e\u4f20\u8f93\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/hueil.top\/#website\",\"url\":\"https:\/\/hueil.top\/\",\"name\":\"Hueil\u306e\u5c0f\u7a9d\",\"description\":\"Hueil\u7684\u5c0f\u7834\u7ad9\",\"publisher\":{\"@id\":\"https:\/\/hueil.top\/#\/schema\/person\/b3ed2232564570b957865ad1cefe7b88\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/hueil.top\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"zh-Hans\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\/\/hueil.top\/#\/schema\/person\/b3ed2232564570b957865ad1cefe7b88\",\"name\":\"\u5c0f\u5f20\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/hueil.top\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/hueil.top\/wp-content\/uploads\/2025\/08\/Hueil.jpg\",\"contentUrl\":\"https:\/\/hueil.top\/wp-content\/uploads\/2025\/08\/Hueil.jpg\",\"width\":940,\"height\":940,\"caption\":\"\u5c0f\u5f20\"},\"logo\":{\"@id\":\"https:\/\/hueil.top\/#\/schema\/person\/image\/\"},\"sameAs\":[\"https:\/\/hueil.top\"],\"url\":\"https:\/\/hueil.top\/?author=1\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"EMQX\u4e0eMQTT\u534f\u8bae\u5b9e\u73b0\u7269\u8054\u7f51\u6570\u636e\u4f20\u8f93 - Hueil\u306e\u5c0f\u7a9d","description":"\u8ba1\u7b97\u673a\u5e94\u7528\uff0cPython\uff0cJava\uff0c\u4fe1\u606f\u5b89\u5168\uff0c\u7f51\u7ad9\u7f8e\u5316,\u7269\u8054\u7f51\uff0cC\/C++\u7b97\u6cd5\u5206\u6790,\u7f51\u7ad9\u5b9e\u6218","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/hueil.top\/?p=2150","og_locale":"zh_CN","og_type":"article","og_title":"EMQX\u4e0eMQTT\u534f\u8bae\u5b9e\u73b0\u7269\u8054\u7f51\u6570\u636e\u4f20\u8f93 - Hueil\u306e\u5c0f\u7a9d","og_description":"\u8ba1\u7b97\u673a\u5e94\u7528\uff0cPython\uff0cJava\uff0c\u4fe1\u606f\u5b89\u5168\uff0c\u7f51\u7ad9\u7f8e\u5316,\u7269\u8054\u7f51\uff0cC\/C++\u7b97\u6cd5\u5206\u6790,\u7f51\u7ad9\u5b9e\u6218","og_url":"https:\/\/hueil.top\/?p=2150","og_site_name":"Hueil\u306e\u5c0f\u7a9d","article_published_time":"2026-05-03T10:41:50+00:00","article_modified_time":"2026-05-03T10:43:56+00:00","author":"\u5c0f\u5f20","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"\u5c0f\u5f20","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"1 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/hueil.top\/?p=2150#article","isPartOf":{"@id":"https:\/\/hueil.top\/?p=2150"},"author":{"name":"\u5c0f\u5f20","@id":"https:\/\/hueil.top\/#\/schema\/person\/b3ed2232564570b957865ad1cefe7b88"},"headline":"EMQX\u4e0eMQTT\u534f\u8bae\u5b9e\u73b0\u7269\u8054\u7f51\u6570\u636e\u4f20\u8f93","datePublished":"2026-05-03T10:41:50+00:00","dateModified":"2026-05-03T10:43:56+00:00","mainEntityOfPage":{"@id":"https:\/\/hueil.top\/?p=2150"},"wordCount":334,"commentCount":0,"publisher":{"@id":"https:\/\/hueil.top\/#\/schema\/person\/b3ed2232564570b957865ad1cefe7b88"},"articleSection":["\u6587\u7ae0"],"inLanguage":"zh-Hans","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/hueil.top\/?p=2150#respond"]}]},{"@type":"WebPage","@id":"https:\/\/hueil.top\/?p=2150","url":"https:\/\/hueil.top\/?p=2150","name":"EMQX\u4e0eMQTT\u534f\u8bae\u5b9e\u73b0\u7269\u8054\u7f51\u6570\u636e\u4f20\u8f93 - Hueil\u306e\u5c0f\u7a9d","isPartOf":{"@id":"https:\/\/hueil.top\/#website"},"datePublished":"2026-05-03T10:41:50+00:00","dateModified":"2026-05-03T10:43:56+00:00","description":"\u8ba1\u7b97\u673a\u5e94\u7528\uff0cPython\uff0cJava\uff0c\u4fe1\u606f\u5b89\u5168\uff0c\u7f51\u7ad9\u7f8e\u5316,\u7269\u8054\u7f51\uff0cC\/C++\u7b97\u6cd5\u5206\u6790,\u7f51\u7ad9\u5b9e\u6218","breadcrumb":{"@id":"https:\/\/hueil.top\/?p=2150#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/hueil.top\/?p=2150"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/hueil.top\/?p=2150#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/hueil.top\/"},{"@type":"ListItem","position":2,"name":"EMQX\u4e0eMQTT\u534f\u8bae\u5b9e\u73b0\u7269\u8054\u7f51\u6570\u636e\u4f20\u8f93"}]},{"@type":"WebSite","@id":"https:\/\/hueil.top\/#website","url":"https:\/\/hueil.top\/","name":"Hueil\u306e\u5c0f\u7a9d","description":"Hueil\u7684\u5c0f\u7834\u7ad9","publisher":{"@id":"https:\/\/hueil.top\/#\/schema\/person\/b3ed2232564570b957865ad1cefe7b88"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/hueil.top\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"zh-Hans"},{"@type":["Person","Organization"],"@id":"https:\/\/hueil.top\/#\/schema\/person\/b3ed2232564570b957865ad1cefe7b88","name":"\u5c0f\u5f20","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/hueil.top\/#\/schema\/person\/image\/","url":"https:\/\/hueil.top\/wp-content\/uploads\/2025\/08\/Hueil.jpg","contentUrl":"https:\/\/hueil.top\/wp-content\/uploads\/2025\/08\/Hueil.jpg","width":940,"height":940,"caption":"\u5c0f\u5f20"},"logo":{"@id":"https:\/\/hueil.top\/#\/schema\/person\/image\/"},"sameAs":["https:\/\/hueil.top"],"url":"https:\/\/hueil.top\/?author=1"}]}},"_links":{"self":[{"href":"https:\/\/hueil.top\/index.php?rest_route=\/wp\/v2\/posts\/2150","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/hueil.top\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/hueil.top\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/hueil.top\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/hueil.top\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2150"}],"version-history":[{"count":2,"href":"https:\/\/hueil.top\/index.php?rest_route=\/wp\/v2\/posts\/2150\/revisions"}],"predecessor-version":[{"id":2153,"href":"https:\/\/hueil.top\/index.php?rest_route=\/wp\/v2\/posts\/2150\/revisions\/2153"}],"wp:attachment":[{"href":"https:\/\/hueil.top\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2150"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/hueil.top\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2150"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/hueil.top\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2150"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}