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. A Node-RED node that looks for SNMP oids.

Library - Node-RED

A pair of Node-RED nodes that fetch either individual oids, or a table oid from a SNMP enabled host. Install Run the following command in the user directory of your Node-RED install. ( typically ~/.node-red ) npm install node-red-node-snmp Usage snmp SNMP oids fetcher. Msg.oid may contain a comma separated list of oids to search for. The oids confgured in the edit config will override msg.oid. Outputs msg.payload containing a table of objects. Snmp-table Simple SNMP table oid fetcher. Msg.oid may contain the oid of a single table to search for. The oid confgured in the edit config will override msg.oid. Outputs msg.payload containing the table of objects. 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

I will now explain a simple "Hello World" setup using an inject node and a debug node. Firstly open up your instance of Node-Red and locate the inject node. If you hover over any of the nodes a brief description will be given explaining its functionality. Click and drag the inject node anywhere on to the white canvas in the centre of the screen. Next we find our debug node which is listed under the "outputs" section. 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). 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. If you have installed Node-RED as a global npm package, you can upgrade to the latest version with the following command: sudo npm update -g --unsafe-perm node-red Upgrading from before Node-RED 0.10.4 In releases prior to 0.10.4, the default behaviour was to write user data into the Node-RED install directory.

Node-RED : Upgrading

This made upgrading a painful experience. The following guide takes you through moving your existing data out of the install directory. Choose where you want to store your data. 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.

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! It was a first go, and there is a lot wrong with it. 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. It is a free of charge service that is fairly flexible in how you can set up data streams and allows you to create basic dashboards very easily:

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. X10 and Home Easy transmitters.

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.