Install Node-RED on Intel Edison

by Atlas7 in Circuits > Tools

2812 Views, 3 Favorites, 0 Comments

Install Node-RED on Intel Edison

Screen Shot 2015-12-09 at 13.21.29.png

I've recently learnt how to run Node-red on Intel Edison following attending one of the Intel Edison workshop hosted by the folks at IBM Bluemix (Twitter: #BluemixIoTWorkshop hosted by @IICHursley).

This Instructable aims to capture some of the main steps to get Node-red installed on the Intel Edison device - so that going forward whenever you power up your Edison kit, Node-red is run automatically - and you are able to access Node-red via a URL like this:

http://edison-device-name.local/1880

(Replace edison-device-name with your edison name)

Pre-requisite:

  • Have gone through the basic Intel Edison Get Started Steps. In particular:
    • Knowledge of connecting to Intel Edison via a serial USB and be able to login as root.
    • Intel Edison board is already flashed.
    • Intel Edison has been connected to internet via Wifi.

Install Node-red and Pm2

Screen Shot 2015-12-09 at 13.23.16.png

Issues the following commands to install node-red and pm2.

npm install -g --unsafe-perm node-red
npm install -g --unsafe-perm pm2

Start Node-RED

Screen Shot 2015-12-09 at 13.26.18.png

Start Node-RED using pm2 by entering the following command:

pm2 start /usr/bin/node-red --node-args="--max-old-space-size=256"

Now you can access Node-RED on edison like this:

http://edison-device-name.local:1880/

(replace edison-device-name with your edison name)

Or

http://xxx.xxx.xxx.xxx:1880

Install Node-red-node-intel-gpio

Screen Shot 2015-12-09 at 13.12.31.png

You'd need the Node-RED node called intel-gpio to enable Node-RED to talk with your Arduino pins.

Run this command to install node-red-node-intel-gpio

cd ~/.node-red
npm install node-red-node-intel-gpio

Restart Node-RED

Screen Shot 2015-12-09 at 13.12.31.png

To see the new nodes in the flow editor pallet you need to restart Node-Red

pm2 restart node-red

Wait a few seconds then refresh your browser and you will now see additional nodes. There is now a set of nodes to access GPIO on the Edison board.

Make Node-RED to Auto Start on Intel Edison

Screen Shot 2015-12-09 at 13.23.16.png

o get the Node-RED to autostart with the Edison board issue the following commands

mkdir /etc/init.d
pm2 save pm2 startup

Now, whenever the Intel Edison is powered up, Node-RED should just get started automatically.