1 2 3 Previous Next

BeagleBone Black

66 posts



When the BeagleBone BlackBeagleBone Black was first released, I was one of the first journalist in the country to receive one, and impressed did not begin to describe how I felt about the little black board. At the time, I was still riding a high from my experiences with the Raspberry Pi, and while the Black lacked the camera and LCD connectors, it made up for it in on-board flash and processing power. Unfortunately I was very disappointed in the Angstrom Linux distro that shipped with the Black, but did manage to flash the board to Ubuntu with the help of a friend at my local MakerSpace. Over the next several months, I played with the Black here and there, and made a few small projects here and there. When revision C of the BeagleBone Black came out running Debian from the factory, I knew I had to have one. It was also around this time that I made a major career change, and left tech journalism for a more lucrative position as a Drupal developer at a friends web development firm. While playing around with my new BeagleBone Black one night, I began wondering how hard it would be to get a web server up and running and if the Black would be able to handle MySQL and Apache2 along with a Drupal Install.


Prerequisites: What you need to know to be able to complete this project.

  • Understand how to install packages from the terminal.
  • Understand how a LAMP-based web server works.
  • Understand how Drupal is installed and configured.
  • Understand how RSS feeds work.
  • Understand basic HTML and XHTML.


SSHing into the BeagleBone Black via Putty


To access the BeagleBone Black via SSH I will be using a terminal for Windows called putty, as well as an addon called MTPutty which allows me to run multiple putty instances from within a single tabbed interface. Both Putty and MTPutty are available for free, and take just a few moments to download and install. Chances are, if you are reading this, you already know how to use Putty. If you are using a Mac you can simply use the built-in terminal to access your Black Via SSH. To connect to your Black, you need to enter the following credentials.


With these settings configured, click ok and then double click the BeagleBone Black name in the server list. This will open up a new terminal tab and you will be prompted to enter a username. Unless you have modified the root user, you should enter root as the user name.




BeagleBone has made it easy here as there is no password and after entering the username, the connection will finish, and you will be placed in your "home" directory.


To get things started, I first needed to get MySQL installed and running on the BeagleBone Black, and I will be perfectly honest in saying that it was no easy task starting off. Since revision C of the Black runs Debian Wheezy from the factory, I knew that apt-get install would be used to install new packages now where as opkg was used with the Angstrom distro on earlier models. Unfortunately that is where I began running into problems. When I would run anything via apt-get install the whole install process would run, but then quickly error out due to a script called led_aging.sh causing an error. After almost an hour of pulling my hair out, and searching the web, I found a thread in a mail archive where someone was having the same problem. As it turns out the script was missing some of its functions, and that was causing the dkpg error, but why a seemingly random script was causing apt-get install to fail is beyond my pay-grade. If you are interested in seeing the original mail archive with the information, it can be found here. I am going to cover this fix below for convenience though.

If you get an error surrounding the led_aging.sh script when running apt-get install on your BeagleBone Black, or during any terminal process, you will need to modify that script to include some missing functions. The process to do this is found below, but you will need a basic understanding of the Linux file structure and how to modify files via the terminal to complete this. You can also check out this code on github.


  • From your home directory navigate to /etc/init.d and then nano the led_aging.sh file that is inside the init.d directory.
  • Replace all of the code inside the led_aging.sh file with the following code.
#!/bin/sh -e
# Provides: led_aging.sh
# Required-Start: $local_fs
# Required-Stop: $local_fs
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start LED aging
# Description: Starts LED aging (whatever that is)

x=$(/bin/ps -ef | /bin/grep "[l]ed_acc")
if [ ! -n "$x" -a -x /usr/bin/led_acc ]; then
  /usr/bin/led_acc &


  • Then exit out of nano, keeping the filename the same as it was.


This should have fixed the issue that pops up when trying to run an apt-get install command. Now that we have that error taken care of, lets move on to the rest of the project.


Installing and Configuring the Web Server


There are a few packages we need to install in order to get our web server up and running to be able to serve a Drupal installation. The packages we need to install are listed below.

  • MySQL Server
  • MySQL Client
  • Apache2


Before we get started, we need to make sure that Debian is up to date with the latest libraries, and doing that is as simple as running the following command.


apt-get update


This will automatically download and install the latest update for the version of Debian that is running on the BeagleBone Black.


With the distro updated, we can now install MySQL Server and MySQL Client with a single command. For those of you following along at home, MySQL is the database of choice for Drupal installations, but you could run MariaDB, postgresql, or another variant of MySQL. To keep things simple and standardized, we will be running MySQL. To install both packages, use the command below.

apt-get install mysql-server mysql-client


This will run through the install process. You will be prompted with some password creation prompts and you can set the passwords to whatever you wish, but make sure to write them down as they will be needed later.


With MySQL installed, its time to install Apache2 run the following command

apt-get install apache2


Let the install process finish, and grab something to drink in the meantime. When the install finishes, install the following packages.

apt-get install php5
apt-get install php5-mysql
apt-get install php5-gd
apt-get install libapache2-mod-php5 
apt-get install php5-curl


With those packages installed, we can move on to building a Drupal-based website on the BeagleBone Black.


Installing and Configuring a Drupal-based Website


In the terminal, navigate to the srv/www directory, and create the directory in which we will install the Drupal instance too. We will need to create several sub-directories as well, including backup and error log directories as well as the website doc root.

cd /srv/www
mkdir bbb.news
cd /srv/www/bbb.news


Now create the sub directories using the commands located below

mkdir backup
mkdir download
mkdir logs


While only two of these directories are really needed, I prefer to follow what I consider to be best practice when installing drupal on any server. The backup directory is used to backup the website's database, making life much easier when things go bad. We will use the download directory to download the Drupal install tarball to. The logs directory will house two required error log files, and the htdocs directory will be where our website resides.


While we are at this level of the file structure, lets go ahead and create two files that apache will need later. Navigate to the logs directory and enter the two touch commands below.

cd logs
touch access.log
touch error.log


This creates the needed log files that will help troubleshoot issues if they occur.


With these files created we can navigate back to the main bbb.news directory and then into the download directory.

cd ../download


Once inside the download directory, we can use the wget feature to grab a fresh copy of the latest version of Drupal 7. While Drupal 8 is right around the corner, I chose to go with Drupal 7 because it is the most widely adopted version at the moment and has the most module support currently. Follow the commands below to download Drupal and untar it into the htdocs directory.

wget http://ftp.drupal.org/files/projects/drupal-7.32.tar.gz
tar -zxvf drupal-7.32.tar.gz
mv drupal-7.32 ../
mv drupal-7.32 htdocs


Now verify that the files were successfully extracted to the htdocs directory by entering the following commands and matching up your directory with the screenshot below.

cd ../htdocs


If the extraction was successful, you should see something similar to this.


Now we need to navigate to the sites/default directory and copy the default.settings.php file and rename it to settings.php, then set the permissions on the settings.php file to 777.

cd sites/default
cp default.settings.php settings.php
chmod 777 settings.php


To finish getting our Drupal site ready we need to build a database for it to store things in. You will need the MySQL username and password that you set up earlier in the tutorial for this. Use the following commands (with your unique credentials) to build the database we will use for the Drupal installation.

mysql -u (username) -p (password)


That should drop you into the MySQL terminal and from here you can create the database with the following commands.

create database (database_name);
grant all on (database_name).* to '(database_username)' identified by '(database_password)';


If everything was entered correctly, then you should see a line returned with the following command Query OK, 0 rows affected (0.00 sec) .  Be sure to write down the database name, database user name, and database password as you will need them shortly. If things are correct, you can now exit the MySQL terminal using the following command.



Now lets set up the vhost file for our newly installed website. Navigate to the apache2/sites-available directory using the following command.

cd /etc/apache2/sites-available


Now we need to create a new virtual host file (vhost) for our newly installed drupal website. To do this, we are simply going to use the touch command to create the file. If you want to be able to access the website you are building from an external network, you will need to configure a new A-record on a domain name that you own, and point it to your home's IP address, then forward the ports in your router to the BBB for that domain name. I wont cover those aspects in this tutorial, but the internet is full of valuable resources that will help you along the way. For the purpose of this tutorial, I have already completed these steps, and that is why you see the charlesjgantt.com domain attached to the vhost. When doing this on your own, simply replace my domain name with yours. I will post some screen shots of what my setup looks like, to help you along though.

touch bbb.news.charlesjgantt.com


Now run an ls command to verify that the file was created.




If the file was created correctly, you should see it here.


Now we need to edit the file and paste in a few lines of text. Nano into the bbb.news.(your_domain.com) and paste the following text. Remember to remove the (your_domain) and replace it with your domain url.

nano bbb.news.(your_domain.com)


<VirtualHost *:80>

    ServerAdmin webmaster@(your_domain).com

    ServerName bbb.news.(your_domain).com

    DocumentRoot /srv/www/bbb.news/htdocs

    ErrorLog /srv/www/bbb.news/logs/error.log

    CustomLog /srv/www/bbb.news/logs/access.log combined



Now save and exit out of nano by pressing ctrl+x and y when prompted then saving with the same name.


You have successfully created a proper Virtual Host file for the new Drupal site. Now we need to enable that site using the following command. Once enabled, apache will need to be restarted.

a2ensite bbb.news.(your_domain).com
service apache2 reload


Below are the screenshots I promised of my A-Record entry in my DNS settings for charlesjgantt.com as well as the port forwarding settings in my router.

a-record settings.jpg

Your A-Record can be found in the DNS settings of your domain. Simply give it the sub-domain name you wish to use, and then point it towards your home IP address. (Mine has been blurred out for security purposes.)



Now enter your router's settings and find the port forwarding settings. You want to point the port you set in the V-Host file (80) to port 80 on your router. After saving this, you may need to reboot your router depending on its model.


In preparation for the BB View_70 LCD we will cover later in this tutorial, we need to disable a few services on the BBB to ensure that port 80 is free to serve our new website.

systemctl disable bonescript.service  
systemctl disable bonescript.socket
systemctl disable bonescript-autorun.service
systemctl disable avahi-daemon.service 
systemctl disable cloud9.service  
systemctl disable gateone.service 


With these items finished, we are ready to test the website and see if it works. From within your local network, open up a browser such as Chrome and visit http://bbb.news.(your_domain).com:80 and if everything is correct, you should be prompted with the drupal install page as seen below. You will have to select your preferred language, and then if the steps above were followed, you will be taken to the Database configuration tab. Select MySQL, and then enter the correct Database Name, Database Username, and Database Password that you set up a few minutes ago.


Now click save and continue, and proceed to fill out the requested information on the final few pages. When finished you should be prompted to visit your new website which should look something like this!



Now that we have the news website up and running on the BeagleBone Black, we need to begin importing "News" content to it. Before we can do that, we need to install a few modules and to make life easier, we are going to install a utility called Drush (Drupal Shell) that will make life much easier moving forward. While seasoned Drupal Developers will certainly cringe at the method I am about to use to install Drush, it will work fine for this tutorial. To install Drush using the preferred method, visit the install instructions found at https://github.com/drush-ops/drush

apt-get install drush


Before we can install any modules we need to modify the permissions on the modules directory, and then create two new directories.

chmod -R 777 sites/all/modules
cd sites/all/modules
mkdir contrib
mkdir features


When the Drush install finishes, navigate to the websites root, and then use the drush pm-install and pm-enable commands to install the needed modules. The final command we will run in this set will clear all of Drupal's various caches.

cd /srv/www/bbb.news/htdocs
drush dl admin_menu adminimal_admin_menu module_filter features feeds feeds_tamper feeds_imagegrabber job_scheduler strongarm context
drush en admin_menu adminimal_admin_menu module_filter features feeds feeds_tamper feeds_imagegrabber job_scheduler strongarm context -ydrush cc all


With those modules installed and enabled, hard-refresh the webpage and then visit the modules page to verify that everything we needed was properly enabled. Go through the list and make sure that Context, Context UI Features, Feeds Admin UI, Feeds Import, Feeds News Feeds Tamper Admin UI, Feeds Tamper, Feeds, Feeds Image Grabber, Job Scheduler, Job Scheduler Trigger, and Strongarm are enabled.



With all the necessary modules enabled, we can move forward and build a feed importer that will allow us to pull in news from any website with an RSS feed. For the purpose of this tutorial, I am going to pull new content from Element14's All Content RSS Feed which can be found at http://www.element14.com/community/groups/feeds/allcontent. I am also going to pull in a feed of the newest 3D models uploaded to httphttp://www.thingiverse.com. To keep all of this organized, I need to create a new content type for the Thingiverse feed. Before I decided what I would be importing, I named this new content type "Tech News" but its sole purpose is to import from Thingiverse, so ignore the name and make yours whatever you want.


To get started creating the new content type and feed, follow along with the videos below.






I apologize for not being able to show the Thingiverse Feed creation. At the time of recording, the Thingiverse RSS feed had a bug that prevented me from mapping the elements correctly, but basically it is the same as creating the previous feed, but involves using Feeds Tamper, and Feeds Image Importer to get the images displaying correctly. A quick good search will show you the best way to utilize these extension modules.


Now that we have the feeds importing, and the site is up and running as it should, lets take a moment and look at how we can add the BB View_70 7-inch Touchscreen LCD CapeBB View_70 7-inch Touchscreen LCD Cape to create a desktop rss news reader.  For those of you who are new to the BeagleBone Black, the BB View_70 is a 7-inch 18-bit, 800x480 resolution LCD screen with a 4-wire resistive touchscreen digitizer on top. The Cape features two user-defined LEDs, and five tactile switches of which 4 can be user defined.



Originally, the BB View_70 ran on the Angstrom distro, but with Debian being added as the default OS in revision C of the BeagleBone Black, the BB View_70 cape is easier than ever to get up and running. I could cover that entire process here, but it is actually very thoroughly covered in the BB View User Manual beginning at page 23. Note that if you run the BB View_70, you will need to supply an external 5V 1amp power source to the BeagleBone Black before the screen will turn on.




For those of you with access to a 3D Printer, you can head over to Thingiverse and download the BBVIEW 7 LCD + Beaglebone Black Stand by Chumsize. This stand provides a clean way to securely and safely mate the BeagleBone Black and the BB View_70 together. The stand holds the screen at the perfect angle for both viewing and touch screen navigation. The stand takes about 35 minutes to print on a decent printer running at about 80mm/sec and uses hardly any ABS filament. I did find that the holes designed to capture the standoffs need a bit of cleaning, and you will need to heat the standoffs with a cigarette lighter or soldering iron and then press them into the holes for a more secure fit. Overall I think this stand is one of the coolest things I have ever printed, and it has made my development time with the BB View_70 much easier.




I'm a screen junky and at my home office, I have tripple 24" monitors, with about 30 tabs open in each at any given time. I know this is excessive, but having this little news reader on my desk really does make life easier. As an additional bonus, since it only imports the latest 10-items every hour, I spend less time down a news rabbit hole, and more time working. I hope this tutorial was as informative as I hoped it would be, and I would love to hear from anyone who makes their own news reader, or takes these instructions and builds something completely different. I have a few more tutorials coming out in the next couple of weeks that will build upon this basic starter, such as learning how to control the BeagleBone Black's GPIO pins via the internet using Drupal. Until then #HackTheWorld & #MakeAwesome!





I've got a Sensor Connection Cape (GVS) for the Beaglebone Black up on Kickstarter. Here is a picture of the card:


Here is a video demonstration of the card.


Doug Gilliland.




This Demo will take a fresh from the box element14 BeagleBone Black with the preinstalled Debian system and configure it to work with BB-View. Subsequently we will use this new setup to attach virtual moustaches to passers-by


Equipment Required

e14 BeagleBone Blacke14 BeagleBone Black

BB-View 4.3"4.3" or 7"7"

5v PSU5v PSU

UART8000-UUART8000-U (Optional QOL improvement)

USB memory stick

Playstation 3 camera



Debian patch files

Linux tools





Extract the files from the Debian Image archive to a USB stick


Connect the BeagleBone black to your PC via either the UART8000-U or the included USB cable



Connect the 5V PSU



While the board is booting, ensure PuTTY is installed on your computer and start the software. The settings for each connection type vary:

Ethernet over USB: uses an SSH connection via the default IP address of

UART8000-U: The COM port will vary, the correct port can be found in the Windows Device Manager (for more information on this please see the UART8000-U guide). The other settings are shown in the image to the right.

serial settings.PNG


Once the board has had time to boot you can go ahead and click "Open" on the main screen of PuTTY to open a connection to the board. From here on all the commands are uneffected by your chosen connection method. There is a slight inconveniance when connecting via SSH using the Ethernet over USB as the connection will need to be re-established each time you reset the board

SSH error.PNG

BB-View Patches


In the terminal window enter the following commands (as per the BB-View user manual):

mkdir /media/udisk
mount /dev/sda1 /media/udisk
cp -f /media/udisk/zImage /boot/uboot
cp -f /media/udisk/*.dtb /boot/uboot/dtbs
tar -xvf /media/udisk/kernel_modules.tar.gz -C /
cp -f /media/udisk/xorg.conf /etc/X11/

If you are using the 4.3" screen with your BB-View than you are good to go! However the 7" screen requires a little more configuration, enter the following commands into PuTTY:

cd /boot/uboot/dtbs
cp am335x-boneblack-lcd7.dtb am335x-boneblack.dtb
rm /etc/pointercal*

Now shut down the BeagleBone and connect the BB-View along with the screen, then supply power.

You should now have a working BB-View & BeagleBone Black system running Debian



After applying the BB-View patch the ethernet is disabled by default to improve boot times. If required, the Ethernet can be re-enabled with a simple edit, use nano to edit the following file:

nano /etc/network/interfaces

Then find the lines:

#auto eth0
#iface eth0 inet dhcp

and uncomment them by removing the # to read:

auto eth0
iface eth0 inet dhcp

After this save and exit then:


Moustache Time!

(From my list of titles I never thought I would write)


A full set of instructions for adorning people with virtual moustaches can be found at BeagleBoard.org - BeagleStache however they are repeated below, with slight modifications to make the project BB-View compatible.

    1. Clone the GitHub repository and build the code with the following commands
      git clone git://github.com/jadonk/stache
      cd stache
      make && make install
    2. Because the BB-View by default operates as the user "Debian" instead of root, the following commands are required to operate BeagleStache:
      mkdir /home/debian/stache
      cp -r /root/stache/* /home/debian/stache
    3. To make the running of BeagleStache a little easier you can create a shellscript on your desktop containing the following:
      sudo /root/stache/runstache
    4. Now plug in the camera ,doubletap your new desktop script and enjoy your moustachey exploits!

openrov 1.jpg

OpenROV open-source submarine (via OpenROV)


What happens when an entire community comes together to help one man discover underwater treasure? Quite possibly one of the best maker projects ever devised is born, that’s what. Meet OpenROV, an open-source exploration submarine created for the DIY community, powered by a BeagleBone!


The OpenROV project began when Eric Stackpole wanted to explore a cave near his home that was rumoured to have buried treasure. When neighbors got wind of his idea, everyone was willing to help (go figure). The real magic, however, began when scientists heard about the idea of creating a tiny, open-source submarine and got to thinking.


Makers, engineers and scientists from more than 50 countries banded together to make Stackpole’s dream a reality. Why? Because an open-source robot can be programmed to do just about anything. Scientists believe they can program the OpenROV to do everything from monitor pollution under the sea to discovering new aquatic species. Plus, Stackpole gets to hunt for gold too. It’s a win-win.


openrov 2.jpg

(via OpenROV)


The robot is 30cm long, 20cm wide and 15cm tall and it looks just like what you always hoped Scuba Steve would use during his underwater explorations. It weighs in at 2.5kg and was designed to withstand depths of up to 100m, although its only been tested at 20m.


openrov 3.jpg

OpenROV in action underwater (via OpenROV)


The DC-powered design features a single 10cm by 18cm waterproof tube that protects all electronics and equipment from water damage and it can move horizontally, vertically and diagonally with the help of three 800kv brushless motors, two horizontal thrusters and one vertical thruster. It’s also fully controllable via computer keyboard or USB controller.


At its heart is a BeagleBone single board computer and their OpenROV BeagleBone Cape. Does that mean they want you to experiment with their cape? It looks like it.


The robot is fully functional in both fresh and saltwater and moves at 1m/s. It is still, unfortunately, an energy guzzler, as it takes 8 on-board C batteries for every 60-90 minutes of activity, but improvements are in the works.

OpenROV successfully completed its Kickstarter campaign on Friday and is looking to make several improvements to the design in the near future, including more efficient propellers and better resistance to rusting caused by salt water.

There’s no word on what the final product will retail ─ it is still largely an experiment. Once the kinks are worked out it should launch for the general public, but for now if you’re lucky enough to find one you’ll have to tinker with it yourself. This does, however, grant you the freedom to program it to do your evil bidding. There’s no underwater lair you won’t be able to discover. Fight evil responsibly.




See more news at:


I just saw this: http://hackaday.com/2014/07/22/talking-beagleboard-with-jason-kridner/


It's a 14-channel 100Msps logic analyzer using the BeagleBone Black and no additional hardware - it makes use of the on-chip dual programmable real-time units (PRUs).

Apparently it has been used to capture sustained >100MByte sized data streams : ) And also for I2S audio data capture : ) It would be ideal for digital audio testing!

Highly impressive stuff.


The BBB has evolved into the universal test tool that we always suspected it could become.

Multifunction instrument based on BeagleBone Black

Probably the best way to understand the Internet of Things is to get some things on the Internet and in this article we're going to do just that.


icon_19938.pngWhat we are going to assemble is a greenhouse control system which will be able to monitor temperature and light levels and control the windows on the greenhouse. More importantly, at the end of it, you'll have a development platform built for further exploration. At the core of what we are constructing will be a BeagleBone Black, a powerful, small ARM-based general purpose computer which will play host to a number of Eclipse tools, run an MQTT stack for us and act as the main brain of the operation. It'll be responsible for taking our temperature and light readings and publishing them to the Internet while listening for control messages to set the greenhouse windows.


Some would, at this point, attach the sensors and controls directly to the BeagleBone Black (BBB). In real world implementations, it's more common to find micro-controllers in the front-line as it were, connected and controlling the sensors, servos and other hardware as they typically are more resilient to the environment, more compatible with the electrical elements and a lot cheaper. Therefore to be more realistic, we are going to attach an Arduino micro-controller over a Serial-over-USB connector though this could be an actual serial connection or a wireless connection of some description - the advantage of a USB connection for this example is that it also supplies the power to the Arduino.


So far, you'll need an Arduino and a BeagleBone Black to follow our build process. There are a whole range of Arduinos with different features but we recommend the ever popular Arduino Uno or the Arduino Leonardo. For the sensors and servos, although you can assemble your own collection of hardware, we are going to recommend the Grove Starter Kit Plus, a shield sporting numerous sockets and a collection of components with de-coupling chips and pre-wired with plugs for the shield sockets. This makes it great for experimentation without breaking out the soldering iron.


orion.pngWe're going to use Eclipse Orion on the BeagleBone Black rather than the default Cloud9 IDE as it is a development environment more capable of working with languages other than JavaScript, even if here we are using it entirely with JavaScript. The flexibility of being able to use the same tools with whichever language you decide to work in and the ability to use those tools over the Internet is a huge plus when putting together a prototype or development system.


The Eclipse IDE, which many are familiar with, is built as a platform for integrating tools from many different vendors in one coherent framework on the desktop. Eclipse Orion has been developed as a separate project which looks to bring that tool integration philosophy to a web-based browser-native development environment. There's actually two Orion IDE's - the project started with a Java based version with an eye on hosted collaborative development platforms while along side that, Orion Node, a Node.js based version of the system designed for a single user has emerged. The Orion IDE offers a syntax aware editor, with search tools, and a shell environment to support command-line style application building, deployment and running. The Orion Node version is also pretty compact and remarkably easy to install, making it a great way to get working on a small device remotely.


Beginning building


First though, lets make a start by getting the controller assembled. First, attach the Grove shield to the Arduino. Then, in the components you'll find a temperature sensor, a light and a light sensor  we'll get to the servo later. Plug the temperature sensors into the A0 (analog 0) port, a sideways connector on the lower left side of the Grove shield. This port and its other four siblings are able to read an analogue voltage from an electronic device making them ideal for non-digital sensors. Plug the light sensor into A1, just above A0.


And that's the hardware assembled:




Note that though the Arduino can be powered over the USB port from the BeagleBone it is better, especially when adding power-drawing devices like servos, to use a 9V power supply (or battery) for the microcontroller.


Next we'll need to be configuring the BBB and selecting the operating system. To date, most BBB boards have come with the Angstrom Linux distribution installed on the 2GB of eMMC flash storage; they are identifiable by being labelled revision A or B. Although Angstrom is a functional Linux distribution, it isn't mainstream and the BeagleBone project is in the process of switching its default Linux to an up to date Debian GNU/Linux. There's only one catch... Debian is a bit bigger than Angstrom and although it fits onto the 2GB eMMC flash, if you install the packages we will, you'll find yourself with less than 1% free space. If you have an 2GB BBB, we recommend you get yourself a Micro-SD card and install and boot Debian from that - you may also want to install Debian onto the eMMC for consistency.

Instructions on how to install Debian into the eMMC and the latest images for eMMC and SD are on the BeagleBoard.org site. You will also need to resize the image on the SD card once installed to make full use of the SD cards capacity - a guide to this is also available and, to save time, there's a quick version of the process at the end of the page .


As new BeagleBone Blacks labelled Revision C are starting to arrive with 4GB of eMMC and Debian pre-installed so this isn't an issue.


Organising Orion


The next steps can be carried out locally, if you've plugged your BBB into an HDMI monitor and attached a USB keyboard and mouse or remotely over a SSH connection on a network. If the former, you will still need to connect the BBB to your network. Also remember to use a USB hub as the BBB only has one USB port and we have yet to connect the Arduino we talked about earlier. If over the network, the Debian installation will be advertising itself as beaglebone.local, so all thats needed is to run ssh root@beaglebone.local to log in. (It is possible to connect a BBB to a PC over just a USB cable and ssh in, but this by default doesn't share the PCs internet connection which we'll need to install software).


The Debian GNU/Linux image already has an up-to-date node.js installed so what we initially need to do is install Eclipse Orion, the web-based IDE. We can do this like so:


root@beaglebone:~# mkdir greenhouse
root@beaglebone:~# cd greenhouse/
root@beaglebone:~/greenhouse# mkdir workspace
root@beaglebone:~/greenhouse# npm install orion


We'll be keeping all our work in the greenhouse directory which is why we also created a workspace directory in there. Once installed you can use npm to start Orion too, but before that, there's a small tweak to be made. We need to edit node_modules/orion/orion.conf and change the fourth line, a commented out line for setting npm_path to:




And the last line, a commented out line setting the location of the workspace. In this case it should be replaced by...




... though this could of course be any directory.


Save the file and we're ready to start Eclipse Orion:


root@beaglebone:~/greenhouse# npm start orion


Go to your browser and browse to "http://beaglebone.local:8081/" if accessing remotely (localhost:8081 if local) and you should be greeted by the Orion user interface.


The icons at the left hand side set the view in the Orion IDE, the pencil shows the workspace and other directory/file views, the magnifying glass takes you to a search centric view and the rectangular icon, representing a console session, gives access to the Orion shell.

Getting Firmata onboard


We now have the hardware for the sensors assembled and an IDE installed on our BBB. The next step is to bring connect them and for this we are going to use Firmata, firmware which implements a generic protocol for talking between host computers and micro-controllers. In many ways, it's the software equivalent of the Grove kit we are using as it makes it easy to work with controllers.


You can install the Firmata firmware using the Arduino IDE. At this point you have a choice - you can install the Arduino IDE on a PC, Mac or Linux box and use that or you can install it on the BeagleBone Black. The latter course of action will require you to have a screen or a remote X Windows session configured as the IDE is a GUI application. Install the IDE with sudo apt-get install arduino


The former approach, installing the Arduino IDE on a PC, Mac or Linux system, is often quicker as you'll only be doing this once in a while. You can download the software from the Arduino downloads page  we recommend the Arduino 1.5.6-r2 beta or later  and follow the installation instructions.

Whichever route you take, once the Arduino IDE is running, select File » Examples » Firmata » StandardFirmata, select the Arduino board and USB/serial port it is connected to the IDE host machine with in the Tools menu and then click the compile and upload button (the tick and the right arrow in the Firmata sketch window). When this is complete, your Arduino board will understand the Firmata protocol and you can plug the USB cable back into to the BeagleBone Black and we can take control of our Arduino board.


Back to Orion


We can now return to Orion in the browser and start creating some code. Over on the left hand side of the browser are a pencil, magnifying glass and a terminal window. The pencil lets you view, create and edit projects, the magnifying glass lets you search in various ways and the terminal gives you access to a shell. It's this shell we want to go to next because we have Firmata support on the Arduino and need software to communicate with it.

Johnny-Five is such software, developed for Node.js to enable robotics development. Its big feature is that it allows a programmer to work in terms of LEDs, Buttons , Sensors and Servos rather than high/low pins and it simplifies the process of managing them.

To install it, we use npm as we did earlier to install Orion, but now we can run it from within the shell. Go to the text field at the bottom of the Orion shell view and type:

npm install johnny-five

It'll look like this when it's done installing:


hackpad.com_VCR1WLsIyOE_p.100400_1404211483449_Screenshot 2014-06-28 11.37.40.png


Click on the pencil to get the file view back and select from the Orion menu File » New » Project » Basic and enter greenhouse as our new project's name. This will move us into the directory for the new project in the viewer. Now select File » New » File and create a file called greenhouse.js.


hackpad.com_VCR1WLsIyOE_p.100400_1404215568626_Screenshot 2014-06-28 11.38.52 (1).png


We can now start entering some code. First of all, we need to tell Orion's IDE that we're writing Node.js code and not to warn about common Node.js commands and classes. This is done through a jslint directive in a comment:


/* jslint node:true */


Now we need to bring in the Johnny-Five library. At the core of Johnny-Five is the Board abstraction in that we talk to a Board. We'll create that at the same time as bringing in the library:

var five = require("johnny-five"),
board = new five.Board();


When the program starts and the Board is created, the library will begin to negotiate with the Firmata enabled Arduino and will reach a point when its ready to start doing some work. We want to capture that "ready" event...

board.on("ready", function() {

The first thing we want to do is monitor the temperature sensor. We want to read the temperature once a second and, if you recall, we attached the sensor to A0. In Johnny-Five, we just have to tell it about that sensor like so:


    var tempsensor = new five.Sensor( { pin:"A0", freq:1000 } );

This freq(uency) means that every 1000 millisecond, or second, the sensor will be read and a data event fired. We now want to capture that data event by directing it to our own callback:


    tempsensor.on("data", function() {

The event comes complete with a value for the reading (this.value) and we can use that to calculate the temperature by first working out what the resistance of the temperature sensor is and then converting it to a temperature using a formula based on the sensor's data sheet. (See this wiki page on the sensor for more).


        var resistance=(1023-this.value)*10000/this.value;
        var temperature=1/(Math.log(resistance/10000)/3975+1/298.15)-273.15;


For now, we'll print the result to the console and end the tempsensor callback and the program's code.




Once we have selected File » Save to write the code to disk, we now have a program ready to run from the Orion shell. If we switch to the shell using the sidebar and click into the command entry panel at the bottom, we can begin typing. The shell will attempt to autocomplete for many things. Type "no" and it will suggest "node". To accept that suggestion, press Tab. We want to start a Node.js program, so type "st" and autocomplete will suggest "start", again press Tab to accept. At this point you can enter a filename but the shell is already anticipating that and will be offering filenames from the current directory; select greenhouse.js from the list and hit return.

The program should start running and, after initializing, start printing readings from the temperature sensor.


hackpad.com_VCR1WLsIyOE_p.100400_1404215609798_Screenshot 2014-06-28 14.07.34.png


To stop it running, go to the command panel and enter node stop at which point the shell will offer process ids you can stop. There should only be one at this point so select that, hit Return and the process is stopped. We are now reading the sensor, the next step is to get that information out to the world.

Going MQTT


We're going to use the MQTT messaging protocol to send our data out. MQTT is built for this kind of task because it's lightweight and flexible. For this part of the example, suffice to say that with MQTT you can send messages with tags to what looks like (but isn't) a file-system hierarchy on a server. To make life easier, Eclipse runs a sandbox server at iot.eclipse.org so we'll use that as the MQTT server. What we need is MQTT support so go to the shell, make sure you are in the top level "Orion Content" directory (if not enter cd .. till you are) and then enter npm install mqtt to install the Node.js MQTT library.


hackpad.com_VCR1WLsIyOE_p.100400_1404215664783_Screenshot 2014-06-28 14.23.04.png


After that's installed, return to Edit view and bring up greenhouse.js. After the require for johnny-five we want to add code to bring in MQTT and connect to the Eclipse sandbox...


var mqtt = require("mqtt"),
client = mqtt.createClient(1883,"iot.eclipse.org");



And that's a basic connection set up. Now we need to publish our temperature data. After the console.log we'll add this line...


client.publish("greenhouse/mygreenhousename/sensor/temp",temperature.toString(), { retain:true });



The first parameter is the topic, a file-system-like path - greenhouse/mygreenhousename/sensor/temp but don't make assumptions about it working like a path; it's more of an informal hierarchy of names. This first thing for us though is to change mygreenhousename to something that is unique to you to avoid colliding with other users on the sandbox who are also following this article. Now we have the 'greenhouse' and your own name for that greenhouse. Beneath that we have sensor where, going forward, we'll put all our sensor data and beneath that a temp element where we'll post the temperature data.


The next parameter is us converting our temperature to a string before posting to make it more readable; MQTT doesn't have any rules for what is called the payload of a message so it could be binary or an image. We've gone with the good old string because we'll want to read it later when testing.


Finally we set an option, "retain" to true to ask the server to hold onto the value for any other client that requests the data. If we don't set retain, the value will be broadcast to any client listening for it at the time but it won't be available for clients that connect after the broadcast leaving them to wait. While we're pushing the temperature out every second, we may want to only do that when it has changed and that may be an indeterminate amount of time.


Save this code, return to the Orion shell and start the program again. It should start as it did before, but now, if you open a new browser window and look at http://eclipse.mqttbridge.com/greenhouse/mygreenhousename/sensor/temp you should also see that same temperature reflected on the Eclipse sandbox. The eclipse.mqttbridge.com site also monitors to iot.eclipse.org MQTT server and makes debugging easier by allowing you to browse the various MQTT topics that it sees appearing on the server.


Now we know that's working, you may want to go back and delete the console.log line.

Let there be light (sensor)


We've only done the temperature sensor, but it should simple to add support for the light sensor and it is. After the temperature sensor handler we can add

var lightsensor = new five.Sensor( { pin:"A1", freq:5000 });

To map the light sensor and get it sampled every five seconds and then send that sampled value to the MQTT server like so...

{ retain:true });


And with just those few lines, if you re-run the program, you'll be transmitting light and temperature data. The process for adding more sensors follows this basic pattern though you can, for example, cut down on bandwidth by only updating when your code detects a change locally or using some other logic. As before, if you browse to if you browse to http://eclipse.mqttbridge.com/greenhouse/mygreenhousename/sensor/light you should see

Moving on


In our virtual greenhouse, we are getting the temperature and light readings, but we aren't able to take any action on then like opening the windows. For that you'll need a servo to attach to the window control. If you look in the Grove kit, you'll find one along with all the basic mounting gear. Don't worry about mounting it to anything yet, just take a Grove cable and plug it into digital port 3 (D3) which on most Arduino's is the first digital port that supports PWM (Pulse Width Modulation, useful for controlling servo motors).


With the servo installed we can now add some lines to greenhouse.js to control the servo. We'll add this code immediately after the light sensor code. We start by declaring we have a servo on pin 3.


var servo=new five.Servo(3);



Servo motors typically take a value from 0 to 180 and move to that angle. We are going to get the value for the servo via the same MQTT server we are publishing our temperature and light readings to. We will be listening from someone broadcasting a new setting under the greenhouse/mygreenhousename/commands/servo by using the MQTT library's subscribe command.





Now, when anything happens in that topic, an event will be triggered. We can capture this by waiting for the "message" event...

client.on('message', function(topic,message) {
    console.log("Got topic "+topic+" with "+message);


We get the topic value because you can actually subscribe to multiple different topics and wildcard topic names in subscriptions - getting the topic name lets us make decisions based on what particular topic generated the message. For now though, we're only subscribed to one topic so we'll assume that's a servo control message. We can now process the message and we'll keep it simple and just parse whatever's arrived as an integer.


    var val=parseInt(message);
    if(val<10) { val=10; }
    if(val>170) { val=170; }


We also map it into a tighter range (as servos can be mechanically tetchy at the ends of their ranges) and then we tell the servo to move to that position. And that's it. If we run this version of the code, nothing will happen with the servo until we post a value to the iot.eclipse.org server. Again the eclipse.mqttbridge.com server comes to our aid. We can use curl to send a value over HTTP to it like so:


curl -X POST --data-binary "100" http://eclipse.mqttbridge.com/greenhouse/mygreenhousename/commands/servo


Beyond the servo


Of course you could always write another node.js client (or use other language) to monitor the temperature and light levels by subscribing to those topics and control the airflow by publishing new servo positions.

The combination of Eclipse Orion, Johnny-five, MQTT, the BeagleBone Black and Arduino make for a formidable set of tools when setting out to explore what you can create for the Internet of Things. And you can of course add more sensors and control more devices, or take the BeagleBone out of the equation by adding ethernet or Wi-Fi to the Arduino and porting the JavaScript Node.js code to run on the Arduino itself. Or add a meshed wireless controller and use the BeagleBone to coordinate that mesh of devices... and even run the MQTT server on the BeagleBone and...


Just add imagination and the Internet of Things is yours!

Final code


/*jslint node:true */

var five = require("johnny-five"),
board = new five.Board();

var mqtt = require("mqtt"),
client = mqtt.createClient(1883,"iot.eclipse.org");

board.on("ready", function() {
    var tempsensor = new five.Sensor( { pin:"A0", freq:1000 } );

    tempsensor.on("data", function() {
        var resistance=(1023-this.value)*10000/this.value;
        var temperature=1/(Math.log(resistance/10000)/3975+1/298.15)-273.15;
        console.log( "Temp:"+temperature.toFixed(2) );
                    { retain:true });

    var lightsensor = new five.Sensor( { pin:"A1", freq:5000 });

    lightsensor.on("data",function() {
        var light=this.value;
                    { retain:true });

    var servo=new five.Servo(3);

    client.on('message', function(topic,message) {
        console.log("Got topic "+topic+" with "+message);
        var val=parseInt(message);
        if(val<10) { val=10; }
        if(val>170) { val=170; }

New BeagleBone Black Case for the Embedded industrial application of users. This case has followed on from the popular Raspberry Pi DIN rail case which saw many users across Europe and the US using these for industrial use. The modulbox is a DIN mounting enclosure which has been designed according to DIN 43880 to meet the needs of a number of applications including heating & lighting control and energy metering. The case is made from UL94V-0 moulded plastic.


The box measures (HxDxW) 90.5x62x68.1mm








BBB - PRU C compiler

Posted by shabaz Apr 30, 2014

Nice bit of information at this TI URL:

(My underlining below):


PRU Development

The Programmable Real-time Unit (PRU) is a low-latency microcontroller sub-system comprised of two or more 32-bit RISC processors, local instruction and data RAM, local peripherals and an interrupt controller. The PRU is efficient at handing events that have tight real-time constraints. The PRU is also known as the Industrial Communications Sub-System since it is used to enable industrial protocols such as EtherCAT®, EtherNet/IP™, PROFINET, PROFIBUS, POWERLINK, SERCOS III, and others. Each 32-bit processor runs at 200MHz, enabling 5ns instruction cycle. Local peripherals within the PRU sub-system include UART, eCAP, MII_RT, MDIO and IEP. The PRU’s fast input and output pins enable detection and reaction to I/O events within two PRU cycles.

Code Composer Studio provides a C compiler enabling users to add differentiation to their products.


(Downloading now! )



I've previously had great results connecting Adafruit 8x8 LED matrix displays to the BeagleBone Black via I2C:


I decided to try out the Adafruit bi-color 8x8 LED matrix and hooked it up with the same I2C pins as before.  You'll need to setup the Adafruit_BBIO Python library if you haven't already:



You'll also want to grab the Adafruit Python libraries for the Raspberry Pi since they work on BeagleBone Black, too:



Here is the BegaleBone Black running the demo program ex_8x8_color_pixels.py from the repo:



BeagleBone Black & Adafruit 8x8 bi-color matrix



I thought it would be interesting to plot the readings from a sensor over time on the matrix with different colors representing the magnitude of the reading:



I hooked up a pot to the analog input to simulate a sensor.  Here's the Python script:



It is Invoked by this shell script so that PYTHONPATH will be set:



BeagleBone Black: plot analog sensor on Adafruit bi-color LED matrix







This post briefly documents a BeagleBone Black (BBB) based music box. If you’ve ever wanted a Sonos system but (like me) felt they were a little expensive, then it is worth considering using a compact Linux platform like the BBB for creating something slightly similar. I feel the sound quality is not leagues different (better nor worse) than some more expensive commercial offerings.


It was a quick, fun project and costs about £100 including the cases and the BBB.

The idea for this project was simple - a compact box that connects to the home network and allows the ability to send it music to play (or it can play music stored on-board or on a server). The documentation provides just an overview because the circuits are already documented, and every implementation could be slightly different depending on end user needs, speaker enclosure, etc.

Here is the rear view:



Shown below is a video of it in action. The sound was recorded from the camera in-built mic so is not representative of actual sound quality. For actual sound quality, refer to the MP3 recording here, which was captured by connecting the headphone output (not line output) directly to an ADC and captured by the PC.



The main bits and pieces are the speaker box, the BBB and a DAC/amplifier.

Although a BBB and home-built DAC/amplifier was used, a Raspberry-Pi and Wolfson audio card could be used too, for a similar price.

The home-built DAC and amplifier is easy to assemble; it uses medium-sized SMD components that are hand-solderable, and gives results similar to a Meridian DAC which uses the same chip (a Texas Instruments ic). Full circuits and information are at these two locations: part 2 has the schematic, and part 1 has some more technical detail.

There are plenty of other DACs available including pre-built ones. A search for “I2S DAC” will reveal ones that should be suitable (I have not tried them) – this ebay example is just over £10. (Note that you may require a logic inverter, see the comments sections in the links earlier).


The speaker is a Tivoli Audio speaker. It is possible to get these in new condition for about £15-20 frequently on ebay, in various color options. Any speaker enclosure would have been fine. The official Tivoli webshop sells new speakers (slightly different model) from £39 upwards.


Design and Implementation

The DAC board was mounted inside the speaker, and the BBB was mounted outside. This allows access to all the BBB ports while making the minimal amount of holes in the Tivoli speaker (Speakers are sealed for good audio reasons).

It won't replace main home music systems but that was not the intention, nor is it stereo (that capability is easy to achieve by adding a second speaker connector, but I didn't require it). This is more a bedroom or home study one-box sound system.


Step 1: Fit BBB inside a case

The first step was to get the BBB into its own case. I connected a push-switch to safely power on/off the platform. I also wired up a DB9 connector to interface to the DAC.


I used L-shaped single-in-line header pins to solder up the connections and heatshrink at the DB9 connector end. The switch and LED were wired up to the power switch pin on the BBB and to the 3.3V supply (via a 100 ohm resistor) respectively. The push-switch is wired to the P9 header, pin P9_9 and to ground (pin P9_1). The LED 3.3V supply can be taken from P9_3.


The photo below shows the LiPo battery fitted. I used a paper sticker on the underside of it, to insulate it further. The BBB doesn’t run hot, but the battery could have a spacer between the PCB and itself if desired.


Here is the finished result, powered up. It can be safely powered down by pressing the button again (this feature is by default in the current Debian image).


The other side of the case provides access to the USB port, and a small USB WiFi adapter was fitted. I have not got round to finding a software driver for it yet, so for now I just used Ethernet.


Step 2: Speaker modifications

The next step was to put the BBB aside and work on the speaker and DAC. The speaker was opened up, and the wadding was removed and stored in a plastic bag to prevent dust and drilled fragments of plastic getting on it. The speaker cable was chopped and discarded, and the grommet removed.


The DAC board was fitted with L-brackets http://uk.farnell.com/jsp/search/productdetail.jsp?CMP=i-ddd7-00001003&sku=1466881 and the speaker rear cover was marked up for drilling the holes to secure it, and for the headphone and line jack outputs (3mm holes for the screws, and 6mm holes for the jacks).


The photo below shows the finished result.  The jacks are rather recessed. This is actually no problem for some headphones (e.g. a pair of low-end AKG I own) but others will have problems. I plan to drill to a recess with a larger drill bit to 7mm and it will cover both of my sets of headphones. Note that you want to make the holes as small as practical.


After wiring up the DAC to the speaker, the wadding was placed back in position and the cover was closed up again as shown below. Then the DB9 matching connector was soldered (wires protected with heatshrink). I didn’t bother with a cover for it.


After testing, the hole needs to be sealed (perhaps with epoxy resin glue).

Finally, the BBB was attached to the speaker (rubber feet and adhesive foam pads can be used).


Step 3: Try it out!

This step was the easiest.

Plug in the power supply, power up and install the audio player software:

sudo apt-get install mplayer

Then, try to play a music file (either from local storage or from network storage):

/usr/bin/mplayer -ao alsa -volume 10 “songname.mp3"


Summary/Next Steps

A quick and simple sound system was created. With a pre-built DAC and amplifier, the hardware implementation can be extremely easy.

There are plenty of software options for creating a library of songs and providing an interface for the user to select something to play. I have not tried them. For now I will just use SSH to select music. Eventually the hope is to create a simple browser based app that will allow one to upload MP3 songs from a PC or mobile phone for instant playback. A wake-up alert in the morning with a random song, or the news, will be a good option too (enabled via browser on mobile phone).


BBB - Logic Supply BB100 Case

Posted by shabaz Feb 19, 2014

The Logic Supply BB100 case has be available for a while (also in black), I purchased one recently while buying other gear, these were my thoughts on it

(pictures were from a cameraphone so apologies for the quality - better images at the Logic Supply website of course).



If you need your BeagleBone Black boxed up, there are worse ways. I thought it was very well made and quite flexible. The cover can be mounted at three heights, to accomodate capes (the gaps can then be used for wires and ribbon cables for example. I will probably fit the Olimex 1400mAH LiPo inside it too as shown here.


The case is steel (not aluminium) and in my opinion is extremely accurately cut and shaped. The case has sub-millimeter accuracy. The base and shell are less than a millimeter thick, yet extremely tough because of the choice of material.


All connectors are spot-on centered into their holes and the tiny narrow microSD card slot doesn't scrape or touch the card at all.


The board is held in place with four screws on permanently fitted metal stand-offs. The finished result is about the size of a pack of playing cards.



The exterior finish is a matt type, slightly roughened surface so not gloss shiny/smooth. I think the finish is great.

Initially I wasn't a fan of the D-Sub connector punch-out (I don't like using this connector for serial connections although it is a standard) but I now think it is a great idea, since it can serve as the I/O for 8 pins or more if a serial port is not desired. On the other side there is a circular punch-out ideal for coax shaped connectors or for a switch for example (approx 6.5mm dia hole measured with a ruler). These punch-outs mean that for many use-cases one may not need to ever drill any holes in the case.

Very narrow slots allow for all LEDs on the board to be visible.



Lots of spare screws are supplied in two sizes; the flush ultra-tiny ones shown in the photo earlier, or slightly larger pan-head. By only fitting two screws, the lid can become hinged.

The rear has punch-outs for providing screwed attachment to another surface, or thin vertical slots can be used for fitting to a metal chassis. Really nice engineering everywhere on this case.

Four thin rubber feet are supplied for optional fitting.

The case is not cheap but metal cases usually do cost more, and so this case is fairly good value for money especially if you want a case you can use as part of a demonstration for example.

Postal cost is quite low in Europe for this case shipped from Netherlands, so that helps too.


As a summary, the case is very nice and practical, and I think it is worth the cost.

(BBB - Building a DAC part 1 can be found here).

Part 3 implements a complete design in an enclosure for a Sonos-like solution.


The BeagleBone Black (BBB) has a digital audio interface and this was explored slightly in an earlier post.

The findings from that prototype were used to construct up a DAC board and it is described here. The aim was to have a relatively simple, easy-to-assemble board designed for portable use (headphone or small speakers) but with at least iPod-level performance. The circuit is described here and the complete schematic is attached to the post. The entire circuit connects to the BBB using 6 pins and needs no separate power supply. This is a recording using just the microphone from the camera - actual audio quality is much better.


For a better quality, the audio from the prototype can be heard in this zipped mp3 file. This was directly recorded from the headphone output so that it is more representative of what the user will hear (the original track that was played through the DAC was downloaded from Amazon, for comparison purposes).



Detailed Description

This is the functionality on the board:


The DAC integrated circuit and headphone amplifier portion were left unchanged from the part 1 prototype although the DAC was replaced with TI’s PCM5102 which is pin-compatible with the earlier PCM5101A. The PCM5102 device is used in commercial DACs such as Meridian’s Explorer.

The remainder design is kept simple too. Three regulators are used to supply power to the DAC (can be reduced to one to save costs, or replace with the lower cost pin-compatible TC1015-3.3):


An optional speaker output was desired, and the selected device was LM4861 which can run from a single low voltage supply and offers over 1W of power. This is enough to provide loud volume for home use (in the video above, the single mono speaker was a couple of meters away and the audio was played at a volume setting of 15 on mplayer). The circuit uses two of these for stereo, although only one needs fitting for mono summed speaker output (the photo above shows only one populated). The LM4861 input is driven from the headphone output, not the line output, to keep line output and headphone outputs as distortion free as possible.


The speakers are muted using the LM4861 shutdown pin driven from the headphone socket built-in switch.


The board was tested with headphones, a small 4 ohm speaker and a larger home speaker. Sound was as expected, and there are no known issues although more testing needs to be done. The board runs cold unless driving a speaker, in which case the LM4861 which is intended to be run without heatsinking in normal temperatures, would perhaps benefit from a tiny heatsink such as this one. The BBB image that I used outputs 16-bit audio at 48ksample/sec (i.e. the sound is as good as a regular CD player), but the DAC will work at higher resolution and sample rates for those with recordings that would benefit from it. The board was tested on an older Angstrom image and a Debian image. There are discussions in the comments section in the earlier post describing current ongoing exercises to get drivers working for different settings.



The described circuit is low cost and provides hopefully nice performance. The complete schematic and parts list is attached.


BB-VIEW free pins?

Posted by pbax Feb 3, 2014

Maybe I've missed something, but which pins on the BB-VIEW P1 and P2 are not used by the display? I can't tell from the user manual...

The wonderful Trammel Hudson of NYC Resistor posted the BeagleBone cape PCB to connect the BeagleBone BlackBeagleBone Black to the Adafruit 16x32 RGB LED matrixAdafruit 16x32 RGB LED matrix to create the dazzling Octoscroller:


OSH Park ~ Octoscroller v2


Just ordered updated Octoscroller boards. OSH Park has an awesome zero-friction Eagle CAD to PCB production process.

Drives up to eight chains of 32x16 or 32x32 LED panels with a Beagle Bone Black.


Wondering what the Octoscroller is?  Check out Trammel's excellent blog post:


Octoscroller » NYC Resistor

Hexascroller has been a central fixture at NYCR for the past few years, with a few ups and downs. It’s replacement, Octoscroller, improves on our classic message alert polygon by having two more sides and two more colors of LEDs.

The brains are a BeagleBone Black running the LEDscape custom PRU firmware. The AM355 CPU in the BBB has two separate realtime microcontrollers built into its die, both with full access to the GPIO lines and cache coherent access to main memory. This bit of hardware/software allows the user application to simply render into a frame buffer, which is then driven to the panels by the PRU.







There are many compact LCD and OLED displays available, but the documentation tends to be poor. This is just a quick post to record a working configuration (circuit and code) to get a compact OLED display working. A 160x128 OLED display was selected, model DD-160128FC-1A (Farnell code 1498857, also available from Newark). It is a very high quality display.


The display is an Organic LED (OLED) type. For interfacing a similar-sized LCD display, see here.

The code that was written is targetted for the BeagleBone Black (BBB) but can be very easily adapted for any platform. For the BBB, it uses an I/O library called iolib (see here for more details) intended for quickly prototyping a solution. The library code is already included in the zip file attached to this post.


The code is prototype level – ideally it would be rewritten to use faster interfaces (e.g. SPI, or PRU processor), but it runs fast enough for many use-cases - with the current code the display update rate is more than sufficient for text information and simple diagrams. Perhaps 30 updates per second are possible with the current code if the entire screen is not being refreshed.


The code has a few graphic commands but not much – it is an easy matter to use one of the many existing third party graphics libraries if anything beyond simple text/graphics is required.

The current code has just these capabilities:

  • Point plotting
  • Line plotting
  • Rectangles (filled, unfilled, bordered)
  • Scalable Text
  • Graphic image read from raw file into RAM
  • Graphic image display from RAM


Display Dimensions and Notes

The display has a Densitron code DD-160128FC-1A. The screen has the label “UG-6028GDEAF01” on the rear. A connector by Omron (Omron code XF2M35151A  Farnell code 1112561) should fit.

Shown below is a diagram from the datasheet. The screen is very thin (about 1.5mm). There is an in-built controller (Syncoam SEPS525) located in the hatched purple area. The display is organized such that memory address 0 is top-left (where the round blob is shown) like most displays. Personally I prefer to have the origin at bottom-left, so the code uses that reference point as (0,0) instead of top-left.



Example Images

These photos were taken in a brightly lit room. The screen appears bright, sharp and has a more rich/saturated quality than LCD displays:



This animated character is drawn at position (0,0), since co-ordinates are taken from bottom-left in the attached code:



An example menu. A circuit board could have buttons to the side:




Note - The photographs are more representative of what the display looks like in action. The image quality appears extremely bright and sharp when viewed in person – about the same as a mobile phone

The video clip here is only really useful to show the update speeds for the current code. The pulsing/flickering and horizontal banding visible in the video is not apparent in real life.

Click here for the video- having real trouble with it, it is from a camera I don't normally use and the quality is pretty bad - sorry. The final animation is actually quite smooth in real life.



There is an optional demo board available, but it is quite basic; it has no active components, it is almost just a breakout board. The demo board was intended to speed development up, but the datasheet slowed things right back down again - the datasheet from Densitron is poor and has many errors (they have taken absolutely no care to review it).

This is the required circuit to get the display working in a serial mode:



An appropriate connector shown here (Farnell code 1112561) should be compatible (35 way, 0.5mm pitch) but was not tested.


The display requires a low voltage supply (3.3V max) which matches what the BBB offers. A higher voltage (13V) supply is also required. I didn’t have any appropriate IC over the holiday period, so a Maxim MAX734 was used, with some resistors used to adjust the voltage to 13V. This is not recommended since it is outside the specification of the MAX734, but the circuit is shown below since it worked for the prototype. It is recommended to use a different circuit.


Once assembled, the circuit was connected to the BBB as indicated in the schematic. The 0V, +3.3V and +5V supply rails were powered directly from the BeagleBone, using the BBB header P9 pins 1, 3 and 5 respectively.



The code is attached to this post. It is written in C. Refer to the file ‘oled.c’ to see the functions available. The main function currently also resides in that file. It runs five demonstrations when executed.


To use it, create a folder off the home directory (/home/root in my case):

mkdir –p development/oled
cd development/oled

The path will now be /home/root/development/oled

Copy the files into this location, then type the following to compile the code:

make install

The demo can now be run by typing:




It would be worthwhile creating a board for this display, and using it for small projects with the BBB where a high quality image is needed. A good amount of information can be represented on this display. It is easy to use with the example C code library, but will require a 13V supply (a small circuit can be used to generate this from the BBB’s 5V supply rail).

For larger displays, the 4.3” and 7” BB-View displays are available.


The revision 1 code is attached below for reference, but is also available here so that changes can be tracked.