{"id":733,"date":"2026-07-15T01:11:01","date_gmt":"2026-07-14T17:11:01","guid":{"rendered":"https:\/\/www.iaban.cc\/?p=733"},"modified":"2026-07-15T01:11:01","modified_gmt":"2026-07-14T17:11:01","slug":"node-red-4-1-10%ef%bc%9a%e7%94%a8%e5%8f%af%e8%a7%86%e5%8c%96%e6%b5%81%e7%a8%8b%e8%bf%9e%e6%8e%a5-api%e3%80%81%e8%ae%be%e5%a4%87%e4%b8%8e%e8%87%aa%e5%8a%a8%e5%8c%96%e4%bb%bb%e5%8a%a1","status":"publish","type":"post","link":"https:\/\/www.iaban.cc\/index.php\/733\/","title":{"rendered":"Node-RED 4.1.10\uff1a\u7528\u53ef\u89c6\u5316\u6d41\u7a0b\u8fde\u63a5 API\u3001\u8bbe\u5907\u4e0e\u81ea\u52a8\u5316\u4efb\u52a1"},"content":{"rendered":"<p>Node-RED \u7528\u53ef\u89c6\u5316\u8282\u70b9\u548c\u8fde\u7ebf\u7ec4\u7ec7\u4e8b\u4ef6\u9a71\u52a8\u6d41\u7a0b\uff0c\u9002\u5408\u628a HTTP API\u3001MQTT\u3001\u6570\u636e\u5e93\u3001\u8bbe\u5907\u3001\u5b9a\u65f6\u4efb\u52a1\u548c\u81ea\u5b9a\u4e49 JavaScript \u4e32\u6210\u4e00\u6761\u53ef\u89c2\u5bdf\u3001\u53ef\u91cd\u590d\u90e8\u7f72\u7684\u81ea\u52a8\u5316\u94fe\u8def\u3002\u5b83\u65e2\u80fd\u8dd1\u5728\u4e2a\u4eba\u7535\u8111\u548c\u6811\u8393\u6d3e\u4e0a\uff0c\u4e5f\u80fd\u901a\u8fc7 Docker \u90e8\u7f72\u5230\u670d\u52a1\u5668\u3002<\/p>\n<figure>\n  <img decoding=\"async\" src=\"https:\/\/nodered.org\/about\/resources\/media\/node-red-icon.png\" alt=\"Node-RED \u5b98\u65b9\u9879\u76ee\u56fe\u6807\" loading=\"lazy\" style=\"max-width:480px;width:100%;height:auto;\" \/><figcaption>Node-RED \u4f7f\u7528\u6d4f\u89c8\u5668\u7f16\u8f91\u5668\u7f16\u6392\u4e8b\u4ef6\u9a71\u52a8\u6d41\u7a0b\u3002<\/figcaption><\/figure>\n<h2>\u9002\u5408\u5904\u7406\u4ec0\u4e48<\/h2>\n<ul>\n<li>\u5b9a\u65f6\u8bf7\u6c42 API\uff0c\u6e05\u6d17\u8fd4\u56de\u503c\u540e\u5199\u5165\u6570\u636e\u5e93\u3001\u6587\u4ef6\u6216\u6d88\u606f\u961f\u5217\u3002<\/li>\n<li>\u8fde\u63a5 MQTT\u3001\u4e32\u53e3\u3001GPIO \u4e0e Webhook\uff0c\u5feb\u901f\u642d\u5efa\u8bbe\u5907\u548c\u670d\u52a1\u8054\u52a8\u3002<\/li>\n<li>\u7528 Inject\u3001Change\u3001Function\u3001Switch\u3001Debug \u7b49\u8282\u70b9\u62fc\u88c5\u53ef\u89c6\u5316\u6d41\u7a0b\u3002<\/li>\n<li>\u628a\u6d41\u7a0b\u4fdd\u5b58\u4e3a JSON\uff0c\u4fbf\u4e8e\u5907\u4efd\u3001\u8fc1\u79fb\u548c\u4ee3\u7801\u5ba1\u67e5\u3002<\/li>\n<\/ul>\n<h2>\u73af\u5883\u4e0e\u4f9d\u8d56<\/h2>\n<ul>\n<li><strong>\u5f53\u524d\u7a33\u5b9a\u7248\uff1a<\/strong>4.1.10\u3002<\/li>\n<li><strong>\u5e73\u53f0\uff1a<\/strong>Windows\u3001macOS\u3001Linux\u3001Raspberry Pi\u3001Docker\u3002<\/li>\n<li><strong>\u4f9d\u8d56\uff1a<\/strong>\u672c\u5730\u5b89\u88c5\u9700\u8981\u53d7\u652f\u6301\u7684 Node.js \u4e0e npm\uff1b\u5bb9\u5668\u65b9\u5f0f\u9700\u8981 Docker\u3002<\/li>\n<li><strong>\u8bb8\u53ef\uff1a<\/strong>Apache License 2.0\u3002<\/li>\n<\/ul>\n<h2>\u4e94\u5206\u949f\u9a8c\u8bc1<\/h2>\n<p>\u5df2\u7ecf\u5b89\u88c5 Node.js \u7684\u73af\u5883\u53ef\u6267\u884c\uff1a<\/p>\n<pre><code>npm install -g node-red\r\nnode-red<\/code><\/pre>\n<ol>\n<li>\u6d4f\u89c8\u5668\u6253\u5f00 <code>http:\/\/127.0.0.1:1880\/<\/code>\u3002<\/li>\n<li>\u4ece\u5de6\u4fa7\u62d6\u5165\u4e00\u4e2a <strong>Inject<\/strong> \u8282\u70b9\u548c\u4e00\u4e2a <strong>Debug<\/strong> \u8282\u70b9\uff0c\u5e76\u628a\u4e24\u8005\u8fde\u8d77\u6765\u3002<\/li>\n<li>\u70b9\u51fb\u53f3\u4e0a\u89d2 <strong>Deploy<\/strong>\uff0c\u518d\u70b9\u51fb Inject \u8282\u70b9\u5de6\u4fa7\u6309\u94ae\u3002<\/li>\n<li>\u53f3\u4fa7 Debug \u9762\u677f\u51fa\u73b0\u65f6\u95f4\u6233\u6216\u6d88\u606f\u5bf9\u8c61\uff0c\u5373\u8bf4\u660e\u8fd0\u884c\u65f6\u3001\u7f16\u8f91\u5668\u548c\u57fa\u7840\u6d41\u7a0b\u90fd\u6b63\u5e38\u3002<\/li>\n<\/ol>\n<p>Docker \u7528\u6237\u53ef\u5148\u7528\u5b98\u65b9\u5feb\u901f\u547d\u4ee4\u9a8c\u8bc1\uff0c\u5e76\u7528\u547d\u540d\u5377\u4fdd\u7559\u6d41\u7a0b\uff1a<\/p>\n<pre><code>docker run -it -p 1880:1880 -v node_red_data:\/data --name mynodered nodered\/node-red<\/code><\/pre>\n<h2>\u9690\u79c1\u4e0e\u5b89\u5168<\/h2>\n<p>\u6d41\u7a0b\u6587\u4ef6\u548c\u8fd0\u884c\u914d\u7f6e\u9ed8\u8ba4\u4f4d\u4e8e Node-RED \u7684\u7528\u6237\u76ee\u5f55\uff0c\u5177\u4f53\u6570\u636e\u662f\u5426\u79bb\u5f00\u672c\u673a\u53d6\u51b3\u4e8e\u6d41\u7a0b\u4e2d\u8fde\u63a5\u7684 API\u3001\u6570\u636e\u5e93\u3001MQTT \u6216\u5176\u4ed6\u5916\u90e8\u670d\u52a1\u3002\u4e0d\u8981\u628a\u672a\u914d\u7f6e\u8ba4\u8bc1\u7684\u7f16\u8f91\u5668\u76f4\u63a5\u66b4\u9732\u5230\u516c\u7f51\uff1b\u5bf9\u5916\u90e8\u7f72\u65f6\u5e94\u6309\u5b98\u65b9\u5b89\u5168\u6307\u5357\u542f\u7528\u8d26\u53f7\u8ba4\u8bc1\u3001HTTPS\u3001\u53cd\u5411\u4ee3\u7406\u548c\u6700\u5c0f\u6743\u9650\uff0c\u5e76\u59a5\u5584\u4fdd\u62a4\u6d41\u7a0b\u4e2d\u7684\u51ed\u636e\u3002<\/p>\n<h2>\u8d44\u6e90\u5165\u53e3<\/h2>\n<p><a href=\"https:\/\/nodered.org\/docs\/getting-started\/local\" target=\"_blank\" rel=\"noopener\">\u6253\u5f00 Node-RED \u5b98\u65b9\u672c\u5730\u5b89\u88c5\u6587\u6863<\/a><\/p>\n<p><a href=\"https:\/\/github.com\/node-red\/node-red\/releases\/tag\/4.1.10\" target=\"_blank\" rel=\"noopener\">\u67e5\u770b Node-RED 4.1.10 \u5b98\u65b9\u53d1\u5e03\u8bf4\u660e<\/a><\/p>\n<p>\u6838\u9a8c\u65e5\u671f\uff1a2026-07-15<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Node-RED \u662f\u9762\u5411\u4e8b\u4ef6\u9a71\u52a8\u81ea\u52a8\u5316\u7684\u4f4e\u4ee3\u7801\u5de5\u5177\uff0c\u53ef\u7528\u8282\u70b9\u8fde\u63a5 API\u3001\u6d88\u606f\u3001\u8bbe\u5907\u4e0e\u811a\u672c\uff0c\u5e76\u652f\u6301\u672c\u673a\u3001\u6811\u8393\u6d3e\u6216 Docker \u90e8\u7f72\u3002<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[115],"tags":[209,210,206,208,207],"class_list":["post-733","post","type-post","status-publish","format-standard","hentry","category-toolbox-automation","tag-api","tag-docker","tag-node-red","tag-208","tag-207"],"_links":{"self":[{"href":"https:\/\/www.iaban.cc\/index.php\/wp-json\/wp\/v2\/posts\/733","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.iaban.cc\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.iaban.cc\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.iaban.cc\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.iaban.cc\/index.php\/wp-json\/wp\/v2\/comments?post=733"}],"version-history":[{"count":1,"href":"https:\/\/www.iaban.cc\/index.php\/wp-json\/wp\/v2\/posts\/733\/revisions"}],"predecessor-version":[{"id":740,"href":"https:\/\/www.iaban.cc\/index.php\/wp-json\/wp\/v2\/posts\/733\/revisions\/740"}],"wp:attachment":[{"href":"https:\/\/www.iaban.cc\/index.php\/wp-json\/wp\/v2\/media?parent=733"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.iaban.cc\/index.php\/wp-json\/wp\/v2\/categories?post=733"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.iaban.cc\/index.php\/wp-json\/wp\/v2\/tags?post=733"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}