Skip navigation
2015

This week's embedded.fm 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.

 

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



 

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

Screen Shot 2015-07-15 at 20.15.18.png

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.

 

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!

This post is part of my RoadTest review for the TI CC2650STK SimpleLink IoT SensorTag. As I plan to use the BeagleBoard for data collection, I thought I'd blog about how to get BLE to work on it first.

photo (22).JPGphoto+1.JPG

Here we go ...

 

Preparing the BBB

 

Before we jump to setting up BLE on the BBB, we require an operational BBB with internet connection. The full setup of the BBB using Debian can be found in one of my earlier posts: [AirCare] InTheAir - Week 2: Preparing the Beaglebone Black

 

It covers the following topics:

  • preparing the SD card with Debian
  • expanding the filesystem, making use of the full SD card's available space
  • setting up network connectivity using wifi
  • connect a touchscreen display

 

Setting up Bluetooth

 

Update

 

I hadn't use my BBB for a while before setting up the bluetooth, so the first thing I did was to update the software.

 

debian@beaglebone:~$ sudo apt-get update
debian@beaglebone:~$ sudo apt-get upgrade



 

Bluetooth

 

Once the BBB's software was up-to-date, I installed the bluetooth software.

 

debian@beaglebone:~$ sudo apt-get install bluetooth











 

This resulted in a lot of packages being installed, for a total of 144MB of additional disk space.

 

The following extra packages will be installed:
  bc bluez bluez-alsa bluez-cups bluez-gstreamer cups cups-client cups-common cups-filters cups-ppdc dc fonts-droid fonts-freefont-ttf foomatic-db-compressed-ppds foomatic-db-engine foomatic-filters ghostscript ghostscript-cups hpijs hplip hplip-data libart-2.0-2
  libcupscgi1 libcupsdriver1 libcupsfilters1 libcupsimage2 libcupsmime1 libcupsppdc1 libescpr1 libgs9 libgs9-common libgutenprint2 libhpmud0 libijs-0.35 libjbig2dec0 liblcms1 libpaper-utils libpaper1 libpoppler19 libsane-hpaio libsensors4 libslp1 libsnmp-base libsnmp15
  mscompress poppler-data poppler-utils printer-driver-all printer-driver-c2050 printer-driver-c2esp printer-driver-cjet printer-driver-escpr printer-driver-foo2zjs printer-driver-gutenprint printer-driver-hpcups printer-driver-hpijs printer-driver-m2300w
  printer-driver-min12xxw printer-driver-pnm2ppa printer-driver-postscript-hp printer-driver-ptouch printer-driver-pxljr printer-driver-sag-gdi printer-driver-splix python-imaging python-pexpect python-renderpm python-reportlab python-reportlab-accel samba-common
  samba-common-bin smbclient ttf-freefont
Suggested packages:
  cups-bsd cups-pdf xpp hplip-cups openprinting-ppds cjet foomatic-db-gutenprint ghostscript-x hplip-gui hplip-doc system-config-printer gutenprint-locales liblcms-utils lm-sensors slpd openslp-doc snmp-mibs-downloader fonts-japanese-mincho fonts-ipafont-mincho
  fonts-japanese-gothic fonts-ipafont-gothic fonts-arphic-ukai fonts-arphic-uming fonts-unfonts-core psutils hannah-foo2zjs tk8.4 tix gutenprint-doc hpijs-ppds magicfilter apsfilter python-imaging-doc python-imaging-dbg python-renderpm-dbg pdf-viewer
  python-egenix-mxtexttools python-reportlab-doc cifs-utils
Recommended packages:
  foomatic-db
The following NEW packages will be installed:
  bc bluetooth bluez bluez-alsa bluez-cups bluez-gstreamer cups cups-client cups-common cups-filters cups-ppdc dc fonts-droid fonts-freefont-ttf foomatic-db-compressed-ppds foomatic-db-engine foomatic-filters ghostscript ghostscript-cups hpijs hplip hplip-data
  libart-2.0-2 libcupscgi1 libcupsdriver1 libcupsfilters1 libcupsimage2 libcupsmime1 libcupsppdc1 libescpr1 libgs9 libgs9-common libgutenprint2 libhpmud0 libijs-0.35 libjbig2dec0 liblcms1 libpaper-utils libpaper1 libpoppler19 libsane-hpaio libsensors4 libslp1
  libsnmp-base libsnmp15 mscompress poppler-data poppler-utils printer-driver-all printer-driver-c2050 printer-driver-c2esp printer-driver-cjet printer-driver-escpr printer-driver-foo2zjs printer-driver-gutenprint printer-driver-hpcups printer-driver-hpijs
  printer-driver-m2300w printer-driver-min12xxw printer-driver-pnm2ppa printer-driver-postscript-hp printer-driver-ptouch printer-driver-pxljr printer-driver-sag-gdi printer-driver-splix python-imaging python-pexpect python-renderpm python-reportlab
  python-reportlab-accel samba-common samba-common-bin smbclient ttf-freefont
0 upgraded, 74 newly installed, 0 to remove and 0 not upgraded.
Need to get 47.8 MB of archives.
After this operation, 144 MB of additional disk space will be used.
Do you want to continue [Y/n]? y











 

Dongle

 

I got myself a cheap BT dongle from Trust, paying special attention to support for Bluetooth 4.0 (BLE).

photo (21).JPG

 

Plugged in the dongle in the BBB's USB port and check if the device was detected properly. If you have more than one USB device to connect, you may need a powered USB HUB to connect them all simultaneously.

 

debian@beaglebone:~$ lsusb
Bus 001 Device 003: ID 0a12:0001 Cambridge Silicon Radio, Ltd Bluetooth Dongle (HCI mode)
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub








 

Tools

 

With the software installed and the dongle plugged it, it's time to look at the software tools used to get some data from the SensorTag.

 

hcitool

 

hcitool is used to configure Bluetooth connections and send some special command to Bluetooth devices.

 

First, check hcitool detects your bluetooth dongle.

 

debian@beaglebone:~$ sudo hcitool dev
Devices:
  hci0 00:1A:7D:DA:71:0F








 

Perform a scan to find out the SensorTag's address.

 

debian@beaglebone:~$ sudo hcitool lescan
LE Scan ...
B0:B4:48:B8:23:01 (unknown)
B0:B4:48:B8:23:01 CC2650 SensorTag
...








 

Create connection to SensorTag, using previously scanned address.

 

debian@beaglebone:~$ sudo hcitool lecc B0:B4:48:B8:23:01
Connection handle 69



 

gatttool

 

gatttool is a tool used to interact with BLE devices.

 

Use gatttool in interactive mode to send commands to the previously scanned address.

 

debian@beaglebone:~$ sudo gatttool -b B0:B4:48:B8:23:01 -I
[  ][B0:B4:48:B8:23:01][LE]>








 

Connect to the SensorTag, notice how the prefix changes from "[  ]" to "[CON]".

 

[  ][B0:B4:48:B8:23:01][LE]> connect
[CON][B0:B4:48:B8:23:01][LE]>








 

Request the characteristics of the device.

 

[CON][B0:B4:48:B8:23:01][LE]> characteristics
[CON][B0:B4:48:B8:23:01][LE]>
handle: 0x0002, char properties: 0x02, char value handle: 0x0003, uuid: 00002a00-0000-1000-8000-00805f9b34fb
handle: 0x0004, char properties: 0x02, char value handle: 0x0005, uuid: 00002a01-0000-1000-8000-00805f9b34fb
handle: 0x0006, char properties: 0x02, char value handle: 0x0007, uuid: 00002a04-0000-1000-8000-00805f9b34fb
handle: 0x0009, char properties: 0x20, char value handle: 0x000a, uuid: 00002a05-0000-1000-8000-00805f9b34fb
handle: 0x000d, char properties: 0x02, char value handle: 0x000e, uuid: 00002a23-0000-1000-8000-00805f9b34fb
handle: 0x000f, char properties: 0x02, char value handle: 0x0010, uuid: 00002a24-0000-1000-8000-00805f9b34fb
handle: 0x0011, char properties: 0x02, char value handle: 0x0012, uuid: 00002a25-0000-1000-8000-00805f9b34fb
handle: 0x0013, char properties: 0x02, char value handle: 0x0014, uuid: 00002a26-0000-1000-8000-00805f9b34fb
handle: 0x0015, char properties: 0x02, char value handle: 0x0016, uuid: 00002a27-0000-1000-8000-00805f9b34fb
handle: 0x0017, char properties: 0x02, char value handle: 0x0018, uuid: 00002a28-0000-1000-8000-00805f9b34fb
handle: 0x0019, char properties: 0x02, char value handle: 0x001a, uuid: 00002a29-0000-1000-8000-00805f9b34fb
handle: 0x001b, char properties: 0x02, char value handle: 0x001c, uuid: 00002a2a-0000-1000-8000-00805f9b34fb
handle: 0x001d, char properties: 0x02, char value handle: 0x001e, uuid: 00002a50-0000-1000-8000-00805f9b34fb
handle: 0x0020, char properties: 0x12, char value handle: 0x0021, uuid: f000aa01-0451-4000-b000-000000000000
handle: 0x0023, char properties: 0x0a, char value handle: 0x0024, uuid: f000aa02-0451-4000-b000-000000000000
handle: 0x0025, char properties: 0x0a, char value handle: 0x0026, uuid: f000aa03-0451-4000-b000-000000000000
handle: 0x0028, char properties: 0x12, char value handle: 0x0029, uuid: f000aa21-0451-4000-b000-000000000000
handle: 0x002b, char properties: 0x0a, char value handle: 0x002c, uuid: f000aa22-0451-4000-b000-000000000000
handle: 0x002d, char properties: 0x0a, char value handle: 0x002e, uuid: f000aa23-0451-4000-b000-000000000000
handle: 0x0030, char properties: 0x12, char value handle: 0x0031, uuid: f000aa41-0451-4000-b000-000000000000
handle: 0x0033, char properties: 0x0a, char value handle: 0x0034, uuid: f000aa42-0451-4000-b000-000000000000
handle: 0x0035, char properties: 0x0a, char value handle: 0x0036, uuid: f000aa44-0451-4000-b000-000000000000
handle: 0x0038, char properties: 0x12, char value handle: 0x0039, uuid: f000aa81-0451-4000-b000-000000000000
handle: 0x003b, char properties: 0x0a, char value handle: 0x003c, uuid: f000aa82-0451-4000-b000-000000000000
handle: 0x003d, char properties: 0x0a, char value handle: 0x003e, uuid: f000aa83-0451-4000-b000-000000000000
handle: 0x0040, char properties: 0x12, char value handle: 0x0041, uuid: f000aa71-0451-4000-b000-000000000000
handle: 0x0043, char properties: 0x0a, char value handle: 0x0044, uuid: f000aa72-0451-4000-b000-000000000000
handle: 0x0045, char properties: 0x0a, char value handle: 0x0046, uuid: f000aa73-0451-4000-b000-000000000000
handle: 0x0048, char properties: 0x10, char value handle: 0x0049, uuid: 0000ffe1-0000-1000-8000-00805f9b34fb
handle: 0x004d, char properties: 0x0a, char value handle: 0x004e, uuid: f000aa65-0451-4000-b000-000000000000
handle: 0x004f, char properties: 0x0a, char value handle: 0x0050, uuid: f000aa66-0451-4000-b000-000000000000
handle: 0x0052, char properties: 0x1a, char value handle: 0x0053, uuid: f000ac01-0451-4000-b000-000000000000
handle: 0x0055, char properties: 0x0a, char value handle: 0x0056, uuid: f000ac02-0451-4000-b000-000000000000
handle: 0x0057, char properties: 0x0a, char value handle: 0x0058, uuid: f000ac03-0451-4000-b000-000000000000
handle: 0x005a, char properties: 0x12, char value handle: 0x005b, uuid: f000ccc1-0451-4000-b000-000000000000
handle: 0x005d, char properties: 0x08, char value handle: 0x005e, uuid: f000ccc2-0451-4000-b000-000000000000
handle: 0x005f, char properties: 0x08, char value handle: 0x0060, uuid: f000ccc3-0451-4000-b000-000000000000
handle: 0x0062, char properties: 0x1c, char value handle: 0x0063, uuid: f000ffc1-0451-4000-b000-000000000000
handle: 0x0066, char properties: 0x1c, char value handle: 0x0067, uuid: f000ffc2-0451-4000-b000-000000000000







 

Request the device name using the proper characteristic, by handle.

 

[CON][B0:B4:48:B8:23:01][LE]> char-read-hnd 0x3
[CON][B0:B4:48:B8:23:01][LE]>
Characteristic value/descriptor: 53 65 6e 73 6f 72 54 61 67 20 32 2e 30








 

The response is hexadecimal. To make it human readable, it needs to be converted to ASCII. This can be done using some command line magic.

 

debian@beaglebone:~$ echo -e $(echo -e " 53 65 6e 73 6f 72 54 61 67 20 32 2e 30" | sed 's/ /\\x/g') | awk '{printf "%s\n", $_}'
SensorTag 2.0




 

(The above command is probably far too complicated for what I'm trying to achieve, so if any command line wizard is reading this, please help improve my magic ...)

 

Or using Python for example.

 

debian@beaglebone:~$ python
Python 2.7.3 (default, Mar 14 2014, 17:55:54)
[GCC 4.6.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> "53656e736f7254616720322e30".decode("hex")
'SensorTag 2.0'




 

Conclusion

 

There you have it, BLE on the BBB. I was able to connect to the SensorTag and retrieve it's name. Once I've identified the other characteristics, I'll be able to take in the data I want and keep a history of it.

Gorgeous black solder mask!

I have always wanted to get my hands on a BeagleBoneBlackBeagleBoneBlack (BBB), and it seems that I chose the right time to do so. It hasn't been long now since the new spin of the BeagleBoneBlack started shipping with Debian pre-installed onto the board's permanent eMMC storage. This was enabled through the upgrade in size, from 2GB to the current 4GB, of the on-board flash, which was done for a couple of reasons: first of all, 2GB isn't that much space. The Raspberry PiRaspberry Pi recommends at least a 4GB SD card, by comparison. Also, the supply of the 2GB eMMC chips was starting to fade – 4GB being the lowest offering currently, so the move was done to maintain supply as well. Remember, though, that storage is not an issue – you can add a 64GB SD card if you wanted! It's mostly the access time that is the major difference.

 

Originally, as many BBB owners will know, the BBB used a distribution of Linux known as Angstrom Linux – so named because of its small size and fast booting. A perfect match, it would seem, for a small single-board computer. However, with a large number of the maker community using Raspberry Pi, and having the Raspbian spin of Debian available, many felt underwhelmed by the default settings and GUI of Angstrom after picking up a BBB.

 

As soon as the Rev C version of the BBB became available, sales went through the roof – as many will remember, during parts of 2014 it was almost impossible to buy one. This was largely due to the fact that it now had enough space for the pre-installed Debian, plus the increased processor speed and RAM. The huge, dual 46-pin headers helped, too – compared to other single-board computers this size, it's hard to believe that you can have this many pins brought out for user applications!

 

Upon opening the box, I was immediately impressed with the board. I must admit, I'm a bit of a TI fanboy, so that helped – but the black solder mask and the rounded corners made it look sleek and sexy. I eagerly fired it up, and was impressed with the boot time into Debian – one of the effects of having the OS in eMMC memory. Everything just worked out of the box – SSH was set up, plugging the USB into my laptop revealed a serial terminal, a built-in web server (which we'll talk about in a bit!) and an emulated USB flash drive! Clearly this was designed with development in mind. Having a serial terminal over USB is a great move – though there is a serial header on board, you don't even need to use it! This can make a big difference in the ease of troubleshooting and/or development. If SSH is not an option, plugging it into USB means you can work on the board with literally no other connections – no monitor, keyboard, DC input, Wi-Fi, Ethernet, nothing. Just a single USB cable. Now that is how it should be done! This is even more critical as there is only one USB host port, meaning to have more than just a keyboard plugged in you need a USB hub. For most developers this isn't an issue, but it's annoying to Check out the huge headers!have this extra box hanging off of the board. I've found the best way to work with the BBB is to have it plugged into a laptop, with an Ethernet cable for internet access (if you have a cable nearby – otherwise, you can use the empty USB port for Wi-Fi!).

 

Now, the real question today is what the differences are between Angstrom Linux and Debian. For those familiar with Linux and its varieties, you'll know that Debian is one of the big names. With a huge user base and many excellent developers (not to mention being the distro that Ubuntu is based on!) Debian provides a smooth experience, with a wide choice of desktop environments to choose from and an enormous package repository. This is a plus for developers as your favourite IDE and compiler are likely available (in my case, Code::Blocks was, of course, immediately installable). However, the flair and large package assortment is also the weakness on a platform like the BBB. Remember that this is just a small ARMsmall ARM processor with 512MB of RAM. Though overall responsiveness is acceptable, there are times when the processor gets bogged down which make it feel completely sluggish and unusable. This is part of the reason I wanted to compare it to Angstrom. From what I'd heard, Angstrom was a much more bare-bones, stripped-down distro aimed at lightweight computing and development. It seems on paper like a much better choice for writing code and doing embedded development.

 

So it was off to the BeagleBone website to try and find the Angstrom flasher – I wanted to install Angstrom to the eMMC to have a fair comparison against Debian. As the BBB has now completely switched to Debian, the Angstrom images are listed under “Older Images”. I noticed there were both SD card and eMMC flasher versions. I downloaded the flasher version, and burned it to a freshly formatted SD card. Flashing the BBB (or even booting from the SD card) is supposed to be very simple – insert the SD card, remove power, hold down the BOOT button (S2, down by the SD card slot), and then power up the board while continuing to hold the BOOT button. If you're flashing Debian to the eMMC, you'll be rewarded by the LEDs flashing in a back-and-forth pattern. Once the process starts, it can take anywhere from 15 to 45 minutes to write the flash. However, be warned – when flashing Angstrom, there are no such LED indications to let you know you're on the right track. It actually boots into Angstrom while it flashes! This really confused me, and so I spent ages unplugging and replugging the power, holding down the BOOT button for as many different lengths of time as seemed reasonable, and formatting/re-burning the SD card five or six times. I even found two different versions of the eMMC burner, dated a few months apart in 2013. Eventually, I just left it running overnight at the command prompt, and when I tried to boot back into Debian the next morning, it booted into Angstrom without the SD card! So, clearly it had worked. You just need to be aware of how the burning process works!

Get hacking!

 

The first thing I noticed after booting into Angstrom is that it uses a non-standard package manager. As a long-time Linux user, I feel comfortable using pacman, yum, apt-get, even the lower-level stuff like RPM and DPKG. However, Angstrom uses opkg, a manager I hadn't heard of but seems to accept similar commands to yum and apt-get – things like opkg install, opkg update and opkg upgrade worked flawlessly. I highly recommend running those last two (update and upgrade) out of the box, as it seems there are a large number of updates not included in the last release available on the BeagleBone website.

 

To do our comparison testing, I'm going to be using a piece of software called the Phoronix Test Suite. This is an open software benchmarking application which is cross-platform and freely available! It also has a companion site called openbenchmarking.org which contains tons of pre-written tests that you can execute directly from the command line. Today, we'll be using two tests, one to test the hardware, and one to test the system. To test the hardware, we run a series of compression tests, which will stress the processor and give us a baseline. We shouldn't see too much of a difference, but the OS does indeed schedule tasks and give priority, so this will also test the system a bit as well. For the system testing, we'll encode audio in a variety of formats – this will also stress the processor, but according to what I've read it seems to be more of a system stress test as it really pushes the OS to see how well it manages tasks. For whatever reason, some of the tests wouldn't run on Debian, and some wouldn't run on Angstrom – I've marked these with DNR. This is almost certainly just a compatibility problem, as these tests were designed for full-size systems, in most cases. I've included the results of the same tests done on a Raspberry Pi Model B+ overclocked to 900MHz. This isn't a wholly fair comparison, but should give readers familiar with the Pi a sort of baseline with which to compare.

 

As you can see, the results are slightly mixed. Angstrom performed much better on the compression tests, but falls short on FLAC and MP3 encoding. I can't say this is exactly what I expected, although without knowing more about how the kernel is compiled for each distribution, my only theory is that Debian generally has more focus on multimedia applications, which gives it the slight edge in audio encoding. Angstrom is much lighter, which probably explains the compression test results being so varied.

 

Now that the BeagleBoneBlack comes pre-installed with Debian, I imagine that the vast majority of users will stick with it. However, after using both, I've started to take a liking to Angstrom. On some tasks it feels much snappier and responsive, though Debian's wider software support is also a plus. Angstrom's smaller installation size, the original reason the BBB developers chose it in the first place, is another plus if size becomes an issue. The older BBB revisions, will, of course, have to stay with Angstrom on the eMMC as they cannot hold Debian. You can still boot and run Debian from an SD card, so that option is there as well, though of course the performance won't be as good. My recommendation, especially to newer users, would be to stick with Debian unless you have a good reason to switch.

 

However, the real shocker was how poorly the Raspberry Pi performed in some categories! While it performed better at encoding FLAC and MP3, it fell apart in the compression category, with the exception of 7-Zip compression. I was really surprised that the LZMA compression was almost 400 seconds longer than the BBB with Angstrom! However, as I mentioned earlier, these two boards are for very different purposes, which is actually revealed through these tests. The Raspberry Pi is optimized for multimedia and GUI interaction, whereas the BBB is optimized for embedded software and hardware development. This is shown by the huge GPIO headers on the BeagleBoneBlack – 80 pins in total to the RPi's 40 on the B+ and only 26 on the original models.

Beautiful layout!

 

Whichever board you end up choosing, there are vast amounts of cool hardware add-ons and thousands of software libraries and tutorials available online. I highly recommend checking out both boards if you have the chance – you'll see that they fit their categories exceptionally well. The BeagleBoneBlack is the sort of device I would put into an autonomous robot. The Raspberry Pi could also be used, but the advantage of the huge GPIO and multiple hardware protocols is evident in such an application. The Raspberry Pi is the board of choice for projects like the Super Pi Boy – building a Pi into a Game Boy case, with an upgraded colour LCD and an SD card full of emulated games! The Pi's excellent multimedia support, coupled with the good support for touchscreens and LCDs, really shines through in such an application.

 

Thanks for reading, and stick around for more projects in the near future! Let me know below what projects you've used these boards for, and what your pros and cons for each would be.

 

All test results are measured in seconds!

 

BeagleBoneBlack with Debian

 

COMPRESSION

RESULT 1

RESULT 2

RESULT 3

RESULT 4

RESULT 5

AVERAGE

7-Zip Compress

 

 

 

 

 

DNR

Parallel BZIP2

6.252073

7.181118

7.585148

7.744592

7.625200

7.36

GZIP Compress

 

 

 

 

 

DNR

LZMA Compress

1568.9417

1563.2622

1566.2461

 

 

1566.15

 

 

AUDIO ENC.

RESULT 1

RESULT 2

RESULT 3

RESULT 4

RESULT 5

AVERAGE

WAV->APE

130.818

130.060

132.219

130.096

130.569

130.75

WAV->FLAC

887.864

888.487

939.170

911.743

888.349

903.12

WAV->MP3

418.593

418.588

418.825

417.441

421.850

419.06

WAV->OGG

 

 

 

 

 

DNR

 

BeagleBoneBlack with Angstrom

 

COMPRESSION

RESULT 1

RESULT 2

RESULT 3

RESULT 4

RESULT 5

AVERAGE

7-Zip Compress

343

339

344

 

 

342

Parallel BZIP2

4.835072

7.050925

7.336689

7.256099

7.300720

6.86

GZIP Compress

173.596

149.212

149.415

148.038

148.924

153.25

LZMA Compress

1503.6176

1501.6726

1538.0704

 

 

1514.45

 

 

 

AUDIO ENC.

RESULT 1

RESULT 2

RESULT 3

RESULT 4

RESULT 5

AVERAGE

WAV->APE

122.339

121.983

122.155

122.142

122.077

122.14

WAV->FLAC

968.035

972.303

958.715

962.090

966.200

965.47

WAV->MP3

398.413

398.232

399.116

398.622

396.675

398.21

WAV->OGG

460.283

462.513

460.829

460.270

461.487

461.08

 

Raspberry Pi Model B+ with Debian

Overclocked to 900MHz

 

COMPRESSION

RESULT 1

RESULT 2

RESULT 3

RESULT 4

RESULT 5

AVERAGE

7-Zip Compress

230

234

235

 

 

233

Parallel BZIP2

 

 

 

 

 

DNR

GZIP Compress

234.078

230.534

230.136

 

 

231.58

LZMA Compress

1962.3624

1904.4445

1893.6165

 

 

1920.14

 

 

AUDIO ENC.

RESULT 1

RESULT 2

RESULT 3

RESULT 4

RESULT 5

AVERAGE

WAV->APE

165.961

177.030

179.942

166.520

168.231

171.24

WAV->FLAC

637.513

636.228

642.591

651.949

645.050

642.67

WAV->MP3

303.851

297.353

304.706

307.051

299.120

302.42

WAV->OGG

 

 

 

 

 

DNR

 

Video Overview:

 

Flashing the BBB: