Best way to install Node-Red on openWRT

I am working with Node-Red on various platforms and now I need to install Node-Red on openWRT
What is the best way to install Node-Red on openWRT?

have you tried a google searching openwrt node-red?

Yes,
The first option that appears is:

although this software has not been updated for more than two years
The second option that I am going to try is to install node-npm and from there Node-Red
Has anyone successfully tried one of these two options?

Did you try that solution? Just to let you know the author of that is one of the original developers of Node-RED and is still working on it….
Although it’s probably an old release….

A github issue opened 8 days ago might be informative:

1 Like

Hi,
indeed it is old... as noted in that Issue - "I haven't updated this for a long while so this package itself is well behind the curve, and I don't have an immediate need for it so won't have time to update in the near term. "
The old one was using node v8 I think which is no longer supported at all... Hopefully the latest nodejs for openwrt uses 14 or better - in which case you should be able to just install Node-RED on top. The main issue used to be (and may still be) that the default image only had a tiny amount of storage so the Node-RED install would blow that when it needed the build tools... so I had to expand the base memory - do the install - then shrink it back down to fit the device I wanted to use.

2 Likes

thank you for your answer, it has helped me a lot
I am working with Energy Communities and looking for solutions for energy measurement and control, for which openWRT seems to me to be a good tool. Unfortunately I am learning and I am getting into the operating system little by little.
The latest device I have purchased is a GL-inet GL-A1300 which has an IPQ4018 processor. This processor does not support node-npm and therefore I cannot try to install node-red as I would like.
I'll make sure the next device I buy supports node-npm so I can test your suggestion.

Best regards
Oscar

Hi @iotlibre.

I'm interested in energy monitoring solutions (aren't we all, considering the price!)

Why did you choose openwrt as the platform?

I think the go-to low power platform used to be a raspberry pi. Sadly they are almost unobtainable nowadays.

Just because you can't easily install Node-Red on it doesn't mean it's totally unusable. Is Node.js something that can be installed on it? I would imagine if you were getting to the point of trying Node-Red, perhaps Node.js was a success. That would at least give you Javascripting abilities, which is still a powerful way of using the device.

Also, what is it you're trying to do with Node-Red? What's the project you're trying to work it into? Perhaps it may not fit on this device by itself. But perhaps there's a way to put Node-Red somewhere else and still utilize it with the device.

GL-Inet MV1000 (Brume), 1GB memory, OpenWRT 21.02:

$ opkg list node
node - v14.20.1-1 - Node.js® is a JavaScript runtime built on Chrome's V8 JavaScript engine.

With 256MB of RAM on the A1300 I fear that any joy with node.js would be rather short-lived...

You would be surprised how efficient they try to make it. For perspective, the original Raspberry Pi model B had only 256 MB of RAM. I happen to have one, and it runs Raspian AND Node-Red at the same time rather happily. The only time it has problems is when I try to make the Pi itself render several dozen charts, which isn't a good idea for any small or underpowered system.

That unit of yours sounds quite capable, even if the library you have to choose from is outdated. It's a shame Node-Red doesn't have an install for it. That would make everything a lot easier. What's your project you're trying to build? I always find projects that use underutilized routers or other network devices fascinating. I have a PogoPlug v4 I played with a long time ago. This makes me almost want to dig it out again...

As long as you can get node14 and npm then you should be able to install it using

npm i -g --unsafe-perm node-red

then if you copy the init script form here - openwrt-node-red/node-red at master · dceejay/openwrt-node-red · GitHub into /etc/init.d/node-red that should allow you to run it as a service.

Feel free to borrow as much as you need from that project.. indeed updates/pull requests would be much appreciated :slight_smile:

Am I right in thinking that there may be problems installing some nodes if the appropriate development tools are not available? Compilers and so on.

Yes, of course. The shortcut above will skip them, but they aren't necessary for the core capability (and take up loads of room which may not be available on the smaller devices openwrt typically runs on.) ... Plus I didn't want to add anything that may be architecture specific if I could help it :slight_smile: