Introduction: Getting Started With Node-Red on the BBB

About: Software Engineer at Digilent Inc.

This Instructable will go over what Node-Red is and how to set it up on the Beaglebone Black (BBB).

On Node-Red's website, they describe it as a tool for wiring together hardware devices, APIs and online services in new and interesting ways. Because of the visual nature of node-red, it also makes IoT coding much more streamlined. You don't need to be a fantastic coder in order to use node-red successfully. Check out the video to see something that node-red allows you to do quickly and easily. At the end of this instructable I also show you what I've done with node-red and the BBB.

One awesome thing about node-red is that there are already nodes that other people have made that you can add to your node-red installation. In our case, the BBB has functions in node-red to read analog and digital channels and write to the various digital channels on the BBB. Check out the picture above to see the current list of BBB nodes.

Photo credit: and

Step 1: Installing Node-Red on Your Beaglebone Black

First, make sure your BBB has an internet connection and SSH in. You'll also want to be on the most recent release of Debian for the BBB to make sure you have the latest version of Node.js (v0.10.x) which should be installed by default on the BBB. Node.js is what node-red is based off of. If you need to update Node.js, follow the instructions on this page under the heading "2014-05-14 GPG error: Optional enable". If you need more detailed instructions, see the node-red documentation.

Also, make sure your local time is correct on the BBB since it does not have a battery backed real time clock. It needs to be set on every boot in order for software certificates date checks to be valid. ntpdate -b -s -u should do the trick. I personally did not do this step and had no issues.

To install node-red on your BBB, type the following in the terminal:

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

Let node-red install and you should be almost done!

Next, we want to get the BBB specific nodes so type the following into your terminal:

cd ~/.node-red

npm install node-red-node-beaglebone

Step 2: Starting Node-Red

To start node-red on your BBB, type "node-red-pi" into the terminal without quotes. You'll see some information displayed in the terminal similar to the picture above.

Now, go to http://beaglebone.local:1880 assuming you haven't changed your host name. This URL opens node-red in your browser where you create your "flows". You should notice on the left side of the window there should be a BBB node set if you scroll all the way down that looks like the picture above.

Step 3: Importing Flows

Another great thing about node-red is that it is easy to share your flows with other people. Copy the following code to your clipboard:


Next, click the menu button in the top right corner and go to Import -> Clipboard and paste the code above. Once that is done, you should see the flow pictured above is now in your workspace!

Step 4: Deploy!

Now that we have our flow, we'll need to actually deploy it. Click the deploy button in the top right of your screen and a pop up message will tell you if it was successful. Now, when you click the "on" button or "off" button of the inject node, it will send either a "1" or a "0" respectively to the BBB digital write node that will then turn on user led 2 or user led 3. You can easily use this to toggle other digital channels as well.

If you want to stop node-red, just type ctrl + c into the terminal to quit out of the program.

Step 5: What's Next?

That's up to you! Personally, I used node-red and some html/javascript to create a server on the BBB that allows people to connect to the BBB on the same network it's connected to and toggle a lamp on and off using a relay switch. The page that I made also has toggle switches so you can turn on some of the user LEDs and it also live updates the analog pins 0 and 1 and plots them 20 points at a time using a library called flot. Check out the picture of the page I made above! Sorry for the low resolution it's a screenshot from my phone.

If you're curious to learn more, you can head to the node red website and check out more youtube videos. Feel free to comment any questions you have as well and I'll do my best to answer them!