Just today – an upgrade notice for Node-Red appeared in my in-box. Upgrade details are here.
What is Node-Red? Details here – if you’re not using it or at least investigating it – you may be missing out.
Now, the support guys (Google groups here) are VERY clear about required versions of NPN etc. so I suggest you read that update page carefully. Because I had 2 identical machines (NanoPi M1 as it happens) I thought I’d go for broke. Don’t copy me unless you have a reliable, easy to get to backup – it may well go wrong (mine didn’t) and you’ll be on your own for not precisely following the instructions.
sudo npm cache clean
sudo npm update -g –unsafe-perm node-red
I had already installed the latest (previous Node-Red – maybe a couple of weeks old) – not the default Raspberry Pi version but a manually installed version – along with NPM and the latest NODE and that is NOT what they recommend. I turned Node-Red off (node-red-stop) and used the above commands as PI user (I know, not on a Raspberry Pi but to make my life easy I always make a PI user who belongs to all the PI groups including SUDO) – I then turned Node-Red on (node-red-start).
Voila. It worked first time. 0.14.0
Now – so what’s special – well, one of my issues with Node-Red has been initialisation of variables – sometimes a global variable can get used before it has been defined!!
The team told me a while ago that the LEFT-MOST tab gets run first – of course that’s no good if your inits are not in the left most tab (I have a tab called “init”). Well now it is because you can SLIDE the tab order about with the mouse – how neat is that!
The DEBUG panel now lets you see message from all over – or just the current tab – which is nice and there are some new nodes and other improvements – I’ll let you read all about them here. The big one that stands out is the LINK node. I HATE making large tabs that are really complicated – but to split them up involves passing messages between tabs – and until now that had to be done the hard way – by global variables (not ideal as you have to poll them) or MQTT or similar. Well now there is a node for THAT as well.
Then I spotted a bug – the exec function would no longer take numbers as arguments – only strings (which is what you’d expect but it had always accepted numbers). I reported this early evening. Meanwhile someone reported an issue with MQTT… so the guys amazingly quickly fixed all this.
sudo npm cache clean
sudo npm update -g –unsafe-perm node-red
Erm, no – this time no messages, just accepted my commands but no update. It was a bit late to expect answers out of anyone… so KNOWING I HAD A BACKUP and stopping Node-Red first then restarting afterwards…
sudo npm cache clean
sudo npm install -g –unsafe-perm node-red
Worked a TREAT – I’m now sitting on version 0.14.3 with all my flows intact. The exec issue has gone away and here we are the next morning, after a few more checks I’ll progress with updating my other installations.
The team are to be congratulated on the work they’ve done on this tool – it costs us nothing but opens up entirely new possibilities to both beginners and seasoned programmers. Very different image of IBM to the one I had when I was a kid (huge buildings, everyone talking in abbreviations, obscenely expensive leased servers) – at least that’s what I remember – probably wrong
Marvellous.
A gentle way to get started with node-red is provided with ‘The Thingbox’
http://thethingbox.io/#home
It comes as a SD image for the rPi and has node-red & mosquitto ready to go.
I like it a lot 🙂
Indeed – or – an even gentler way… is this… no installation at all – ready in seconds!!! https://fred.sensetecnic.com/
Or – run my script – which gives you Node-Red, Mosquitto, Webmin, SQLITE, Apache, PHP… etc etc….
https://bitbucket.org/snippets/scargill/KqgAe/latest-script-june-2016-read-the-comments
Pete, DCJ and the team are doing a webcast on Node Red… It may be of interest to you and your subscribers….
Join us for a Node-RED Tech Talk, presented by developerWorks Open, Wednesday, June 22, at 11 a.m. ET, and find out how to wire the Internet of Things together using this simple, innovative, open source tool.
Event page link: https://developer.ibm.com/open/events/dw-open-tech-talk-node-red/
Suitably broadcast…
Hi Peter, I wanted to ask if there is any node-red flow (code) that let me add dynamically more sensors.
In that way. i.e. rpi3/sensor/temp1 then when I add a new one rpi3/sensor/temp2 shows up in mynode-red/ui display page the new sensor without modifying the flow every time I add a new sensor.
Thanks a lot in advance
I’m not sure if there is, Javier, but that need not stop you writing some 🙂
Anyone having trouble with the node edit tray? Firefox needs to be maxed to edit all the fields. BigTimer’s long dialog is one. I should have waited a bit 🙂
in case someone wants a good intro to node-red, esp8266, arduino and raspberry, this course was just published and seems interesting… you can also find a lot of free tutorials on Rui’s site 🙂
http://randomnerdtutorials.com/build-a-home-automation-system-for-100/
Still struggling to get later version of Node_red running. Followed instructions here:
http://nodered.org/docs/hardware/raspberrypi
Uninstalled preinstalled version then tried to install new but node-red fails to start with:
Failed at step USER spawning /usr/bin/env: No such process
Also npm -v fails with “Inllegal Instruction”
I then tried:
wget http://node-arm.herokuapp.com/node_latest_armhf.deb
sudo dpkg -i node_latest_armhf.deb
That didn’t fix my issue. I don’t like to just “reinstall” but I’m thinking that may be the better option here.
I know you’ve come accross this in the past just wondered if you had any suggestions.
Enjoy the blog by the way, great job.
Much of my installing comes from MUCH trial and error. I can only point you to my script – which (in a very roundabout way) removes the standard node-red install and puts a new one in – that is where I’m starting off for all of my installs and updates.
https://bitbucket.org/snippets/scargill/KqgAe/latest-script-june-2016-read-the-comments
If you go to the bit about Node-Red you might find something you can use.
Thanks Pete, I think that changed NodeJS 4 to 5 which and now I’m informed that:
/usr/bin/env: node-red-pi: No such file or directory
Followed that red-herring for a bit, tried to create symlink and install nodejs-legacy, later fails with failed dependencies.
Think I’ll just start from scratch, was trying to preserve configurations done to date.
Thanks for the script, useful.
Gary, I had problems with my first node-red install, uninstalled everything and started from scratch following the Manual Install instruction at http://nodered.org/docs/hardware/raspberrypi
Worked good after that.
Oh, and one time I downloaded the v6.x.x development version of nodeJS, which ran but threw errors. Another user told me the LTS v4.x.x is the safer option, so I uninstalled v6 and sure enough v4 ran with no errors on my Pi. The Manual Install instructions install v4.
Thanks Kris, I think you’re right, looks like a fresh install with no “over excited” jumping through the instructions.
I did have it all setup but woke one morning to silence and realised I’d lost it all through an SD crash.
Will be following Pete’s path of regular backups and simple setup script as worst case fallback.
Kris – yes, I was up late last night updating… by midnight I had 0.14.3 and I can confirm the exec node works – left everything running overnight and all is well. This morning I’m going to chance updating other systems. Looking good.
Good to know, thanks for the report.
It should also be noted that move tabs doesn;t work in chrome, but does in firefox.
Erm, Paul – the move tabs work a treat on my Chrome…. Windows 10 64 bit – reasonably up to date chrome…
Ok, Went to chrome and checked for update. I now have Version 51.0.2704.103 m (64-bit) and it does work.
P.
Great – well, others in here might want to take note of this – older chrome might be an issue – thanks Paul.
Looks like they may have fixed your exec issue in version 0.14.3.
https://github.com/node-red/node-red/releases
Your commands are missing the && between the commands or new lines BTW.
Thanks Vincent – for reasons beyond me – When copy/pasting from some sites to Microsoft Writer, just occasionally I get something that looks exactly right in the editor – and fails miserably on the final page – it was way too late last night to check. Hopefully now sorted.