Skip navigation
1 2 3 Previous Next


94 posts

Build a professional grade up to 4 Axis LinuxCNC control with Beaglebone Black and our CNC cape on Kickstarter.


The Cape comes with pre-installed LinuxCNC Open Source Software (Machinekit) and has opto coupled inputs.

For more information see:



Follow the steps in this guide to join the Internet of Things using NodeJS, Bluetooth and 10 powerful sensors. You will need the BeagleBone Black IoT Solution Kit Buy KitBuy Kit See All Parts

What Exactly are we Using Here?

You may have seen this guide in parts, however I like everything in one place, on one page and appropriately up to date. Or as much up to date as I can possibly do, technology moves so fast!


IMG_20160413_233704.jpgTexas Instruments (TI) have this interesting little board called a Sensor Tag and the version I have is a CC2650 running the default firmware. To update the firmware, you need the right cable to plug into it. This cute little board comes with a plastic enclosure, that then can be contained within a rubber sleeve. I imagine you could have a number of these devices placed around though with them being Bluetooth you're going to have to be in an open area or have thin walls, it is 2.4Ghz after all.


What's ridiculous (in a good way) about the Sensor Tag is that it comes with 10 sensors on board, and it can sync with any Bluetooth device, including your phone, you can even expand it to add more sensors to it. I'm not sure why you'd want to add more sensors to it, because it already has these:


  • "10 sensors including support for light, digital microphone, magnetic sensor, humidity, pressure, accelerometer, gyroscope, magnetometer, object temperature, and ambient temperature"


Elementary, my Dear IoT


Those clever people at International Business Systems (IBM) have been developing a way to make sense of data, lots and lots of data, in various different ways. It may be an artificial intelligence, or it may just be intelligent ways of looking at data. I'm not entirely sure, it helps to watch a video and make sense of it all.



Since all things Internet will be creating a lot of data, it makes sense that Watson is thrown at IoT. You will need to sign up for an IBM Bluemix account to be able to work through attaching your IoT sensor(s) to it. Fortunately, there is a free tier of Watson IoT for us to play with, however this can scale up to cover thousands of devices with some amount of data traffic and storage. It is a little weird, even if you select Free you're put into the Free Trial, just see it as a nice 'try before you proceed' affair.


You need not be Sherlock to join Watson

In a few easy steps you can sign up for then IBM Bluemix account before we look at the hardware you'll need to get started with IBM - Explore IoT



{gallery} Joining IBM Watson


Step One: Visit the IBM Explore IoT site and click Sign Up


Step Two: Fill out your details on IBM Bluemix


Step Three: Confirm Sign Up with your E-Mail


Step Four: You'll be put onto a premium trial first, but this falls back to a free account.


Step Five: At the login prompt, your IBM ID is your e-mail


In case you missed it in the image gallery overlay, your IBM ID is your e-mail address.


What do I Need to Get Started?

Set yourself up with IBM and the BeagleBone Black with the Texas Instruments SensorTag. Follow the steps in this guide to join the Internet of Things using NodeJS, Bluetooth and 10 powerful sensors.

BeagleBone Black IoT Solution Kit Buy KitBuy Kit

The kit consist of the following 5 items:

BeagleBone BlackBeagleBone Black

TI Sensor Tag CC2650TI Sensor Tag CC2650

Bluetooth 4 USB AdapterBluetooth 4 USB Adapter

8GB microSD Card8GB microSD Card

Ethernet cableEthernet cable with a connection to the internet.

*You need a way to write to a microSD Card from a laptop or desktop computer.


With this hardware I'm making the assumption that you're going to plug the Beaglebone Black into a wired network. Yes, I know that it is possible to setup a 'soft network' using the USB cable that comes with the BeagleBone Black and connecting it to your computer. However, I discovered that the driver bundled with even the latest Debian image does not work with Windows 10 64bit, you're advised to compile the driver yourself. If you don't have a way to view the desktop on the BeagleBone Black (it does require a mini HDMI to something sensible cable) then you won't be able to setup WiFi either. So I suggest plugging in an Ethernet cable to a switch, whether that's a home gateway or on the same network as a computer that's running a DHCP server. If you're not connected to the internet via this connection, you'll have to scour the packages and offline files for yourself.


Setting up the BeagleBone Black

20160414_154133.jpgLet's get set up with a reasonably up to date version of Debian Linux. Angstrom hasn't been the default stable for the BeagleBone Black for a while now and thankfully we can use the armhf architecture from Debian. You can download the latest Debian 8.3 Jessie image. If you're using Linux then the setup of the microSD card is straight forward, you can use unxz as a command (or you can even use simply 'xz -d', search your distribution's repository if you don't have either) to extract the downloaded image file, and then use dd to write the image file to the microSD card using something like this:


sudo dd if=./BBB*.img of=/dev/sdX


Be wary using BBB*.img as the filename if you have more than one image file in the folder you're running this command in. The command is ran from a terminal window, and /dev/sdX is an example name of your SDCard device reader where the microSD card is plugged into. If you're not sure which one it is, then you're going to have a fun dance with "ls /dev/" and dmesg commands as you plug/unplug your SDCard into the computer and correlate the names as to which device is your SDCard.


On Microsoft Windows, you can use win32DiskImager, insert your SDCard into your reader, select the appropriate drive letter and the .IMG file, after extracting it with something like 7-Zip and write it to the card. However, I encountered a problem when using win32DiskImager and writing the Debian image, it wouldn't do more than 2gByte of data sometimes and I had to resort to using Linux. Now, it may have been a faulty microSD card, or it could have been Windows to blame. Just be wary that if you're not able to write properly to your SDCard that you may need to try a different operating system, or your card is broken.


Once you have your microSD card setup, you can insert it into your BeagleBone Black and connect power to it. Either by powering it with the USB cable or a wall wart rated at 5V, perhaps above 1Amp. Ensure your BeagleBone Black is connected to the wired network.


Accessing the BeagleBone Black on the Network

There are many different ways you can find out what the IP address is of the BeagleBone Black if you haven't connected it to your computer using the USB port, ranging from a network scan using nMap (don't run that on corporate networks, your network administrator won't be happy) to looking up the DHCP allocation table on your network router. The method you use will be entirely dependent on your network setup and how you've chosen to connect to it, and unfortunately we won't be covering that here, but by all means ask in the comments below.


You'll want to login to the BeagleBone Black via SSH, using either PuTTy on Windows, or just ssh on Linux. You can login as root as by default there is no password set and root is permitted over ssh, alternatively the username and password is:


User: debian

Pass: temppwd


Once you're connected to your BeagleBone Black then it's time to ensure that your distribution is fully up to date. To keep track of any potential problems, separately you should run:


sudo apt-get update

sudo apt-get upgrade

sudo apt-get dist-upgrade

sudo apt-get autoremove

sudo apt-get clean


This will update your operating system, and you should run through this set of commands at least twice in case any packages are held back. A command I run when I'm being quick, dirty and lazy is:


sudo apt-get update; sudo apt-get upgrade -y; sudo apt-get dist-upgrade -y; sudo apt-get autoremove -y; sudo apt-get clean -y


Which goes through them autonomously, use at your own discretion. Yes, those are semi-colons between commands.


Configuring the BeagleBone Black and the Sensor Tag to Access IBM Watson

What we're going to do now involves using the repository software called 'git'. From here we're going to get hold of software from github, and then modify it because it's out of date. I did consider forking the repository and having this fixed in an element14 repo, but I think it serves as a good example to introduce you to the code and also using git.


The software basically downloads and installs bluetooth and also sets up nodejs which is a set of Javascript libraries.


Make sure you're connected to the internet and we'll download the git repository, effectively cloning it from github and then change to that directory. First you should navigate to your home directory, and we're assuming here that you logged into the BeagleBone Black as the root user:


cd ~/

git clone

cd iot-beaglebone/samples/nodejs


There is a setup script which should take care of everything for you. If you logged in as root, you do not need sudo:


sudo ./


Take note of any error messages that you see, this bundled up setup script which installs the packages of bluez and libbluetooth-dev. It also performs an 'npm install'.


Fixing the Code

There is a Javascript file which we have to alter ourselves, This is not hosted in github, but is likely pulled through when npm is run, so it is not necessarily straightforward to have been able to apply a preliminary fix.


We need to replace a file after successful running of the script, the file is attached to this blog post, you can download the file by using wget:




This will download the file to the current folder you are in, you then have to move the file to replace "iot_beaglebone/samples/nodejs/node_modules/sensortag/lib/cc2650.js". We should be able to do this in one command, like so:


wget  -O ~/iot_beaglebone/samples/nodejs/node_modules/sensortag/lib/cc2650.js


This is to fix an API change in the node/javascript calls. The -O parameter here may not strictly be correct,


Using the IoT Cloud


Now to associate the Sensor Tag with the BeagleBone Black and use it with the IBM Watson service:


cd ~/iot_beaglebone/samples/nodejs

node iot_sensortag.js


Registering your Device


Now you'll want to register your devices in the IBM Watson IoT Platform, there is also a Quickstart where you can check what information the device(s) are sending.

IOT setup using a bluetooth sensor streaming data to the Beaglebone which submits it to the IBM cloud


Note: This blog post is being superceded with updates here: BeagleBone Black IoT Project Bundle


This is forked from a project HERE, but changed slightly to work with the TI Sensor Tag CC2650.


It is a very easy project with only a few minor edits needed. This can be done in about 20 minutes from start to finish, and looks great at the end.



What You'll Need


Beagle Bone Black

TI Sensor CC265024701812470181



Installing Script


First we need to grab the code:

cd ~

git clone


Then we need to get to the code's directory

cd iot-beaglebone/samples/nodejs


Then we need to install the dependencies. Luckily this very easy thanks to the automated script provided

sudo ./


Editing the script


We only need to edit one file to get this to work. The credit for this edit goes to AshokRao.


You need to download the file attached to this blog, See at the bottom.

This file needs to replace the file iot_beaglebone/samples/nodejs/node_modules/sensortag/lib/cc2650.js. Copy the file at the bottom and replace the existing file with this new one


The only differences are on lines 186-188 where we have used a different version of the API from Node.js framework that does not evaluate the offset & continues to read the data from the buffer. The default is “false”. For documentation on this and other API’s, please refer: .



Running it


Everything is now done!

Just run the main script using the command

cd ~/iot_beaglebone/samples/nodejs
node iot_sensortag.js


Now follow the link below and type in your BBB's mac address (shown when you start the .js script) to view the data.



Hope it now works for all of you. Please leave your comments, suggestions, and problems below.

I have a Beagebone Black I/O cape on Kickstarter.




Features List

Here's the specific list of features that the card supports:

  •   (19) GPIOs GVS pins
  • (3) UARTs GVTxRx pins
  • (1) I2C bus GVSdaSck
  • (8) Channels of 3.3V to 5V level translators
  • Use female to female jumpers to route the GPIO lines to the translator channels 5V side has GVS pins
  • (7) 1.8V analog GVS connections with analog voltage/ground Buffer opamps on the analog inputs
  • 5V pins are all ESD protected pins with 15 kV of protection
  • Selectable 5V source (SYS_5V or VDD_5V)
  • 3.3V and 5V are fuse protected
  • Cape configuration EEPROM with write enable jumper
  • Beaglebone Black form factor

I am new to linux platform. Started working for beagle bone black platform development by following the steps given in the link, but i could not ale ot build u-boot to create MLO and image files.


After my last post Build fbtft drivers for Linux 4.4 on BeagleBone Black, I was curious what patches are needed to run mainline Linux kernel on BeagleBoard.  Here's what I've found so far:


Mainline Linux kernel


Robert C. Nelson's bb-kernel repo

"This git repo contains just scripts/patches to build a specific kernel for some ARM devices. The kernel source will be downloaded when you run any of the build scripts"


Patchset for BeagleBone:


BeagleBone Cape Manager (bone_capemgr):

Workaround: Disable DMA for SPI driver:


Related GitHub Gists:

Chicago hackerspace Pumping Station: One uses BeagleBoard to control door access:



There is BeagleBone Black on the Front Door and the Back Door:




The BeagleBone is a connected to a Sparkfun USB RFID breakout with a ID-12 RFID Reader.  This scans the RFID keys:


[More photos]


PS1 president Derek Bever and other members are collaborating on this GitHub repo:


Client-side RFID authentication (and general access control)

This system is built on a BeagleBone Black and Sparkfun's USB board for RFID readers for hardware, and PS1Auth's server-side RFID authentication on the backend.

Client-side software is written in Go.


In previous blog posts, I've showed how to use small LCD displays as a Linux framebuffer on the BeagleBone Black thanks to the fbtft drivers:


In this post, I will show how to use fbtft drivers on BBB with the latest version of the Linux kernel.  In this case, that is Linux 4.4.

Full transcript in this GitHub Gist.



Step 1: Build kernel

Clone Robert C. Nelson's bb-kernel repo and checkout the am33x-v4.4 branch.  When I did last week, the latest kernel version was 4.4-rc1-bone0:

laptop$ git clone


laptop$ cd bb-kernel/


laptop$ git checkout am33x-v4.4


laptop$ ./


The build kernel script will at some point open the kernel config menu system.  Enable Device Drivers->Staging->fbtft:





Step 2: Install kernel

Flash latest Debian 8.2 (Jessie) console image for the BBB:

laptop$ wget


laptop$ xz -d bone-debian-8.2-console-armhf-2015-11-15-2gb.img.xz


laptop$ sudo dd if=/home/afustini/Downloads/bbb-images/bone-debian-8.2-console-armhf-2015-11-15-2gb.img.xz of=/dev/sdc


laptop$ sudo eject /dev/sdc


Remove and re-insert so that fs gets mounted.  Run this from bb-kernel directory:

laptop$ ./tools/


Eject card and boot the BeagleBone with it.  Once booted, grow the filesystem to make use of free space on the card:

bone$ sudo /opt/scripts/tools/


bone$ sudo reboot


Finish installation of the new kernel on the BeagleBone.  The install script fails to do this.  In this case, my new kernel is 4.4.0-rc1-bone0:

bone$ sudo cp -pr /dtbs /boot/dtbs/4.4.0-rc1-bone0


bone$ sudo cp /zImage /boot/vmlinuz-4.4.0-rc1-bone0


Edit /boot/uEnv.txt on Beaglebone so that the new kernel is booted:

bone$ sudo vi /boot/uEnv.txt




bone$ sudo reboot


Verify the the BeagleBone booted the new kernel:

bone$ uname -a

Linux beaglebone 4.4.0-rc1-bone0 #4 Thu Nov 19 20:26:04 CST 2015 armv7l GNU/Linux



Step 3: Configure SPI


Build the latest Device Tree Overlays:

bone$ sudo apt-get update


bone$ sudo apt-get install git


bone$ git clone


bone$ cd


bone$ ./


bone$ ./

Load the Device Tree Overlay for BB-SPIDEV1 "virtual cape" as my LCD is wired up to spi1 pins:

bone$ cat /sys/devices/platform/bone_capemgr/slots

0: PF----  -1

1: PF----  -1

2: PF----  -1

3: PF----  -1

bone$ sudo /bin/sh -c 'echo BB-SPIDEV1 > /sys/devices/platform/bone_capemgr/slots'

bone$ cat /sys/devices/platform/bone_capemgr/slots

0: PF----  -1

1: PF----  -1

2: PF----  -1

3: PF----  -1

4: P-O-L-  0 Override Board Name,00A0,Override Manuf,BB-SPIDEV1



Step 4: Load fbtft drivers


Load fbtft_device module for adafruit18 (Adafruit 1.8" TFT LCD) which will use the fb_st7735r driver:

bone$ sudo modprobe fbtft_device busnum=1 name=adafruit18 debug=7 verbose=3 gpios=dc:48,reset:60

Display image on the LCD display:

bone$ sudo apt-get install fbi

bone$ wget ''

bone$ sudo fbi -d /dev/fb0 -T 1 -a BorisTux_w_Logo.png


Texas Instruments has their own Linux kernel repo with branches to support their processors such as the Sitara AM3358 in the BeagleBone Black:


Gitorious@TI: ti-linux-kernel

This repo contains a Linux kernel that has been integrated with outstanding TI open source patches based on the open source Linux kernel found at

Here is a good presentation for TI TechDay 2015 on how TI handles Linux engineering.


The most excellent Robert C. Nelson has made it very easy to run TI kernels on your BeagleBone Black by using his ti-linux-kernel-dev repo.  The newest branch is ti-linux-4.1.y.  While current stable is 4.3, TI is working on 4.1 as it is current Long Term Support (LTS) kernelLinux 4.4 is expected to be released at the end of the year, and that will become the new LTS kernel.  I believe TI will then move forward to that.


A big advantage of moving to Linux 4.1 is that the fbtft drivers are now in the Linux kernel: drivers/staging/fbtftLast December, Thomas Petazzoni of Free Electrons took it upon himself to add notro's fbtft drivers to the kernel: [PATCH 00/29] staging: add drivers from the fbtft project.  Development in notro's repo has ceased and moved to the Linux kernel drivers staging treefbtft is maintained by Noralf Trønnes (notro) & Thomas Petazzoni.


Here are the steps that I followed.  Full transcript is in my GitHub Gist.


Step 1: Build kernel

These commands were on my 64-bit Intel laptop running Debian GNU/Linux 8.2:

laptop$ git clone

Cloning into 'ti-linux-kernel-dev'...

remote: Counting objects: 6549, done.

remote: Compressing objects: 100% (56/56), done.

remote: Total 6549 (delta 37), reused 0 (delta 0), pack-reused 6493

Receiving objects: 100% (6549/6549), 5.21 MiB | 3.17 MiB/s, done.

Resolving deltas: 100% (5036/5036), done.

Checking connectivity... done.



laptop$ cd ti-linux-kernel-dev


laptop$ git checkout ti-linux-4.1.y

Branch ti-linux-4.1.y set up to track remote branch ti-linux-4.1.y from origin by rebasing.

Switched to a new branch 'ti-linux-4.1.y'


laptop$ ./

After running for awhile, will invoke the kernel config menu.  Enable the fbtft modules located in the Device Drivers -> Staging menu.  Here are photos of kernel config menus:





Step 2: Flash SD card

Flash a Debian 8.2 (Jessie) Snapshot console image from the BeagleBoneBlack Debian page on the wiki:

laptop$ sudo dd if=bone-debian-8.2-console-armhf-2015-10-11-2gb.img of=/dev/sdc

3481600+0 records in

3481600+0 records out

1782579200 bytes (1.8 GB) copied, 686.836 s, 2.6 MB/s


laptop$ sudo eject /dev/sdc


Step 3: Install new kernel

Re-insert SD card so that its filesystem is mounted.  Run the kernel install script from your ti-linux-kernel-dev directory:

laptop$ sudo ./tools/

Unmount and eject the SD card:

laptop$ sudo umount /dev/sdc1

laptop$ sudo eject /dev/sdc

Insert SD card into BeagleBone Black and boot it.


The install script fails to do the following so it must be done manually.  Copy the kernel image and device tree bindings to the expected location:

bone$ sudo cp /zImage /boot/vmlinuz-4.1.13-ti-r30

bone$ sudo cp -pr /dtbs /boot/dtbs/4.1.13-ti-r30


Edit /boot/uEnv.txt to set uname_r=4.1.13-ti-r30 and set dtb=am335x-boneblack-overlay.dtb:

bone$ sudo vi /boot/uEnv.txt



Run script to grow filesystem to make use of the SD cards full capacity:

bone$ cd /opt/scripts/tools

bone$ sudo ./

Reboot the BeagleBone:

bone$ sudo reboot


After rebooting, verify that the new kernel is running:

bone$ uname -a

Linux beaglebone 4.1.13-ti-r30 #1 SMP PREEMPT Mon Nov 16 00:50:22 CST 2015 armv7l GNU/Linux


Step 4: Enable SPI

Now build & install the latest Device Tree Overlays from repo:

bone$ git clone

bone$ cd

bone$ ./

bone$ ./


Enable the spi1 peripheral (which LCD is wired up to) by loading the BB-SPIDEV1 Device Tree overlay:

bone$ cat /sys/devices/platform/bone_capemgr/slots

0: PF---- -1

1: PF---- -1

2: PF---- -1

3: PF---- -1


bone$ sudo /bin/sh -c 'echo BB-SPIDEV1 > /sys/devices/platform/bone_capemgr/slots'


bone$ cat /sys/devices/platform/bone_capemgr/slots

0: PF---- -1

1: PF---- -1

2: PF---- -1

3: PF---- -1

4: P-O-L- 0 Override Board Name,00A0,Override Manuf,BB-SPIDEV1


Step 5: Load fbtft driver

Load the fbtft_device kernel module for adafruit18 (Adafruit 1.8" TFT LCD) which will then load the fb_st7735r driver:

bone$ sudo modprobe fbtft_device busnum=1 name=adafruit18 debug=7 verbose=3 gpios=dc:48,reset:60


Install fbi to display image on the LCD:

bone$ sudo apt-get update

bone$ sudo apt-get install fbi


bone$ wget ''

bone$ sudo fbi -d /dev/fb1 -T 1 -a BorisTux_w_Logo.png


My previous post showed how to use small TFT LCDs as a Linux framebuffer on a BeagleBone Black:


BeagleBone Black LCDs with Prebuilt FBTFT drivers


I showed how to use pre-built fbtft kernel modules to provide the necessary Linux device driver.  However, what if you want to use fbtft modules with a newer version of the Linux kernel?


The BeagleBone Black currently ships with a Linux 3.8 kernel built from Robert C. Nelson's am33x-v3.8 branch.  I do also have fbtft working on the BBB with newer kernels such as TI's 4.1 branch and mainline 4.4-rc1, but I will focus on Linux 3.8 for this post.


Here is how I built FBTFT for Linux 3.8.13-bone79 kernel:

(for my complete transcript see this GitHub Gist)


Step 1: Clone repo & checkout branch

Clone bb-kernel repo & checkout am33x-v3.8 branch

$ git clone


$ cd bb-kernel


$ git checkout am33x-v3.8

Already on 'am33x-v3.8'

Your branch is up-to-date with 'origin/am33x-v3.8'.


Step 2: Run build script

Move into the new branch directory & run the build kernel script:

$ ./



make -j4 ARCH=arm LOCALVERSION=-bone79 CROSS_COMPILE="ccache /home/afustini/dev/bbb/bb-kernel/dl/gcc-linaro-arm-linux-gnueabihf-4.7-2013.04-20130415_linux/bin/arm-linux-gnueabihf-" dtbs



Script Complete


Step 3: Add fbtft drivers

Add fbtft drivers into Linux kernel source based on instructions from fbtft README.


From within the bb-kernel dir:

$ cd KERNEL/drivers/video



$ git clone

Cloning into 'fbtft'...

remote: Counting objects: 1170, done.

remote: Total 1170 (delta 0), reused 0 (delta 0), pack-reused 1170

Receiving objects: 100% (1170/1170), 526.16 KiB | 0 bytes/s, done.

Resolving deltas: 100% (726/726), done.

Checking connectivity... done.


Add to KERNEL/drivers/video/Kconfig:

source "drivers/video/fbtft/Kconfig"


Add to KERNEL/drivers/video/Makefile:

obj-y += fbtft/

Verify files were modified correctly

$ git diff

diff --git a/drivers/video/Kconfig b/drivers/video/Kconfig

index a0c757a..50c5d62 100644

--- a/drivers/video/Kconfig

+++ b/drivers/video/Kconfig

@@ -2494,4 +2494,6 @@ config FB_SSD1307

  This driver implements support for the Solomon SSD1307

  OLED controller over I2C.


+source "drivers/video/fbtft/Kconfig"



diff --git a/drivers/video/Makefile b/drivers/video/Makefile

index 28bfbca..6bd03af 100644

--- a/drivers/video/Makefile

+++ b/drivers/video/Makefile

@@ -174,3 +174,6 @@ obj-$(CONFIG_DISPLAY_TIMING) += display_timing.o

obj-$(CONFIG_OF_DISPLAY_TIMING) += of_display_timing.o

obj-$(CONFIG_VIDEOMODE) += videomode.o

obj-$(CONFIG_OF_VIDEOMODE) += of_videomode.o


+obj-y += fbtft/



Step 4: Rebuild kernel

Now run the rebuild script to compile the fbtft modules:

$ ./tools/

+ Detected build host ["Fedora release 22 (Twenty Two)"]

+ host: [x86_64]

+ git HEAD commit: [a50680ea2cc2fc4519353dee4c1cbb47e475d8b2]



The kernel config menu should appear shortly after starting the rebuild script.  Follow these screenshots to select the fbtft drivers:





After exit the kernel config menu, the rebuild script should continue:

‘.config’ -> ‘/home/afustini/dev/bbb/bb-kernel/patches/defconfig’


make -j4 ARCH=arm LOCALVERSION=-bone79 CROSS_COMPILE="ccache /home/afustini/dev/bbb/bb-kernel/dl/gcc-linaro-arm-linux-gnueabihf-4.7-2013.04-20130415_linux/bin/arm-linux-gnueabihf-" zImage modules


scripts/kconfig/conf --silentoldconfig Kconfig


Script Complete


Verify in bb-kernel dir that fbtft modules were compiled:

$ find |grep fbtft |grep ko$







Verify in bb-kernel/deploy that kernel and tarballs were created

$ ls -ltar deploy/

-rwxrwxr-x 1 afustini afustini 5552136 Oct 31 13:01 3.8.13-bone79.zImage

-rw-rw-r-- 1 afustini afustini 110207 Oct 31 13:01 config-3.8.13-bone79

-rw-rw-r-- 1 afustini afustini 11690719 Oct 31 13:01 3.8.13-bone79-modules.tar.gz

-rw-rw-r-- 1 afustini afustini 1263879 Oct 31 13:01 3.8.13-bone79-firmware.tar.gz

-rw-rw-r-- 1 afustini afustini 39642 Oct 31 13:01 3.8.13-bone79-dtbs.tar.gz


Step 5: Install new kernel on SD Card (from Linux host)

My SD card already had been imaged with:


From within bb-kernel dir

$ sudo ./tools/

ERROR: MMC is not defined in


Edit script to specify which device is your SD card:

$ vi


Install new kernel onto microSD card:

$ sudo ./tools/


Installing 3.8.13-bone79-modules.tar.gz to /dev/sdd2

info: [3.8.13-bone79] now installed...

This script has finished...

For verification, always test this media with your end device...


Step 6: Boot new kernel

Boot BBB with the updated microSD card:

$ dmesg| head

[ 0.000000] Booting Linux on physical CPU 0x0

[ 0.000000] Initializing cgroup subsys cpu

[ 0.000000] Linux version 3.8.13-bone79 (XXXX@YYYY) (gcc version 4.7.3 20130328 (prerelease) (crosstool-NG linaro-1.13.1-4.7-2013.04-20130415 - Linaro GCC 2013.04) ) #4 SMP Sat Oct 31 13:00:55 CDT 2015


$ uname -a

Linux beaglebone 3.8.13-bone79 #4 SMP Sat Oct 31 13:00:55 CDT 2015 armv7l GNU/Linux


$ find /lib/modules/3.8.13-bone79/|grep fbtft







Edit u-boot config file uEnv.txt so the SPIDEV1 loads at boot and HDMI & eMMC are not loaded




For reference, this is my uEnv.txt


Verify that HDMI & eMMC are not loaded and SPIDEV1 is loaded:

NOTE: My BBB has no need for HDMI or eMMC. It may not be completely necessary to disable, but I did not investigated this.

$ cat /sys/devices/bone_capemgr.9/slots

0: 54:PF---

1: 55:PF---

2: 56:PF---

3: 57:PF---

4: ff:P-O-- Bone-LT-eMMC-2G,00A0,Texas Instrument,BB-BONE-EMMC-2G

5: ff:P-O-- Bone-Black-HDMI,00A0,Texas Instrument,BB-BONELT-HDMI

6: ff:P-O-- Bone-Black-HDMIN,00A0,Texas Instrument,BB-BONELT-HDMIN

7: ff:P-O-L Override Board Name,00A0,Override Manuf,BB-SPIDEV1


Step 7: Load fbtft driver & test display:

Photos of breadboard wiring using SPI1 (CS0, MOSI, SCLK), D/C, RESET.


Load fbtft st7735r driver for adafruit18 (Adafruit 1.8" TFT LCD display):

$ sudo modprobe fbtft_device busnum=1 name=adafruit18 debug=7 verbose=3 gpios=dc:48,reset:60


Console should now appear on the display. Refer to photos.


NOTE: if you have not already done, so run script to make sure all the free space on SD card can be utilized

$ sudo /opt/scripts/tools/


NOTE: apt-get may fail with warning "There is no public key available for the following key IDs". Fix by running running:

$ sudo apt-get install debian-keyring debian-archive-keyring

$ sudoe apt-get update


Display image file on the display with fbi:

$ sudo apt-get install fbi

$ wget

$ sudo fbi -d /dev/fb0 -T 1 -a tux.png

using "DejaVu Sans Mono-16", pixelsize=16.67 file=/usr/share/fonts/truetype/ttf-dejavu/DejaVuSansMono.ttf


Play video clip on the display with mplayer:

$ sudo apt-get install mplayer

$ wget

$ sudo mplayer -nolirc -vo fbdev:/dev/fb0 scale=WIDTH:128 hst_1.mpg


Kernel log with verbose debug output for adafruit18:

If using the Adafruit 2.2" TFT LCD display, then specify adafruit22a [note: the "a" suffix is important]

$ sudo modprobe fbtft_device busnum=1 name=adafruit22a debug=7 verbose=3 gpios=dc:48,reset:60


fbi and mplayer all work OK for adafruit22a.  Kernel log with verbose debug output for adafruit22a:



BeagleBone Black using Prebuilt FBTFT drivers



Step 1: Download, Flash & Boot Image


Download bone-debian-7.5-2014-05-14-2gb image:

Write image to SD card.  Here is example on my Linux laptop:

$ sudo dd if=/home/afustini/Downloads/bone-debian-7.5-2014-05-14-2gb.img of=/dev/sdc


Boot the BeagleBone with the microSD card and verify it is running Linux kernel 3.8.13-bone50:

$ cat /proc/version

Linux version 3.8.13-bone50 (root@imx6q-wandboard-2gb-0) (gcc version 4.6.3 (Debian 4.6.3-14) ) #1 SMP Tue May 13 13:24:52 UTC 2014


$ cat /etc/dogtag BeagleBone Debian Image 2014-05-14



Step 2: Expand SD card to ensure full capacity


Run script to grow the filesystem as root on BeagleBone:

$ sudo /opt/scripts/tools/


sfdisk: backing up partition layout.

sfdisk: initial calculation.


Disk /dev/mmcblk0: 242560 cylinders, 4 heads, 16 sectors/track

Old situation:

Units = mebibytes of 1048576 bytes, blocks of 1024 bytes, counting from 0



Re-reading the partition table ...

BLKRRPART: Device or resource busy

The command to re-read the partition table failed.

Run partprobe(8), kpartx(8) or reboot your system now,

before using mkfs

If you created or changed a DOS partition, /dev/foo7, say, then use dd(1)

to zero the first 512 bytes: dd if=/dev/zero of=/dev/foo7 bs=512 count=1

(See fdisk(8).)


Reboot the BeagleBone and verify that the root filesystem now is using the entire capacity of the the microSD card:

$ df -h

Filesystem Size Used Avail Use% Mounted on

rootfs 7.2G 1.6G 5.4G 22% /




Step 3: Install prebuilt fbtft drivers

Download the prebuilt fbtft kernel modules:

$ wget


Install the kernel modules:

$ sudo tar -zxPvf fbtft-2014-02-07-3.8.13-bone50.tar.gz





$ sudo depmod

Verify the modules are for 3.8.13-bone50:

$ modinfo fbtft


filename: /lib/modules/3.8.13-bone50/extra/fbtft.ko

license: GPL

srcversion: 3C6839F44999EEA4C1D8A9F


vermagic: 3.8.13-bone50 SMP mod_unload modversions ARMv7 thumb2 p2v8

parm: debug:override device debug level (ulong)

parm: dma:Use DMA buffer (bool)

Edit /boot/uboot/uEnv.txt to disable HDMI & eMMC "virtual capes" and enable SPIDEV1 "virtual cape":

$ sudo vi /boot/uboot/uEnv.txt


Uncomment this cape_disable line for HDMI & eMMC:

##BeagleBone Black:

##Disable HDMI/eMMC


Add this line to enable SPIDEV1:



Save the changes uEnv.txt & reboot the BeagleBone



Step 4: Load fbtft driver


Verify which capes are loaded:

$ cat /sys/devices/bone_capemgr.9/slots


0: 54:PF---

1: 55:PF---

2: 56:PF---

3: 57:PF---

4: ff:P-O-- Bone-LT-eMMC-2G,00A0,Texas Instrument,BB-BONE-EMMC-2G

5: ff:P-O-- Bone-Black-HDMI,00A0,Texas Instrument,BB-BONELT-HDMI

6: ff:P-O-- Bone-Black-HDMIN,00A0,Texas Instrument,BB-BONELT-HDMIN

7: ff:P-O-L Override Board Name,00A0,Override Manuf,BB-SPIDEV1

Use fbtft_device kernel module to load the fb_st7735r driver for Adafruit 1.8" TFT LCD display connected to SPI1:

$ sudo modprobe fbtft_device busnum=1 name=adafruit18 debug=7 verbose=3 gpios=dc:48,reset:60


Use fbtft_device kernel module to load the fb_ili9340 driver for Adafruit 2.2" TFT LCD display connected to SPI1:

$ sudo modprobe fbtft_device busnum=1 name=adafruit22a debug=7 verbose=3 gpios=dc:48,reset:60

NOTE: a suffix is important in adafruit22a


/dev/fb0 device should now exist:

$ ls -lsda /dev/fb*

0 crw-rw---T 1 root video 29, 0 Oct 30 06:27 /dev/fb0


The system console should now be displayed on the LCD:


More photos of fbtft working for 1.8" & 2.2" TFT LCDs


Example kernel log:

[ 181.848604] fbtft_device: SPI devices registered:

[ 181.848671] fbtft_device: spidev spi1.1 16000kHz 8 bits mode=0x00

[ 181.848705] fbtft_device: spidev spi1.0 16000kHz 8 bits mode=0x01

[ 181.848728] fbtft_device: 'fb' Platform devices registered:

[ 181.848860] fbtft_device: omapfb id=-1 pdata? yes

[ 181.849152] fbtft_device: Deleting spi1.0

[ 181.851923] fbtft_device: GPIOS used by 'adafruit22a':

[ 181.851960] fbtft_device: 'dc' = GPIO48

[ 181.851982] fbtft_device: 'reset' = GPIO60

[ 181.852002] fbtft_device: SPI devices registered:

[ 181.852033] fbtft_device: spidev spi1.1 16000kHz 8 bits mode=0x00

[ 181.852061] fbtft_device: fb_ili9340 spi1.0 32000kHz 8 bits mode=0x00

[ 182.235255] Console: switching to colour frame buffer device 60x53

[ 182.236682] graphics fb0: fb_ili9340 frame buffer, 240x320, 150 KiB video memory, 4 KiB DMA buffer memory, fps=20, spi1.0 at 32 MHz



Step 5: Display images and video


Based on FBTFT Wiki article: Framebuffer use


When using a fresh Debian image, one should first update the list of available packages before attempting to install new packages:

$ sudo apt-get update

Reading package lists... Done

W: There is no public key available for the following key IDs:


Fix public key ID warning:

$ sudo apt-get install debian-keyring debian-archive-keyring


$ sudo apt-get update

Install fbi utility to display image files on the framebuffer device:

$ sudo apt-get install fbi


$ wget


$ sudo fbi -d /dev/fb0 -T 1 -a tux.png

using "DejaVu Sans Mono-16", pixelsize=16.67 file=/usr/share/fonts/truetype/ttf-dejavu/DejaVuSansMono.ttf

Tux the Linux mascot should now be displayed on the LCD:


More photos of fbtft working for 1.8" & 2.2" TFT LCDs

Next, install mplayer to play a MPEG-2 video clip:

$ sudo apt-get install mplayer


$ wget


$ sudo mplayer -nolirc -vo fbdev:/dev/fb0 scale=WIDTH:128 hst_1.mpg

MPlayer svn r34540 (Debian), built with gcc-4.6 (C) 2000-2012 MPlayer Team


Playing scale=WIDTH:128.

File not found: 'scale=WIDTH:128'

Failed to open scale=WIDTH:128.



Playing hst_1.mpg.

libavformat version 53.21.1 (external)

Mismatching header version 53.19.0

MPEG-ES file format detected.

VIDEO: MPEG1 320x240 (aspect 1) 29.970 fps 320.0 kbps (40.0 kbyte/s)

Load subtitles in ./


Opening video decoder: [ffmpeg] FFmpeg's libavcodec codec family

libavcodec version 53.35.0 (external)

Mismatching header version 53.32.2

Selected video codec: [ffmpeg1] vfm: ffmpeg (FFmpeg MPEG-1)


Audio: no sound

Starting playback...

Unsupported PixelFormat 61

Unsupported PixelFormat 53

Unsupported PixelFormat 81

Could not find matching colorspace - retrying with -vf scale...

Opening video filter: [scale]

Movie-Aspect is 1.33:1 - prescaling to correct movie aspect.

[swscaler @ 0xb670f978]No accelerated colorspace conversion found from yuv420p to rgb565le.

[swscaler @ 0xb670f978]using unscaled yuv420p -> rgb565le special converter

VO: [fbdev] 320x240 => 320x240 BGR 16-bit

framebuffer too small for double-buffering, disabling

V: 19.0 570/570 20% 65% 0.0% 0 0



Exiting... (End of file)


You should now see the video clip playing on the display:


Borissmall-tor-bbb.jpgTor logo

My Tor relay running on a BeagleBone Black is even faster after upgrading to Debian 8 (Jessie) and tor 0.2.6 package for Jessie:

15 - 1.jpg

Thanks to Alison Macrina of the Library Freedom Project for the motivation to upgrade after watching her inspiring talk during the Aaron Swartz's Day 2015 celebration at Internet Archive last weekend:


A quick aside, if you've not seen this documentary about Aaron's life, then please be sure to watch it:

And... thanks to Comcast.  Despite their past sins, I've been able to run a Tor exit node (e.g. exit relay) via my cable modem connection for 1.5 years with no problems.  My connect is 50 Mbps down and 10 Mbps up.


My current Tor config


Previous version

My BBB had previously been running Debian 7 (Wheezy) for which package was 0.2.4.

Reduced Exit Policy

If you run a Tor exit node, then I recommend using this Reduced Exit Policy which will limit BitTorrent traffic (and thus DMCA complaints):


Debian 8 image

My BeagleBone Black is running this Debian 8.2 (Jessie) image from Robert C Nelson listed on

Jessie Snapshot console

Flasher: (console) (BeagleBone Black/Green eMMC):


sha256sum: 3c489ef2d6809a7b50396d16770752a8c067478680946428d12a747bb8c4688f


I've not posted about my Tor relay on element14 Community before, so I figure I should provide some context.


Last year I did a presentation at my hackerspace about how to run a Tor relay on a BeagleBone Black:



If that Meetup link breaks over time, then here is a GitHub Gist all my notes and links:



I was inspired to run a Tor relay after watching these talks:




Tor for users


Talks by Josh Datko about Tor & BeagleBone

How Tor works

Tor Hardware Hacking


Tor on BeagleBone blog posts:


Run a your own Tor relay!


Stats for my BeagleBone Black relay

Notes for Tor Relay running as Exit Node


Not into running a Tor relay home?

# file: /etc/tor/torrc

ORPort 443

Exitpolicy reject *:*

Nickname EFFisMyHero

ContactInfo pdp7pdp7 AT gmail dot com GPG: 0x84D44A9317F1138E

Log notice file /var/log/tor/notices.log

RelayBandwidthRate 1024 KB

RelayBandwidthBurst 1024 KB

MaxAdvertisedBandwidth 1024 KB

DisableDebuggerAttachment 0

Stats for my EFFisMyHero relay on DigitalOcean:


Not into running your own Tor relay?

In some previous posts, I first set up Bluetooth on the Beaglebone Black and then set up Node-Red to convert the Bluetooth data to MQTT messages. In this third post, I'll be using OpenHAB to receive the MQTT messages, process them and use them for notifications, trending, etc ...






The installation of Java and OpenHAB is already covered in detail in one of my posts here on element14. The post can be found here: [AirCare] InTheAir - Week 5: openHAB and MQTT

In order to use OpenHAB with the SensorTag, different items, sitemap, rules, etc ... will be created though. You'll find them in the next paragraphs.






From Node-RED, all data is being published to the same topic, so in OpenHAB a master item has been defined to subscribe to the appropriate topic.

Other items have been defined in addition to the master item. They will be assigned with values parsed from the master item, categorising the data in different types such as temperature, humidity, buttons, etc ...


The items file contains the following:


debian@beaglebone:~$ cat /opt/openhab/configurations/items/sensortag.items

Group All

String SensorTag "SensorTag Raw Data [%s]" <sensortag> (All) {mqtt="<[eclipseIot:fvan-sensortag:state:default]"}

Number SensorTag_Temperature_Ambient "SensorTag Ambient Temperature [%.1f °C]" <sensortag> (All)
String SensorTag_Temperature_Object "SensorTag Object Temperature [%s °C]" <sensortag> (All)
String SensorTag_Humidity "SensorTag Humidity [%s %%RH]" <sensortag> (All)
String SensorTag_Pressure "SensorTag Pressure [%s hPa]" <sensortag> (All)
String SensorTag_Keys_1 "SensorTag Key #1 [MAP(]" <sensortag> (All)
String SensorTag_Keys_2 "SensorTag Key #2 [MAP(]" <sensortag> (All)

Number Chart_Period "Chart Period"


The screenshot below demonstrates the initial tests, comparing Node-RED's output to OpenHAB's input. A limiter was set in place to prevent flooding of data, limiting to 6 messages per minute per sensor used.

Screen Shot 2015-07-17 at 21.14.59.png




The sitemaps file is used to arrange the different items visually, in certain (sub)categories, even including charts. In this example, a chart has been defined for the ambient temperature item, with three possible display periods: hour, day, week.


debian@beaglebone:~$ cat /opt/openhab/configurations/sitemaps/sensortag.sitemap

sitemap sensortag label="SensorTag" {
        Frame {
                Text item=SensorTag
        Frame {
                Text item=SensorTag_Temperature_Ambient {
                        Frame {
                                Text item=SensorTag_Temperature_Ambient
                        Frame {
                                Switch item=Chart_Period label="Chart Period" mappings=[0="Hour", 1="Day", 2="Week"]
                                Chart item=SensorTag_Temperature_Ambient period=h refresh=10000 visibility=[Chart_Period==0, Chart_Period=="Uninitialized"]
                                Chart item=SensorTag_Temperature_Ambient period=D refresh=10000 visibility=[Chart_Period==1]
                                Chart item=SensorTag_Temperature_Ambient period=W refresh=10000 visibility=[Chart_Period==2]
                Text item=SensorTag_Temperature_Object
                Text item=SensorTag_Pressure
                Text item=SensorTag_Humidity
                Text item=SensorTag_Keys_1
                Text item=SensorTag_Keys_2


The result is the following:

Screen Shot 2015-07-20 at 11.14.40.png




Rules can be used to trigger actions based on certain events. In this particular case, two rules have been defined:

  • Categorise data
  • Temperature alarm


The first rule is triggered when the master item defined in the items file is updated to a new value. The rule then parses the content in order to categorise it and assign the contents to the item representing the correct sensor. Using some simple string operations, the useful content is extracted from the incoming data.


The second rule demonstrates the use of notifications using Prowl. For testing purposes, I have a notification triggered when the temperature is lower than 50°C. Obviously, this would need to be set to more realistic values, but it is a quick way of verifying the notification mechanism works.


To know more about notifications in OpenHAB using Prowl, be sure to check out the following post:…


debian@beaglebone:~$ cat /opt/openhab/configurations/rules/sensortag.rules

import org.openhab.core.library.types.*
import org.openhab.core.persistence.*
import org.openhab.model.script.actions.*
import java.lang.Math
import java.lang.Double
import java.lang.String

var Timer temperature_alarm = null

rule "Categorise data"
        Item SensorTag changed
        var state = SensorTag.state.toString()
        var output = ""

        if(state.contains("ambient")) {
                output = state.substring(state.indexOf('"ambient":')+10,state.indexOf('}'))

                output = state.substring(state.indexOf('"object":')+9,state.indexOf(','))
        else if(state.contains("pressure")) {
                output = state.substring(state.indexOf(':')+1,state.indexOf('}'))
        else if(state.contains("humidity")) {
                output = state.substring(state.indexOf('"humidity":')+11,state.indexOf('}'))
        else if(state.contains("right")) {
                output = state.substring(state.indexOf('"right":')+8,state.indexOf('}'))

                output = state.substring(state.indexOf('"left":')+7,state.indexOf(','))

rule "Temperature alarm"
        Item SensorTag_Temperature_Ambient changed
        var state = SensorTag_Temperature_Ambient.state as DecimalType

        if(state < 50.0) {
                if(temperature_alarm == null) {
                        pushNotification("<api key>","Ambient temperature", "too low: " + state)
                        temperature_alarm = createTimer(now.plusMinutes(1)) [|
                                temperature_alarm = null


Here's a screenshot demonstrating the data being categorised properly:

Screen Shot 2015-09-12 at 12.42.15.png


And some screenshot of the notifications being received on my phone:





It is also possible to transform the data in the visualisation layer of OpenHAB. For example, the buttons return a true/false state. More meaningful would be to have the state reported as pressed or released.

By creating a file in the transform folder and reference it in the items file, this can be done quickly. The file contains one translation per line. In the GUI, "true" will be replaced by "pressed" and "false" by "released". The "-=-" is there to avoid OpenHAB reporting translation errors when no data has been received yet.


debian@beaglebone:~$ cat /opt/openhab/configurations/transform/





Finally, persistence is what defines which data to store and with which type of storage (MySQL, RRD4J, ...). Persistence is required when using charts.


debian@beaglebone:~$ cat /opt/openhab/configurations/persistence/rrd4j.persist

Strategies {
        everyMinute : "0 * * * * ?"
        everyHour : "0 0 * * * ?"
        everyDay : "0 0 0 * * ?"

        default = everyChange

Items {
        * : strategy = everyChange, everyMinute, restoreOnStartup





This concludes this short series of post on how to retrieve data from a SensorTag via Bluetooth, convert it to MQTT using Node-RED and persist/monitor/trend it using OpenHAB.

This week's episode features Jason of BB:


110: Happiness Is a Warm Puppy — Embedded

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.




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 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:


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
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


Screen Shot 2015-07-15 at 19.45.55.png


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:


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
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.

Screen Shot 2015-07-15 at 20.15.18.png



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.


Screen Shot 2015-07-15 at 20.48.38.pngScreen Shot 2015-07-15 at 20.57.09.png


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

Screen Shot 2015-07-16 at 19.47.13.pngScreen Shot 2015-07-16 at 20.10.39.png

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!