# Installing Node-RED 3.0.2 on RoadRunner

<abstract>
Node-RED is a programming tool for wiring together hardware devices, APIs and online 
services in new and interesting ways.
It provides a browser-based editor that makes it easy to wire together flows 
using the wide range of nodes in the palette that can be deployed to its runtime in a single-click.
</abstract>

<img src="./node-red-logo.jpg" width="260px">

This article explains how to install Node-RED on the Roadrunner board running Raspbian Bulleye Linux distribution

##Installation

To install [Node-RED](http://nodered.org/) on the [Roadrunner](/roadrunner) board type this command at Linux prompt:

	wget https://raw.githubusercontent.com/node-red/linux-installers/master/deb/update-nodejs-and-nodered
	chmod +x update-nodejs-and-nodered
	./update-nodejs-and-nodered --confirm-install --skip-pi

Enable the systemd service by typing:

	sudo systemctl daemon-reload
	sudo systemctl enable nodered.service

Then start it:

	sudo systemctl start nodered.service

Now open with a browser this URL:	

* [http://board_ip_address:1880](http://roadrunner.local:1880)
 
## Installing node-red-contrib-roadrunner

[node-red-contrib-roadrunner](https://flows.nodered.org/node/node-red-contrib-roadrunner) is
a Node-RED node created to manage the RoadRunner GPIO

<img src="./node-red-contrib-roadrunner.jpg">


## Protect the access at Node-RED page

Install __node-red-admin__ by typing:

	sudo npm install -g node-red-admin

Create a password hash:

	node-red-admin hash-pw
	
edit __~/.node-red/settings.js__ 

	nano ~/.node-red/settings.js


changes the __module.exports__ session:

	module.exports = {
		adminAuth: {
		    type: "credentials",
		    users: [{
		        username: "admin",
		        password: "put the password hash here",
		        permissions: "*"
		    }]
		},

Restart NodeRED:

	sudo systemctl restart node-red.service

## Log

To check any errors generated by NodeRED type:

	sudo journalctl -f -u node-red -o cat

##Links

* [Node-RED home page](http://nodered.org/)
* [Node-RED Library](https://flows.nodered.org/)

## Roadrunner nodes

* GPIO interface [node-red-contrib-roadrunner](https://flows.nodered.org/node/node-red-contrib-roadrunner)
* ADC interface [node-red-contrib-roadrunner-adc](https://flows.nodered.org/node/node-red-contrib-roadrunner-adc)
