Running on BeagleBone Boards

Installing

If you want the latest Node-RED 1.x then you need to use the Debian (10) Buster image from beagleboard.org - and then do a full upgrade to latest.

sudo apt update && sudo apt full-upgrade

Currently, Debian (10) Buster is only available as an SD card image. If you wish to flash the image to the eMMC, edit the file /boot/uEnv.txt file, and uncomment the line

cmdline=init=/opt/scripts/tools/eMMC/init-eMMC-flasher-v3.sh

The image can then be flashed to the eMMC like any ‘flasher’ image on the BeagleBoard website. To do this, insert the SD card with the BeagleBone powered off, hold down the S2 button and apply power. Once the LEDs start flashing, release the button. Flashing will take between 5 and 25 minutes. The BeagleBone will power down at the end of this process, the SD card can be removed, and the BeagleBone will now boot from the eMMC.

All the 4GB images for BeagleBone boards already have Node-RED pre-installed and set to auto-start, so you can just boot and point your browser at your BeagleBone, port 1880.

The 2GB console version suitable for flashing to older eMMC versions of the BBB is not recommended but can be installed as per the manual installation instructions below.

Running

To view the Node-RED log

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

To stop Node-RED

sudo service node-red stop

To start Node-RED

sudo service node-red start

To set Node-RED to auto-start on every boot

sudo systemctl enable node-red.service

and likewise to stop it auto-running on boot

sudo systemctl disable node-red.service

Upgrading

The latest Debian images already have Node-RED and Node.js installed - the easiest way to upgrade is to use the built-in upgrade tool:

sudo apt update
sudo apt upgrade nodejs bb-node-red-installer

This should also restart the Node-RED service - but you will need to refresh any open browser sessions.

If you are on the 2017 Debian 9.2 version you may need to run sudo apt full-upgrade first.

Note: Do NOT use the Raspberry Pi / Debian upgrade script (update-nodejs-and-nodered) as it will re-install both Node.js and Node-RED in different locations and will conflict with and break the existing systemd configuration files.

Configuring

The Beaglebone is configured by default to run Node-RED as root. Therefore the configuration files are located in the /root/.node-red directory and you will need root privileges (sudo) to edit them. This is where you need to edit your settings.js file for example.

Beaglebone also has a systemd service, /lib/systemd/system/node-red.socket, that automatically starts Node-RED when it sees an attempt to connect. By default this is port 1880 - but if you want to change that you need to change it here as well as in the settings.js file.

Beaglebone specific nodes

There are some Beaglebone specific nodes that give you direct access to the I/O pins in the simplest possible manner. The easiest way to install them is direct from npm.

To install manually run the following command:

sudo npm install -g --unsafe-perm beaglebone-io johnny-five node-red-contrib-gpio