element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet & Tria Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • About Us
    About the element14 Community
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Japan
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      •  Vietnam
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
BeagleBoard
  • Products
  • Dev Tools
  • Single-Board Computers
  • BeagleBoard
  • More
  • Cancel
BeagleBoard
Blog Node-RED on Beaglebone Black (with SensorTag 2.0)
  • Blog
  • Forum
  • Documents
  • Quiz
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join BeagleBoard to participate - click to join for free!
  • Share
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: fvan
  • Date Created: 16 Jul 2015 9:18 PM Date Created
  • Views 2564 views
  • Likes 2 likes
  • Comments 3 comments
  • bluetooth
  • ble
  • RoadTest
  • sensortag
  • beagleboneblack
  • node-red
  • bbb
  • iot
  • simplelink
  • cc2650
Related
Recommended

Node-RED on Beaglebone Black (with SensorTag 2.0)

fvan
fvan
16 Jul 2015

In my previous post, I was able to retrieve data from the SensorTag 2.0 on the Beaglebone Black using command line tools such as "hcitool" and "gatttool". For this post, I'll be setting up Node-RED to collect the SensorTag data automatically and make it available for other applications to process or store.

 

Node-RED

 

What is Node-RED? Node-RED is a tool used to wire together different devices, APIs or online service in a visual way. The website is located at http://nodered.org/and contains a wealth of information on how to install and use Node-RED on different operating systems and devices.

Install Node-RED

 

Node-RED requires Node.js to be installed. Fortunately for me, this is the case by default on the Beaglebone Black. Just to be sure, I tried to install Node.js using "apt-get".

 

debian@beaglebone:~$ sudo apt-get install nodejs
Reading package lists... Done
Building dependency tree
Reading state information... Done
nodejs is already the newest version.
nodejs set to manually installed.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

 

As expected, Node.js is already installed and is even reported to be at the latest version. Installing Node-RED is very easy and only takes a couple of minutes. The command can be found on the Node-RED website: http://nodered.org/docs/getting-started/installation.html

 

debian@beaglebone:~$ sudo npm install -g --unsafe-perm node-red

 

Once installed, Node-RED can be run using the "node-red-pi" command. This will start the application, which can then be accessed using a webbrowser at http://device_ip:1880/.

 

debian@beaglebone:~$ node-red-pi

Welcome to Node-RED
===================

15 Jul 19:45:03 - [info] Node-RED version: v0.11.1
15 Jul 19:45:03 - [info] Node.js version: v0.10.25
15 Jul 19:45:03 - [info] Loading palette nodes
15 Jul 19:45:12 - [warn] ------------------------------------------
15 Jul 19:45:12 - [warn] Failed to register 1 node type
15 Jul 19:45:12 - [warn] Run with -v for details
15 Jul 19:45:12 - [warn] ------------------------------------------
15 Jul 19:45:12 - [info] Settings file : /usr/local/lib/node_modules/node-red/settings.js
15 Jul 19:45:12 - [info] User directory : /home/debian/.node-red
15 Jul 19:45:12 - [info] Flows file : /home/debian/.node-red/flows_beaglebone.json
15 Jul 19:45:13 - [info] Server now running at http://127.0.0.1:1880/
15 Jul 19:45:13 - [info] Creating new flow file
15 Jul 19:45:13 - [info] Starting flows
15 Jul 19:45:13 - [info] Started flows

 

image

 

Install node-sensortag

 

In order to have support for the TI SensorTag in Node-RED, a new node needs to be installed. Before being able to install it though, it is required to have the bluetooth development files installed first.

More information on the SensorTag node can be found on its GitHub page: https://github.com/sandeepmistry/node-sensortag.

 

debian@beaglebone:~/.node-red$ sudo apt-get install libbluetooth-dev

 

Once done, it should be possible to install the SensorTag node without issues.

 

debian@beaglebone:~$ cd ~/.node-red
debian@beaglebone:~/.node-red$ sudo npm install sensortag

 

When that is installed, Node-RED has to be run as "root" or with "sudo"in order to access the Bluetooth system calls. And because Node-RED is run as a different user, it is recommended to specify the path to the user directory where the SensorTag node was installed.

 

debian@beaglebone:~$ sudo node-red-pi -u /home/debian/.node-red/

Welcome to Node-RED
===================

15 Jul 20:14:27 - [info] Node-RED version: v0.11.1
15 Jul 20:14:27 - [info] Node.js version: v0.10.25
15 Jul 20:14:27 - [info] Loading palette nodes
15 Jul 20:14:37 - [warn] ------------------------------------------
15 Jul 20:14:37 - [warn] Failed to register 1 node type
15 Jul 20:14:37 - [warn] Run with -v for details
15 Jul 20:14:37 - [warn] ------------------------------------------
15 Jul 20:14:37 - [info] Settings file : /usr/local/lib/node_modules/node-red/settings.js
15 Jul 20:14:37 - [info] User directory : /home/debian/.node-red
15 Jul 20:14:37 - [info] Flows file : /home/debian/.node-red/flows_beaglebone.json
15 Jul 20:14:37 - [info] Server now running at http://127.0.0.1:1880/
15 Jul 20:14:37 - [info] Creating new flow file
15 Jul 20:14:38 - [info] Starting flows
15 Jul 20:14:38 - [info] Started flows

 

The SensorTag node should be available in the Node-RED GUI.

image

Testing

 

As a first test, I connected the SensorTag node directly to a debug output. This allowed me to confirm the Bluetooth connection between the SensorTag and the Beaglebone Black was properly set up without any manual intervention and that Node-RED was able to capture the data.

 

imageimage

 

I started with a few parameters, tested a bit, and then enabled the others. As you may be able to see from the screenshots above, all that was required to set it up was to:

  • drag the necessary nodes in the sheet, in this case: sensortag & debug
  • enter the MAC address of the sensortag
  • select which parameters to report on
  • press the "deploy" button in the top right corner

 

It doesn't get any more simple than this! You can see the debug data in the column on the right.

 

After a successful first test, I added a second, more useful output: MQTT. This allows me to publish the SensorTag data to a MQTT broker and topic of my choice. Adding the MQTT output is simple:

  • drag the MQTT node in the sheet
  • connect it to the SensorTag node
  • configure a broker and topic
  • deploy



imageimage


Using MQTTLens, I was able to subscribe to the topic and visualise the published data. It works! This is of course only a very simple example meant to demonstrate some basic features, and does not take any security into account, as all the data is just published on the internet for anyone to see. So keep that in mind if you plan to try this out.


In my next post, I'll be collecting the data to build historical data that can be used for trending, processing, ... Until then!

  • Sign in to reply
  • Former Member
    Former Member over 9 years ago

    So if I understand correctly..

    Node.Js is a (server side) platform that BBB comes installed with, and in order to use it, you have to write modules in javascript or node-red flows?

     

    I imagine node-red flows can run on anything that supports node-red, i.e. they can run on web/cloud hosting sites?    Although, I don't see many free options.    BlueMix looks nice, but has a limited free trial.. FRED is free but no mqtt broker or sms nodes... not sure if openshift can do it, as it seems very linuxy/difficult to setup.

     

    Any suggestions on sites that have just a general guide on what Node.Js can be used for?   So many client and server side technologies that it gets confusing which is good for what!

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • fvan
    fvan over 10 years ago in reply to nikhilbadami

    Hi Nikhil,

     

    I didn't run into this issue, but a quick search returned following page: https://developer.ibm.com/answers/questions/26698/unable-to-verify-leaf-signature-when-calling-rest-apis-from-node-js.html

    They describe a workaround to get the problem resolved. Perhaps you could try that ?

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • nikhilbadami
    nikhilbadami over 10 years ago

    This is a great guide thank you so much for posting it! I've been having a problem actually getting node-red on my beaglebone. My bone is connected to the internet via an ethernet cable, however, whenever i try and use the command you used to get node red, I get the error : UNABLE_TO_VERIFY_LEAF_SIGNATURE. I was wondering if you ran into this problem, or if you could help me solve it?

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2026 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube