我想将异步数据发送到配置中的节点。我想执行一个SQL请求以列出中的一些数据。
另外,二进制文件可以每隔x分钟请求数据库并创建一个缓存,每个节点将在创建时使用该缓存,这将删除代码的异步部分,即使不再“实时更新”也是如此。
实际上,我陷入困境是因为我创建了查询并将其添加如下:
module.exports = function(RED) {
"use strict";
var db = require("../bin/database")(RED);
function testNode(n) {
// Create a RED node
RED.nodes.createNode(this,n);
// Store local copies of the node configuration (as defined in the
.html
var node = this;
var context = this.context();
this.on('input', function (msg) {
node.send({payload: true});
});
}
RED.nodes.registerType("SQLTEST",testNode);
}
Run Code Online (Sandbox Code Playgroud)
但是我不知道如何将数据传递到配置节点。我想到了Socket.IO可以做到这一点,但这是一个好主意并且可用吗?你知道什么解决方案吗?
我在装有Cent OS 7.x和Apache 2.4.6 (CentOS)的虚拟机上安装了NodeRed 。
\n\n如果我打开 URL http://10.1.1.1:1880/,一切正常。我可以部署节点并查看调试。但我需要在特殊位置上使用 Node Red。\n下一步是在我的 httpd.conf 中配置代理通行证。
结果:红色节点可在http://10.1.1.1/nr/。但几秒钟后我收到以下错误消息。
Lost connection to server, reconnecting in 44s. Try now\nRun Code Online (Sandbox Code Playgroud)\n\n然后我尝试了相同的操作,还将端口配置添加到 443,\n结果:红色节点可用,https://10.1.1.1/nr/并且它正在工作几秒钟。然后出现相同的错误消息(+或\xe2\x80\x93几秒钟)
Lost connection to server, reconnecting in 54s. Try now\nRun Code Online (Sandbox Code Playgroud)\n\n然后我在浏览器中检查了控制台\n错误代码:
\n\nWebSocket connection to 'ws://10.1.1.1/nr/comms' failed: Error during WebSocket handshake: Unexpected response code: 404 a @ red.min.js:16\nRun Code Online (Sandbox Code Playgroud)\n\n好吧,看来这是 WebSocket 的问题。\n如果有人有一个想法,那就太好了,因为我尝试了不同的解决方案添加了加载模块,但目前还没有真正的想法。一切顺利。
\n\nps:这是我在 httpd.conf 中的代理通行证设置
\n\n<VirtualHost *:80>\n ServerName 10.1.1.1\n RewriteEngine …Run Code Online (Sandbox Code Playgroud) 当前,每次在开发过程中对Node-RED节点进行更改时,都需要停止并启动服务器以应用更改。如果有些微小的变化,甚至只是编辑标签,甚至都需要这样做。
如何在不重新启动服务器的情况下在Node-RED中重新加载节点?可能吗?
如何更改节点红色页面标题?
我在 node-red 的 github 页面上看到了一个关于这个的问题。但我不明白我需要更改哪个文件。
哪个文件需要改?我需要安装一个节点来编辑主题吗?
有没有办法定制Node-red UI(Web Portal)?我尝试获取 node-red git repo 但无法找到它。
对于节点红色的新功能项目-可以与git repo同步的项目,我需要ssh-keygen在Alpine docker Image中。根据v3.6的Alpine Linux软件包,它位于openssh-keygen软件包中。
因此,我在Dockerfile中添加了如下的RUN命令,但是没有运气。
......
RUN apk update && \
apk add --no-cache \
openssh-keygen
......
Run Code Online (Sandbox Code Playgroud)
然后,通过从Image创建一个容器docker exec -it containername sh,然后执行a 然后键入ssh-keygen- 进行测试,以查看它是否进入Image中,但找不到它。
如果我在Dockerfile中的RUN命令下替换为openssh-keygen,也无法正常工作openssh。
有人可以指出正确的方向吗?
嗨,我在“模板”节点遇到问题。我尝试访问全局变量,但出现“全局未定义”之类的错误。请帮我..
我正在尝试使用node-red作为前端来与我正在构建的 REST API 进行交互。我的 API 使用 https,但在我的本地服务器上,证书设置不完美,当我尝试使用“http 请求”节点时,出现错误:
UNABLE_TO_VERIFY_LEAF_SIGNATURE
Run Code Online (Sandbox Code Playgroud)
有没有办法将 node-red 配置为不那么严格并允许 SSL 协议错误并继续处理 http 请求?是否有人创建了自己的“http 请求”节点版本,该版本不像默认节点那么严格?
(在 Google Chome 浏览器中,我有一个绿色挂锁,所以 SSL 几乎是正确的,红色节点非常挑剔)
要运行 node-red,我使用 docker:
docker run -dp 1880:1880 -v ~/.node-red:/root/.node-red --name node-red cpswan/node-red
Run Code Online (Sandbox Code Playgroud)
这是我的节点红色项目源代码:
[{"id":"e246fcb9.1db9","type":"inject","name":"Trigger user/me","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"x":200,"y":140,"z":"e7bac913.184538","wires":[["f9d78108.06288"]]},{"id":"96b8b92c.694748","type":"http request","name":"user/me","method":"GET","ret":"obj","url":"https://local.supertasker.com/api/user/me","x":711,"y":141,"z":"e7bac913.184538","wires":[["5150419b.aeafc"]]},{"id":"5150419b.aeafc","type":"debug","name":"","active":true,"console":"false","complete":"false","x":906,"y":140,"z":"e7bac913.184538","wires":[]},{"id":"f9d78108.06288","type":"function","name":"Add 'Accept:application/json' header","func":"\nmsg.headers = {\n 'Accept':'application/json'\n};\n\n// Return the message so it can be sent on\nreturn msg;","outputs":1,"valid":true,"x":464,"y":140,"z":"e7bac913.184538","wires":[["96b8b92c.694748"]]}]
Run Code Online (Sandbox Code Playgroud) 我正在使用电子邮件节点连接到 gmail。我在节点上收到“错误 - 无效登录”。
在电子邮件节点中,我设置了以下参数:
To: email-i-want-to-email-to@anymail.com
Server: smtp.gmail.com
Port: 465 (which I believe is an SSL port as per the link below)
UserID: gmail-account (or should this be gmail-account@gmail.com - I've tried both)
Password: the password on the "gmail-account"
Name: email out
Run Code Online (Sandbox Code Playgroud)
这符合我在以下论坛中找到的内容,但我收到了 https://productforums.google.com/forum/#!topic/gmail/IWiwVluINfs 关于为什么我会收到错误的建议?
在守护程序工具的帮助下,我让 Node-Red 作为 Windows 服务运行。不幸的是它停止工作了。不知道为什么。我创建了一些流,希望从 node-red 中检索这些流,以便我可以从头开始重新安装 node-red 并使用我已经创建的流。谁能帮助我了解流量的实际存储位置以及配置、软件包安装的详细信息?对此的任何帮助都将受到高度赞赏。
node-red ×10
node.js ×2
alpine-linux ×1
apache ×1
centos ×1
dockerfile ×1
email ×1
ibm-cloud ×1
javascript ×1
login ×1