node-red | Low-code programming for event-driven applications | Runtime Evironment library
kandi X-RAY | node-red Summary
kandi X-RAY | node-red Summary
Low-code programming for event-driven applications
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Verify dependencies .
- Generate a script script for a script
- Update a module package . json
- Replace contents of a file .
node-red Key Features
node-red Examples and Code Snippets
Community Discussions
Trending Discussions on node-red
QUESTION
I am trying to build a container containing 3 applications, for example:
- Grafana;
- Node-RED;
- NGINX.
So I will just need to expose one por, for example:
NGINX reverse proxy on port 3001/grafana redirects to grafana on port 3000 and; NGINX reverse proxy on port 3001/nodered redirects to nodered on port 1880.
Does it make any sense in your vision? Or this architecture is not feasible if compared to docker compose?
...ANSWER
Answered 2022-Mar-28 at 15:59If I understand correctly, your concern is about opening only one port publicly.
For this, you would be better off building 3 separate containers, each with their own service, and all in the same docker network. You could plug your services like you described within the virtual network instead of within the same container.
Why ? Because containers are specifically designed to hold the environment for a single application, in order to provide isolation and reduce compatibility issues, with all the network configuration done at a higher level, outside of the containers.
Having all your services inside the same container thwart these mentioned advantages of containerized applications. It's almost like you're not even using containers.
QUESTION
I have just finished setting up Node-red on the a cloud machine hosted with vultr ( Ubuntu 20.04 x64 ) and I am wanting to be able to hit the Node-Red web page but I am failing to do so.
I have setup WireGuard so I can VPN into the machine
I am able to ping the servers Local IP address from my Windows PC
But I am still unable to hit the Node-Red Web Page
Even though Node-Red is running
I am fairly new to working with cloud machines so any help would be highly appreciated.
...ANSWER
Answered 2022-Mar-26 at 15:53I'm going to guess that you haven't opened port 1880 for the server.
This could be in one of 2 places
- Vultr appear to have their own firewall which you will need to ensure a suitable rule to allow TCP traffice on port 1880 exists. How to configure the firewall appears to be documented here https://www.vultr.com/docs/vultr-firewall-quickstart-guide/
- You will need to make sure that the port is open in the Ubuntu Firewall as well. Running
sudo ufw allow 1880/tcp
should do this.
QUESTION
const express = require("express");
const redis = require("redis");
const app = express();
const client = redis.createClient({
url: "redis://admin123@ec2-35-182-15-126.ca-central-1.compute.amazonaws.com",
});
client.on("connect", function () {
console.log("redis connected");
console.log(`connected ${redisClient.connected}`);
});
client.on("error", (err) => {
console.log(err);
});
app.listen(process.env.PORT || 3000, () => {
console.log("Node server started");
});
...ANSWER
Answered 2021-Nov-28 at 17:30Please check your ec2 redis connection
QUESTION
I have one system that is connected to some sensors. The main job is to send error numbers when one or more of the sensors are on.
In order to print the error description I have one csv-File with two columns, the first one with the numbers and the second one with the description.
In order to make this task I have created one flow in Node-Red:
- In one line I save the array with the error numbers coming from the system in one flow variable (RandomNum).
- In another line I read the csv-file with the error description, I transform it in an array of objects and then in fuction node I make a search in order to find the error number and the description.
The search function has as entance the array of objects. I save the flow variable (RandomNum) in an array (ranNum) and I define a new array (newMsg) where I save the description of the errors. Then I use a while-loop in order to go through the array of objects and compare the value of the first column of this array with the number in ranNum. Then I save the description of the error in the array newMsg and I do this while-loop for each value of the ranNum array.
And here is my problem. When I execute the flow, it works correctly for the first value of the array ranNum but only for this. I get only the description of the first number in the ranNum array as payload, it looks like as the while-loop is used only once, and then it breaks and gives me the array newMsg.
When I check in the Conetxt, RandomNum is one array,
An when I ask to get the array ranNum, it's also an array,
I have check the while-loop at least 20-times, and I have did not found why it does not work.
Can anyone help me with this topic? Is there a problem with the flow variable or there is big difference between JavaScript and NodeJS that I did not found?
Here is the flow I have created:
...ANSWER
Answered 2022-Mar-14 at 20:07So, I finally found it. The payload in the while-loop was breaking the loop immediately. So I changed the code in the while-loop using a similar code I found on the net. Now it works.
Old code:
QUESTION
I made a flow to a chatbot on node-red using the IBM cloud AI through http connections and I have the following problem, when sending simultaneous messages in different chats/accounts, this error occurs: "Error: Cannot set headers after they are sent to the client". I know it's related to the request that it can't be overridden. But what would be the way to have multiple devices accessing the same flow without interfering with the request already in progress?
I'm simulating sending messages through facebook messenger and instagram
thanks for the time
...ANSWER
Answered 2022-Mar-08 at 21:31The last change node implies you are stashing the msg.res
field somewhere and putting it back.
I'm guessing you are using the same context variable to do this so it's getting overwritten by the second invocation, so both events try to respond on the last msg.res
and the second one fails because they can only be used once.
You shouldn't need to do this if all the nodes in the flow behave properly and don't discard msg
properties. If there is a node discarding properties then you should raise an issue with it's author to get it fixed.
In the meantime you need to make sure each invocation keeps track of it's own msg.res
which may mean storing it under a unique id (possibly msg._id
but if a node is discarding properties this might also change) to they all respond to the correct session.
QUESTION
I just got started with svelte and was trying to make an app with redis as the db. I made a typescript file with all the db functions I would need and tried to import it into my svelte components, but when I did that I got the following error
...ANSWER
Answered 2022-Jan-04 at 20:45Normally, because the redis - npm package is designed for Node.js, I would say to follow How to use npm modules in browser? and use browserify
so that it's able to run in the browser.
After reading Can I connect directly to a Redis server from JavaScript running in a browser?, I would say that you need a server-side setup to connect to your redis server and then you can query your server-side as you need.
QUESTION
I am trying to customize the Split node in Node-Red in a way to send the next message only when the first arrives to the Join node; as I am doing some processing in between, and would like to process each msg separately before joining them.
So I have cloned the Split node from Node-Red project, and at the part where the splitting of an array happens; I register listeners to events (random IDs generated by the original Split node).
...ANSWER
Answered 2022-Mar-04 at 12:21Modifying the split node is the wrong way to do this.
There are rate limiting nodes that will do this for you. e.g. https://flows.nodered.org/node/node-red-contrib-semaphore
Or you can use the delay node with it's release function
QUESTION
Today, I wanted to download a module via NPM.
Thought, because Node.js can't find the NPM modules that I install, maybe, I need to run NPM via the admin PowerShell, in the folder C:\Program Files\nodejs\node_modules
. So, did it, ran the command:
ANSWER
Answered 2022-Feb-28 at 13:14Thank you, @Anis, for the answer.
- Run the Node.js installer (if you haven't deleted it)
- Click
Next
, thenRepair
.
- Then, click
Repair
again and wait - Click
Finish
Now you should have theC:\Program Files\nodejs\node_modules\npm
module.
QUESTION
I am using Node-red to connect to SFTP and to get a file. Th Problem is that it returns always this error:
"Error: sftp.realPath: The "string" argument must be of type string or an instance of Buffer or ArrayBuffer. Received type number (1645531908336) 1645531908336"
Note: I did not get this error on "List" and i have tried many SFTP servers. Always the same error
this is the image of my node
...ANSWER
Answered 2022-Feb-22 at 14:401645531908336
looks like it is the timestamp from a standard msg.payload
value from an inject node.
Assuming this is the node-red-contrib-better-sftp node then it looks like it is badly written and will always take the value of msg.payload
and override any configured path and filename in the node config. This is a really bad design and should only use the input message if the value is left blank in the config.
So the quick option for you to test is to remove the msg.payload
from the inject node you are testing with.
You should also raise an issue with the nodes author to fix this behaviour.
EDIT: There already is an open issue (from mid 2020) https://github.com/sublime93/node-red-contrib-better-sftp/issues/9
QUESTION
I am trying to send data from Flutter to Node-RED (to Raspberry Pi) over HTTP (not HTTPS). The URL http://bierbrauserver.ddns.net is from NO-IP (DDNS). The transfer to a test server from a Youtube Tutorial works fine. But when I change the URL from "https://reqres.in/api/users" to "http://bierbrauserver.ddns.net:1880" I get no input in the debug window of Node-RED. I tried in the AndroidManifest.xml to add the entry so that http is allowed, but that didn't solve the problem either. Furthermore I checked the port forwarding in the WLAN router configuration of the network where the Raspberry Pi is located. Here a port forwarding of HTTP and 1880 (Node-RED) was configured. The connection of the IP addresses should be ok, because I can access a database from an external port, which is also located on the Raspberry Pi. Can it be that only httpS post requests are possible ?
...ANSWER
Answered 2022-Feb-18 at 14:20Change your code to this:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install node-red
sudo npm install -g --unsafe-perm node-red
node-red
Open http://localhost:1880
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page