{"id":161121,"date":"2024-11-04T03:47:35","date_gmt":"2024-11-03T19:47:35","guid":{"rendered":"https:\/\/server.hk\/cnblog\/161121\/"},"modified":"2024-11-04T03:47:36","modified_gmt":"2024-11-03T19:47:36","slug":"%e7%8d%b2%e5%8f%96%e5%82%b3%e6%84%9f%e5%99%a8%e6%95%b8%e6%93%9a%e5%ba%ab%e7%9a%84%e6%8a%80%e5%b7%a7-%e5%a6%82%e4%bd%95%e7%8d%b2%e5%be%97%e5%82%b3%e6%84%9f%e5%99%a8%e6%95%b8%e6%93%9a%e5%ba%ab","status":"publish","type":"post","link":"https:\/\/server.hk\/cnblog\/161121\/","title":{"rendered":"\u7372\u53d6\u50b3\u611f\u5668\u6578\u64da\u5eab\u7684\u6280\u5de7 (\u5982\u4f55\u7372\u5f97\u50b3\u611f\u5668\u6578\u64da\u5eab)"},"content":{"rendered":"<h1 id=\"%e7%8d%b2%e5%8f%96%e5%82%b3%e6%84%9f%e5%99%a8%e6%95%b8%e6%93%9a%e5%ba%ab%e7%9a%84%e6%8a%80%e5%b7%a7-%e5%a6%82%e4%bd%95%e7%8d%b2%e5%be%97%e5%82%b3%e6%84%9f%e5%99%a8%e6%95%b8%e6%93%9a%e5%ba%ab-LdtGtvrTkx\">\u7372\u53d6\u50b3\u611f\u5668\u6578\u64da\u5eab\u7684\u6280\u5de7 (\u5982\u4f55\u7372\u5f97\u50b3\u611f\u5668\u6578\u64da\u5eab)<\/h1>\n<p>\u96a8\u8457\u7269\u806f\u7db2\uff08IoT\uff09\u6280\u8853\u7684\u8fc5\u901f\u767c\u5c55\uff0c\u50b3\u611f\u5668\u6578\u64da\u7684\u9700\u6c42\u65e5\u76ca\u589e\u52a0\u3002\u7121\u8ad6\u662f\u5728\u667a\u80fd\u5bb6\u5c45\u3001\u5de5\u696d\u81ea\u52d5\u5316\u9084\u662f\u74b0\u5883\u76e3\u6e2c\u4e2d\uff0c\u50b3\u611f\u5668\u6578\u64da\u90fd\u626e\u6f14\u8457\u81f3\u95dc\u91cd\u8981\u7684\u89d2\u8272\u3002\u672c\u6587\u5c07\u63a2\u8a0e\u5982\u4f55\u6709\u6548\u7372\u53d6\u50b3\u611f\u5668\u6578\u64da\u5eab\uff0c\u4e26\u63d0\u4f9b\u4e00\u4e9b\u5be6\u7528\u7684\u6280\u5de7\u548c\u65b9\u6cd5\u3002<\/p>\n<h2 id=\"1-%e7%a2%ba%e5%ae%9a%e6%95%b8%e6%93%9a%e9%9c%80%e6%b1%82-LdtGtvrTkx\">1. \u78ba\u5b9a\u6578\u64da\u9700\u6c42<\/h2>\n<p>\u5728\u958b\u59cb\u7372\u53d6\u50b3\u611f\u5668\u6578\u64da\u4e4b\u524d\uff0c\u9996\u5148\u9700\u8981\u660e\u78ba\u4f60\u7684\u6578\u64da\u9700\u6c42\u3002\u9019\u5305\u62ec\uff1a<\/p>\n<ul>\n<li>\u4f60\u9700\u8981\u54ea\u4e9b\u985e\u578b\u7684\u6578\u64da\uff1f\uff08\u4f8b\u5982\uff1a\u6eab\u5ea6\u3001\u6fd5\u5ea6\u3001\u5149\u7167\u7b49\uff09<\/li>\n<li>\u6578\u64da\u7684\u66f4\u65b0\u983b\u7387\u662f\u591a\u5c11\uff1f\uff08\u4f8b\u5982\uff1a\u6bcf\u79d2\u3001\u6bcf\u5206\u9418\u6216\u6bcf\u5c0f\u6642\uff09<\/li>\n<li>\u6578\u64da\u7684\u5b58\u5132\u6642\u9593\u548c\u683c\u5f0f\u8981\u6c42\u662f\u4ec0\u9ebc\uff1f<\/li>\n<\/ul>\n<p>\u660e\u78ba\u9019\u4e9b\u9700\u6c42\u5f8c\uff0c\u53ef\u4ee5\u66f4\u6709\u91dd\u5c0d\u6027\u5730\u5c0b\u627e\u5408\u9069\u7684\u6578\u64da\u4f86\u6e90\u3002<\/p>\n<h2 id=\"2-%e9%81%b8%e6%93%87%e5%90%88%e9%81%a9%e7%9a%84%e5%82%b3%e6%84%9f%e5%99%a8-LdtGtvrTkx\">2. \u9078\u64c7\u5408\u9069\u7684\u50b3\u611f\u5668<\/h2>\n<p>\u9078\u64c7\u5408\u9069\u7684\u50b3\u611f\u5668\u662f\u7372\u53d6\u6578\u64da\u7684\u95dc\u9375\u3002\u5e02\u5834\u4e0a\u6709\u8a31\u591a\u4e0d\u540c\u985e\u578b\u7684\u50b3\u611f\u5668\uff0c\u6839\u64da\u4f60\u7684\u9700\u6c42\u9078\u64c7\u5408\u9069\u7684\u50b3\u611f\u5668\u81f3\u95dc\u91cd\u8981\u3002\u4ee5\u4e0b\u662f\u4e00\u4e9b\u5e38\u898b\u7684\u50b3\u611f\u5668\u985e\u578b\uff1a<\/p>\n<ul>\n<li><strong>\u6eab\u5ea6\u50b3\u611f\u5668\uff1a<\/strong>\u7528\u65bc\u6e2c\u91cf\u74b0\u5883\u6216\u7269\u9ad4\u7684\u6eab\u5ea6\u3002<\/li>\n<li><strong>\u6fd5\u5ea6\u50b3\u611f\u5668\uff1a<\/strong>\u7528\u65bc\u6e2c\u91cf\u7a7a\u6c23\u4e2d\u7684\u6c34\u84b8\u6c23\u542b\u91cf\u3002<\/li>\n<li><strong>\u5149\u7167\u50b3\u611f\u5668\uff1a<\/strong>\u7528\u65bc\u6e2c\u91cf\u5149\u7684\u5f37\u5ea6\u3002<\/li>\n<li><strong>\u904b\u52d5\u50b3\u611f\u5668\uff1a<\/strong>\u7528\u65bc\u6aa2\u6e2c\u7269\u9ad4\u7684\u904b\u52d5\u3002<\/li>\n<\/ul>\n<p>\u9078\u64c7\u50b3\u611f\u5668\u6642\uff0c\u9084\u9700\u8003\u616e\u5176\u7cbe\u5ea6\u3001\u7bc4\u570d\u548c\u6210\u672c\u7b49\u56e0\u7d20\u3002<\/p>\n<h2 id=\"3-%e6%95%b8%e6%93%9a%e6%94%b6%e9%9b%86%e6%96%b9%e6%b3%95-LdtGtvrTkx\">3. \u6578\u64da\u6536\u96c6\u65b9\u6cd5<\/h2>\n<p>\u7372\u53d6\u50b3\u611f\u5668\u6578\u64da\u7684\u65b9\u5f0f\u6709\u591a\u7a2e\uff0c\u4ee5\u4e0b\u662f\u5e7e\u7a2e\u5e38\u898b\u7684\u65b9\u6cd5\uff1a<\/p>\n<ul>\n<li><strong>\u76f4\u63a5\u9023\u63a5\uff1a<\/strong>\u5c07\u50b3\u611f\u5668\u76f4\u63a5\u9023\u63a5\u5230\u8a08\u7b97\u6a5f\u6216\u5fae\u63a7\u5236\u5668\u4e0a\uff0c\u901a\u904e\u7de8\u7a0b\u7372\u53d6\u6578\u64da\u3002\u4f8b\u5982\uff0c\u4f7f\u7528Arduino\u6216Raspberry Pi\u4f86\u8b80\u53d6\u50b3\u611f\u5668\u6578\u64da\u3002<\/li>\n<li><strong>\u7121\u7dda\u50b3\u8f38\uff1a<\/strong>\u4f7f\u7528\u7121\u7dda\u6280\u8853\uff08\u5982Wi-Fi\u3001Bluetooth\u6216LoRa\uff09\u5c07\u6578\u64da\u5f9e\u50b3\u611f\u5668\u767c\u9001\u5230\u96f2\u7aef\u6216\u672c\u5730\u4f3a\u670d\u5668\u3002<\/li>\n<li><strong>API\u63a5\u53e3\uff1a<\/strong>\u8a31\u591a\u50b3\u611f\u5668\u63d0\u4f9bAPI\u63a5\u53e3\uff0c\u53ef\u4ee5\u901a\u904eHTTP\u8acb\u6c42\u7372\u53d6\u6578\u64da\u3002\u9019\u7a2e\u65b9\u6cd5\u9069\u5408\u9700\u8981\u9060\u7a0b\u8a2a\u554f\u6578\u64da\u7684\u61c9\u7528\u3002<\/li>\n<\/ul>\n<h3 id=\"%e7%a4%ba%e4%be%8b%ef%bc%9a%e4%bd%bf%e7%94%a8arduino%e7%8d%b2%e5%8f%96%e6%ba%ab%e5%ba%a6%e6%95%b8%e6%93%9a-LdtGtvrTkx\">\u793a\u4f8b\uff1a\u4f7f\u7528Arduino\u7372\u53d6\u6eab\u5ea6\u6578\u64da<\/h3>\n<pre><code>\n#include &lt;DHT.h&gt;\n\n#define DHTPIN 2     \/\/ \u5b9a\u7fa9\u50b3\u611f\u5668\u9023\u63a5\u7684\u5f15\u8173\n#define DHTTYPE DHT11   \/\/ \u5b9a\u7fa9\u50b3\u611f\u5668\u985e\u578b\n\nDHT dht(DHTPIN, DHTTYPE);\n\nvoid setup() {\n  Serial.begin(9600);\n  dht.begin();\n}\n\nvoid loop() {\n  delay(2000);\n  float h = dht.readHumidity();\n  float t = dht.readTemperature();\n  \n  Serial.print(\"Humidity: \");\n  Serial.print(h);\n  Serial.print(\" %t\");\n  Serial.print(\"Temperature: \");\n  Serial.print(t);\n  Serial.println(\" *C\");\n}\n<\/code><\/pre>\n<h2 id=\"4-%e6%95%b8%e6%93%9a%e5%ad%98%e5%84%b2%e8%88%87%e7%ae%a1%e7%90%86-LdtGtvrTkx\">4. \u6578\u64da\u5b58\u5132\u8207\u7ba1\u7406<\/h2>\n<p>\u7372\u53d6\u6578\u64da\u5f8c\uff0c\u5982\u4f55\u5b58\u5132\u548c\u7ba1\u7406\u9019\u4e9b\u6578\u64da\u4e5f\u662f\u4e00\u500b\u91cd\u8981\u7684\u8003\u91cf\u3002\u5e38\u898b\u7684\u6578\u64da\u5b58\u5132\u65b9\u5f0f\u5305\u62ec\uff1a<\/p>\n<ul>\n<li><strong>\u6578\u64da\u5eab\uff1a<\/strong>\u4f7f\u7528\u95dc\u4fc2\u578b\u6578\u64da\u5eab\uff08\u5982MySQL\uff09\u6216\u975e\u95dc\u4fc2\u578b\u6578\u64da\u5eab\uff08\u5982MongoDB\uff09\u4f86\u5b58\u5132\u6578\u64da\u3002<\/li>\n<li><strong>\u96f2\u5b58\u5132\uff1a<\/strong>\u5229\u7528\u96f2\u670d\u52d9\u63d0\u4f9b\u5546\uff08\u5982AWS\u3001Google Cloud\uff09\u4f86\u5b58\u5132\u548c\u7ba1\u7406\u6578\u64da\uff0c\u65b9\u4fbf\u64f4\u5c55\u548c\u8a2a\u554f\u3002<\/li>\n<\/ul>\n<h2 id=\"5-%e6%95%b8%e6%93%9a%e5%88%86%e6%9e%90%e8%88%87%e5%8f%af%e8%a6%96%e5%8c%96-LdtGtvrTkx\">5. \u6578\u64da\u5206\u6790\u8207\u53ef\u8996\u5316<\/h2>\n<p>\u7372\u53d6\u4e26\u5b58\u5132\u6578\u64da\u5f8c\uff0c\u9032\u884c\u6578\u64da\u5206\u6790\u548c\u53ef\u8996\u5316\u662f\u975e\u5e38\u91cd\u8981\u7684\u3002\u53ef\u4ee5\u4f7f\u7528\u5404\u7a2e\u5de5\u5177\u548c\u5eab\u4f86\u5206\u6790\u6578\u64da\uff0c\u4f8b\u5982Python\u7684Pandas\u548cMatplotlib\uff0c\u6216\u4f7f\u7528\u5c08\u696d\u7684\u6578\u64da\u53ef\u8996\u5316\u5de5\u5177\u5982Tableau\u3002<\/p>\n<h2 id=\"%e7%b8%bd%e7%b5%90-LdtGtvrTkx\">\u7e3d\u7d50<\/h2>\n<p>\u7372\u53d6\u50b3\u611f\u5668\u6578\u64da\u5eab\u7684\u904e\u7a0b\u6d89\u53ca\u591a\u500b\u6b65\u9a5f\uff0c\u5305\u62ec\u78ba\u5b9a\u6578\u64da\u9700\u6c42\u3001\u9078\u64c7\u5408\u9069\u7684\u50b3\u611f\u5668\u3001\u6578\u64da\u6536\u96c6\u65b9\u6cd5\u3001\u6578\u64da\u5b58\u5132\u8207\u7ba1\u7406\uff0c\u4ee5\u53ca\u6578\u64da\u5206\u6790\u8207\u53ef\u8996\u5316\u3002\u901a\u904e\u9019\u4e9b\u6280\u5de7\uff0c\u60a8\u53ef\u4ee5\u6709\u6548\u5730\u7372\u53d6\u548c\u5229\u7528\u50b3\u611f\u5668\u6578\u64da\uff0c\u70ba\u60a8\u7684\u9805\u76ee\u63d0\u4f9b\u652f\u6301\u3002\u5982\u679c\u60a8\u9700\u8981\u7a69\u5b9a\u7684\u6578\u64da\u5b58\u5132\u548c\u8655\u7406\u80fd\u529b\uff0c\u8003\u616e\u4f7f\u7528<a href=\"https:\/\/server.hk\">\u9999\u6e2fVPS<\/a>\u6216<a href=\"https:\/\/server.hk\">\u96f2\u4f3a\u670d\u5668<\/a>\u4f86\u6eff\u8db3\u60a8\u7684\u9700\u6c42\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u63a2\u7d22\u7372\u53d6\u50b3\u611f\u5668\u6578\u64da\u5eab\u7684\u6280\u5de7\uff0c\u4e86\u89e3\u6709\u6548\u65b9\u6cd5\u548c\u8cc7\u6e90\uff0c\u52a9\u60a8\u8f15\u9b06\u7372\u5f97\u6240\u9700\u7684\u6578\u64da\u3002<\/p>\n","protected":false},"author":0,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[101],"tags":[],"class_list":["post-161121","post","type-post","status-publish","format-standard","hentry","category-database"],"_links":{"self":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/161121","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/types\/post"}],"replies":[{"embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/comments?post=161121"}],"version-history":[{"count":1,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/161121\/revisions"}],"predecessor-version":[{"id":161122,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/161121\/revisions\/161122"}],"wp:attachment":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/media?parent=161121"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/categories?post=161121"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/tags?post=161121"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}