background preloader

Node-Red

Facebook Twitter

Node-RED: Lecture 6 – Intermediate flows. This lecture will build on the ideas you saw in lecture 5 and focus on examples that explore some of the key concepts from that lecture.

Node-RED: Lecture 6 – Intermediate flows

These include the ideas of context, messages and sub-flows. The examples in this lecture are a little more complex than previous examples – mainly in the sense that the function nodes are more complex – but are still kept as clean and simple as possible. (Click to go directly to the example) Example 6.1 Retrieving data from a web page Example 6.2 Counting words in a string Example 6.3 Using context to generate rolling averages Example 6.4 Using the context element to share a function and make it accessible to all functions in the canvas Example 6.5 Defining and using an iterator sub-flow Example 6.6 Getting earthquake data from an external API and returning it as multiple messages.

Jgautier/firmata. Node-red-nodes/io/snmp at master · node-red/node-red-nodes. Node-red/node-red-nodes. Library - Node-RED. Calmh/node-snmp-native. Momenso/node-dht-sensor. Somewhere to keep notes on my projects. DIY Video overlay. I got myself a Garmin Virb Elite in the post Christmas sales, the plan was to use it while riding my bike and when snowboarding.

DIY Video overlay

The camera will shoot in full 1080p HD and has a super wide angle lens to grab loads of what’s going on. I finally managed to get out on my bike at the weekend and remembered to hook the camera up so it was hung under the handle bars. The raw video looks pretty good. Having got some video I wanted to overlay some of the stats from my Garmin 810 cycling computer like location, speed, elevation, gradient and heart rate. Garmin provide some software called Virb Edit which will do all this, unfortunately it only runs on Windows or OSx. Since the standard software wasn’t going to work I thought I’d have a go at trying to build some scripts to do this with Linux. This worked pretty well until I hit Google’s rate limit so only got the first 100 map titles. I used the ImageMagick scripts to build a composite image of the map tile on transparent background. Openstreetmap Video overlays. LDAP and NFC Node-RED Nodes.

About a week ago a colleague asked me to help resurrect some code I had written to use our work ID badges to look up information on the card owner in order to log into a system for a demonstration.

LDAP and NFC Node-RED Nodes

The ID badges are basically mifare cards so can be read by a NFC reader. The content of the cards is encrypted, but each card has a unique ID. Unfortunately the security team will not share the mapping of these IDs to actual people, but since this is for a demonstration that will only be given by a relatively small number of people it’s not a problem to set up a list of mappings our selves. Raspberry Pi Hosting Node-Red. Before delving into the more advanced ways of using Node-Red it's worth understanding the fundamentals of how the systems works.

Raspberry Pi Hosting Node-Red

Library - Node-RED. The purpose of this flow is to give a early warning of overnight frosts, which for me as a keen gardener allows me to protect tender plants and prevent frost damage, but also to set my alarm clock 15 minutes earlier to clear my windscreen in the morning!

Library - Node-RED

It uses a Met Office weather model, which determines the likelyhood of frost by accessing windspeed, air temperature & cloud cover from wunderground.com for the forthcoming evening, and following analysis fires off a 'push' message via pushbullet at midday if frost is likely (could equally be Twitter or whatever). A free developers API key is required from to enable access to the XML data feed, and which is inserted where shown in the 'Get forecast' inject node.

Library - Node-RED. Raspberry Pi Hosting Node-Red. Node-Red is great out of the box but it can be a bit manual to start, stop and run on boot.

Raspberry Pi Hosting Node-Red

The following section will describe a simple init script to do all of the hard work for us. Firstly we create a new init.d file, which is essentially a script for starting, stopping and restarting services under Linux. sudo nano /etc/init.d/node_red sudo nano /etc/init.d/node_red Then copy and paste the following code in to the file. Node-RED - Google Groups. About PouchDB. Node-RED : Upgrading. Currently we recommend the use of npm version 2 or 3, (4 is NOT recommended), please check which version you have installed by running the command npm -v before upgrading.

Node-RED : Upgrading

If necessary run. Raspberry Pi Hosting Node-Red – Take the crap out of developing automation! – The Internet Of Things IOT - Hardware_Hacks. This tutorial will document setting up Node-Red on your Raspberry Pi and getting some of your first automation tasks set up!

Raspberry Pi Hosting Node-Red – Take the crap out of developing automation! – The Internet Of Things IOT - Hardware_Hacks

Now I could harp on a good few hours about what Node Red is and how stupidly awesome it is however they say a picture tells a thousand words.. so below are a few thousand. So as you can see.. its graphical, its easy and its developed by cool guys at IBM..need I say more? Well probably so here is the official take on what Node Red actually is: A visual tool for wiring the internet of things Yes we need more.. so read here.Now that the initial blurb has been given its time to get in to the tutorial. Firstly SSH in to your Pi which will hopefully be running Raspbian or something similar.

For the Pi it has been a pain in the past to get Node.js running but luckily there have been some tweaks made by the clever people out there that make our lives easier. As always get the new versions of everything… Quick Connections for MongoDB with Node-RED. After last week’s blog post where we connected an Internet of Things temperature sensor to record data in MongoHQ’s MongoDB instances, one Twitter follower commented that it would have been even easier if we had used Node-RED.

Quick Connections for MongoDB with Node-RED

Node red raspberry image. Node-red web page - an example to get you started - layer zero labs. NB: I no longer think this is a good way to do this!

Node-red web page - an example to get you started - layer zero labs

It was a first go, and there is a lot wrong with it. I intend to revisit the web-page idea at some point, and will post something better then. Now we use Freeboard to display data – there is a freenode node for node-red in the contrib section – it makes it super easy to setup and configure. See for an example of how it looks. Sending data from Node Red to emonCMS (Dom Bramley's Blog of Maximo and the 'Internet of Things') Update: There is now an emonCMS Node available courtesy of Henrik Olsson : Good Work Henrik! EmonCMS.org is an open source project operated by the Open Energy Monitor which I have been using to store sensor data from my home sensor network. Using Node-Red with OpenRemote for basic home automation « Andy's Life. I’ve recently been using a new tool that describes itself as “A visual tool for wiring the Internet of Things“. More details are available at their website The idea is that ‘things’ can be brought together in a visual manner without any programming, although a little coding in JavaScript is needed in places.

I’ve also been looking at OpenRemote to provide a tablet based front-end for home automation and monitoring. For this project I selected the D-I-Y approach using the open source version available from MQTT is also being used as a message passing mechanism. The broker I use is the most excellent Mosquitto. X10 and Home Easy with Node-RED. This is part of a series of posts I am doing describing some of the things I have been doing as part of the revamp of my home automation system. When I started on the home automation road in 2002 I began with a kit of 3 X10 modules and a CM12U PC interface which I controlled via the command line X10 application Heyu and some DIY scripts, shortly afterwards I switched to the Perl based MisterHouse package which I heavily customised over the years and continued to use until recently.

Many more X10 modules were added over time giving me control of most lights in the house as well as several appliances. X10 has always had a few issues though, the modules are fairly costly although the clones available these days have improved that somewhat but the biggest issue has always been that it is susceptible to noise or interference on the mains line causing things to not turn on/off when asked or to turn on/off erroneously. Ben's Place. Node-RED added some new authentication/authorisation code in the 0.10 release that allows for a plugable scheme. In this post I’m going to talk about how to use this to make Node-RED use a LDAP server to look up users. First of all, to do this properly we will need to enable HTTPS to ensure the communication channel between the browser and Node-RED is properly protected. This is done by adding a https value to the settings.js file like this: You also need to un-comment the var fs = require(‘fs’); line at the top of settings.js.