meta data for this page

Node-RED on BBB

This chapter describes the installation of Node-RED on a BBB including the use of the IO's.


There are no node or npm packages needed from Debian repos, so first remove leftover nodejs stuff and apt installed packages from the Linux directories:

guest:~$ su
~# npm ls -gp --depth=0 | awk -F/ '/node_modules/ && !/\/npm$/ {print $NF}' | xargs npm -g rm
~# apt-get remove npm nodejs

Be sure to install needed packages for buildingnodejs:

~# apt-get install curl build-essential

Then add to apt repository and install nodejs 8:

~# curl -sL | sudo -E bash -
~# apt-get install nodejs

Now configuration of npm is necessary to install packages globally into user directory. Login as user who later runs nodejs and download the nosudo script:

guest:~$ cd
guest:~$ wget

Execute script and .bashrc:

guest:~$ chmod +x
guest:~$ ./
guest:~$ source ~/.bashrc

Now you are able to install needed npm packages as user globally:

guest:~$ npm install -g <some package>


The “Node-RED graphical event wiring tool” called node-red must be installed for having the web based wiring tool on bbb:1880 as far as some node-red nodes for accessing the GPIO of the beagle bone black:

guest:~$ npm i node-red -g
guest:~$ npm i beaglebone-io johnny-five node-red-contrib-gpio -g

Integrate node-red into systemd by creating a /lib/systemd/system/nodered.service with following content:

~# systemd service file to start Node-RED
Description=Node-RED graphical event wiring tool.
# Run as debian user with group gpio in order to have access to gpio pins
ExecStart=/usr/bin/env /home/debian/.npm-packages/bin/node-red $NODE_OPTIONS $NODE_RED_OPTIONS

Enable service:

~# systemctl daemon-reload
~# systemctl enable nodered.service

Show loggings of node-red:

~# journalctl -fu nodered.service -b