NodeRed version updates

For my Ekrano I installed the 3.60 large image. This included NodeRed V3.1 while V4 release is from June 2024.

Is there any reason for not including latest version in large image - e.g. Node.js 22?

Are there any instructions on how to update manually?

@Janvi
Is there a feature that you need from the latest version of Node Red? My policy is that if it ain’t broken, don’t fix it.
F.

It is integrated into the large image and can’t be manually updated, if you want to run a separate nodered instance on dedicated hardware you can.
There will be dependencies with the existing nodes and integrations and stability and interoperability is important.

The underlying node.js 16.x of NodeRed 3.1 reached end of life in 2023. Seems easy to screw up the node.js runtime using NodeRed loops containing erreonous parameter passings. I crashed my Cerbo for the productive ESS several times while playing around with flows. The flows caused this, were finally disappeard after I brought NodeRed back to operation.

For this reason, I set up a new standalone Ekrano to play around with the Node toys and make sure the flows do what they should before they were used with the ESS.

Here is a simple flow for traffic lights tested sucessfully. Its using a loop without parameter passing. Edit the state machine line 30 from “return null” to “return msg” will screw up node.js runtime. Never try at a used system as NodeRed crashs. Port 1881 never comes back. Also had the case, that complete Venus did a reboot what shouldnt be true.

[{"id":"be3ab1ef.3f0a68","type":"tab","label":"Traffic Lights using delays and events","disabled":false,"info":"This is a state machine example for Node Red. Graphical FSM  representation is done using Mermaid code what what is supported up from NodeRed V3.1. To be recognized, the mermaid code needs to be included in three tilde characters followed by the keyword mermaid. This tilde character is only available at the key beside backspace and can be accessed by pressing the shift key only. \n\nTo get a good FSM design, never use composite states, nor fork and join. \n\n```mermaid\nstateDiagram-v2\n    [*] --> red\n    red --> red_yellow : time\n    red_yellow --> green : time\n    green --> yellow : time\n    yellow --> red : time\n```\n","env":[]},{"id":"743e732.c12228c","type":"function","z":"be3ab1ef.3f0a68","name":"Decode RED light","func":"var LocalState = flow.get(\"GlobalState\");\n\nif (LocalState === 0 || LocalState == 1)\n   {msg.payload = 1;\n    node.status({fill:\"red\",shape:\"dot\",text:\"Red ON\"});\n   }\n   \nelse\n   {msg.payload = 0;\n    node.status({});\n   }\nreturn msg;\n","outputs":1,"timeout":"","noerr":0,"initialize":"","finalize":"","libs":[],"x":970,"y":120,"wires":[[]]},{"id":"778d9f53.8e5f7","type":"function","z":"be3ab1ef.3f0a68","name":"Decode YELLOW light","func":"var LocalState = flow.get(\"GlobalState\");\n\nif (LocalState == 1 || LocalState == 3)\n   {msg.payload = 1;\n   node.status({fill:\"yellow\",shape:\"dot\",text:\"Yellow ON\"});\n   }\nelse\n   {msg.payload = 0;\n   node.status({});}\n\nreturn msg;","outputs":1,"timeout":"","noerr":0,"initialize":"","finalize":"","libs":[],"x":980,"y":180,"wires":[[]]},{"id":"c8a94827.acb49","type":"function","z":"be3ab1ef.3f0a68","name":"Decode GREEN light","func":"var LocalState = flow.get(\"GlobalState\");\n\nif (LocalState == 2)\n   {msg.payload = 1;\n   node.status({fill:\"green\",shape:\"dot\",text:\"Green ON\"});\n   }\nelse\n   {msg.payload = 0;\n   node.status({});\n   }\n\nreturn msg;","outputs":1,"timeout":"","noerr":0,"initialize":"","finalize":"","libs":[],"x":980,"y":240,"wires":[[]]},{"id":"28cc6bcb.920094","type":"function","z":"be3ab1ef.3f0a68","name":"Finite State Machine","func":"// FSM implemented by switch / case \n\nvar LocalState = flow.get(\"GlobalState\");\n\nswitch (LocalState)\n    {\n        case 0:                                             // red\n            node.send( {payload:LocalState, delay:1000});   // start red_yellow time\n            LocalState = 1;                                 // next state red_yellow \n            break;\n            \n        case 1:\n            LocalState = 2;                                 // red_yellow\n            node.send( {payload:LocalState, delay:3000});   // green time\n            break;\n        \n        case 2:\n            LocalState = 3;                                 // green\n            node.send( {payload:LocalState, delay:1000});   // yellow time\n            break;\n            \n        case 3:                                             // yellow\n            LocalState = 0;                                 // red time\n            node.send( {payload:LocalState, delay:5000});\n            break;\n    }\n    \nflow.set(\"GlobalState\", LocalState);                // save state information\nnode.status({text:\"State = \" + LocalState});        // display state information\nreturn null;\n","outputs":"1","timeout":"","noerr":0,"initialize":"","finalize":"","libs":[],"x":700,"y":180,"wires":[["743e732.c12228c","778d9f53.8e5f7","c8a94827.acb49","82ab245c.6aa488"]]},{"id":"82ab245c.6aa488","type":"delay","z":"be3ab1ef.3f0a68","name":"Timer","pauseType":"delayv","timeout":"1","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"allowrate":false,"outputs":1,"x":470,"y":180,"wires":[["28cc6bcb.920094"]]},{"id":"43e78726a5c704c9","type":"inject","z":"be3ab1ef.3f0a68","name":"","props":[{"p":"payload"}],"repeat":"","crontab":"","once":true,"onceDelay":"0","topic":"","payload":"true","payloadType":"bool","x":330,"y":120,"wires":[["9f03fd51549f6c27"]]},{"id":"9f03fd51549f6c27","type":"function","z":"be3ab1ef.3f0a68","name":"Init","func":"// Initialisation of State Maschine\n// State information needs to be global scope as the state needs to be\n// non volatile until next execution cycle of FSM function\n// Initialisation using the || character inside FSM ist not working for whatever reason\n// Therefore we use explicit initialisation function executed once at startup\n// FSM always starts after deploy and runs in a loop forever\n// For safety reasons, traffic lights should start at red what is state 0\n// First red time needs to\n\nvar LocalState = flow.get(\"GlobalState\");\nLocalState = 3;\nflow.set(\"GlobalState\", LocalState);\nreturn msg;\n","outputs":1,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":470,"y":120,"wires":[["28cc6bcb.920094"]]}]

Sorry, but thats nonsense.

Venus OS v3.60 has nodejs v20.18.2 installed. v20 is an LTS version, already stable for a long time, and the version we’re using is from january this year. I’d have prefered for it to be slightly newer still, ie. v20.19.2 orso, but that was missed. v20.x is actively supported and maintained till 2028 orso by the nodejs organisation.

And on top of that Node-RED v3.1.15 is used. Last in the v3.x branch and under active maintenance. Not for long, but at the moment it is.

1 Like

It sounds like v4 of nodered is on the todo list for the 3.70+ stream, so it is coming but no committed date yet.
I would imagine that everything will slow down over the summer holidays season.

1 Like

No problem and many thanks for the informations. After update to Venus 3.60 I only checked the NodeRed version, not the node.js version against my previous installation. Before and after update, its always possible to crash the runtime intentionally. The reason is the language itself and the way the JIT compile executes erroneous user code not the version.