My programming ramblings

Getting started with OpenCV on the BeagleBone Black with Ubuntu 14.04 LTS

Posted on April 21, 2014 by Paul

18 December 2018If you prefer to cross compile the latest version of OpenCV for your BeagleBone Black check this article that uses Debian Stretch.

I’ve recently bought a BeagleBone Black for some computer vision and home automation projects I intend to do sometime in the future. BeagleBone has Ångström Linux already installed on the 2GB eMMC card. I have nothing against Ångström, but I prefer to run Ubuntu headless on this tiny computer. Also, Ångström has g++-4.7.2 as the default C++ compiler and I want to be able to use a newer compiler, like the g++-4.8.2, for C++11 development.

As a side note, the next revision of the BeagleBone Black will support Debian Wheezy out of the box, which has an even older C++ compiler than Ångström.

If you want to be able to run Ubuntu and build OpenCV on the BeagleBone Black, you will need a micro SD card of at least 8GB, I recommend buying one of class 10. Personally, I bought a SanDisk micro SD card of 16 GB.

Ubuntu 14.04 for BeagleBone Black can be downloaded from https://rcn-ee.net/deb/microsd/trusty/, just be sure to chose the archive that starts with bone-, e.g. bone-ubuntu-14.04-2014-04-18-2gb.img.

Once you’ve downloaded and extracted the Ubuntu image, you will need to transfer it on the SD card. The exact procedure depends on your OS. I’ve used a Mac computer to transfer the image, so the next instructions applies to OSX only. If you use Windows, you can use the instructions from this page http://beagleboard.org/Getting%20Started#update to transfer the Ubuntu image to the SD card. Just be sure to replace all references to Ångström with Ubuntu.

Connect the SD card to your Mac and open a Terminal, first we need to know where the system has mounted the SD card:

1 diskutil list

Be careful to correctly identify the location of your SD card, or you could damage your OS, in my case this was /dev/disk1. Next, you will need to unmount the SD card in order to be able to write on it:

1 diskutil unmountDisk /dev/disk1

Assuming, you have the extracted Ubuntu image on your Desktop:

1 cd ~2 cd Desktop

Now, you are ready to transfer the image to the SD card:

1 sudo dd if=ubuntu_image_name.img of=/dev/diskX

In my particular case, the above command was:

1 sudo dd if=bone-ubuntu-14.04-2014-04-18-2gb.img of=/dev/disk1

After about 15 minutes (this could take more or less time if you have a different card) I’ve had a card with the Ubuntu image on it.

Next, you will need to insert the micro SD card in your BeagleBone. Press the Boot button on the device and connect it to your computer through the provided USB cable. Keep the Boot button pressed until you see all LEDs flashing on the device, after that you can release the button. The above procedure will ensure that the device will boot from the SD card instead of the included eMMC card.

Once the device is running you can connect to it through ssh. The recommended procedure is to connect your BeagleBone to the Internet through a network cable. If you use Windows, you will need to install PuTTY or another Windows ssh client.

The default user name is ubuntu and the password temppwd, you can connect to the BeagleBone with:

1 ssh ubuntu@192.168.x.xxx

replace the above blanks with your actual device IP. In my particular case the IP of the device was 192.168.0.111.

Once connected to the BeagleBone, you will need to expand the image to the entire SD card:

Disclaimer:All data and information provided on this site is for informational purposes only. solarianprogrammer.com makes no representations as to accuracy, completeness, currentness, suitability, or validity of any information on this site and will not be liable for any errors, omissions, or delays in this information or any losses, injuries, or damages arising from its display or use. All information is provided on an as-is basis. solarianprogrammer.com does not collect any personal information about its visitors except that which they provide voluntarily when leaving comments. This information will never be disclosed to any third party for any purpose. Some of the links contained within this site have my referral id, which provides me with a small commission for each sale. Thank you for understanding.