Node-RED in a Nutshell
Roughly a year ago the folks at IBM Emerging Technology started work on Node-RED, a solution to the problem of a lack of “tools that make it easier for developers at all levels to bring together the different streams of events, both physical and digital, that make up the Internet of Things.”
This was a bit too heady for me so I decided instead to look at some of the “flows”, the projects that Node-RED uses, as a sampling of what the software can do. Here are a few:
- Weather reports to SMS and MQTT topic: “…a couple of flows to read weather forecast info from the BBC weather site using RSS. The feeds are specific to my location so should be changed for your own. The output is directed to 2 nodes, one for Twilio to send a SMS, the other to publish to a MQTT topic that in my case has a printer listening to it.”
- Twitter Sentiment Analysis: “This flow listens for tweets mentioning a specific term, passes it through sentiment analysis and then routes the messages to one of three outputs depending if the sentiment is positive, neutral or negative.”
- Turn off HDMI connected TV when leaving WIFI + presence dashboard: “If the user leaves home with the phone and gets disconnected from the WIFI the attached TV gets turned off over HDMI CEC. All tested with a Nexus5, Raspberry Pi and a old Philips LCD TV.”
Furthermore, once a flow has been created and tested, it can be packaged into independent npm modules (for Node.js), to distribute and use outside of Node-RED. I think that’s pretty neat.
The one downside was that it’s a bit tricky to get running if you’re not up to snuff with Node.js, so I whittled it down a bit (results below).
It made me wonder if standalone flows couldn’t be distributed with Node.js in the same way; I think this makes for some neat projects and interesting opportunities.
Step 1: Download: Node-RED_0.8.1ws (The “ws” stands for Windows Standalone — it should theoretically run from a thumb drive).
Step 2: Unzip anywhere you like and run the included “Launch.cmd” file.
Step 3: Use it.
The launcher will open Node-RED in a new process window…
…and then launch your default browser to connect to it. If your browser opens too fast you might get a “connection rejected” error; just wait a few moments for the Node-RED server to start and reload the page.
To disconnect and shut down Node-RED, simply close the open process window.
After you’ve tried this out you might want to swing on by the “Creating your first flow” page to get better acquainted.
N.B. I’m not affiliated with either Node.js or the Node-RED project so everything here is 100% unofficial.
Update, October 23: I’ve re-packed the standalone with the newest version of Node-Red (0.9.0): Node-RED 0.9.0ws