How to upgrade Node-Red?

#1

How do I upgrade Node-Red, and what will the upgrade likely break?
I have two installations of Node-Red, one on Raspian (NR Version 0.17.5) and one on Hass.io (NR Version 0.19.5) and I just realized that the Range node is different in the newer node.

I have two Node-Reds because I originally started IOT using Node-Red on Raspian, then many months later, I set up Home Assistant on another Pi running the Home Assistant image from Hass.io. There are nodes on the Raspian system that I can't install on the Hass.io Pi, and vice-versa. So I have two.

So, I tried copying a flow with a Range node from the newer Pi to the older Pi, only to discover that the Range node was not working the same.

Or, I could just write a function to simulate the Range node.

Any ideas? Thanks,
Steve

#2

On the non hass.io pi the best solution is to use the upgrade script listed on the raspberry pi page of the docs.

This will upgrade Node-RED and the underlying node.js and npm versions.

With has.io as Node-RED comes bundled I would suggest checking in their support site what the most effective way to upgrade is.

I can’t think of any nodes that would work in has.io Node-RED but not on stand-alone node-RED so could you list them please?

#3

What differences in the range node are you seeing ?

1 Like
#4

Thanks for the prompt responses.

dceejay: The newer version has a property selection. The older version only works on msg.payload. In my appplication I need to map the 0-100% returned by Alexa Home node for brightness (msg.bri) to 0-256 for the Z-wave light I am controlling from Alexa.

Since it's easy to make a clone of my SD card in Raspian, I have little risk in upgrades there since I can always go back to the last working clone. (This is the older version of NR that needs upgrading). Cloning my SD card in Hass.io is not as easy, but can be done using dd on a separate Pi running Raspian, and hope that I ID the source and destination devices correctly.

ukmoose: In the older version on the Raspian Pi, I installed the Home Assistant nodes, but they don't appear in the nodes pallette on the left side of the Node Red workspace.

On Hass.io, I cannot install npm on Hass.io since there is no "apt-get" in the OS. I did an upgrade from the Home Assistant Hass.io page and didn't break anything. I am very slow to upgrade Hass.io since every upgrade is accompanied with a lot of posts on Home Assistant forum of "Upgrade to xx.yy broke [component or automation]". I.E., not stable. I only try an upgrade if absolutely necessary to gain a new function or component.

#5

as per the Home assistant nodes readme it requires nodejs v8+ not a specific version of node-RED

#6

Thanks. How do I update Node.js on Raspian?

#7

For standard raspbian, the node-red upgrade script will upgrade node.js ( currently to v8)
After you have done the upgrade you will need to rebuild any additional nodes you have installed.

All described on the Raspberry Pi page of the docs https://nodered.org/docs/hardware/raspberrypi