Book Image

Learning BeagleBone

By : Hunyue Yau
Book Image

Learning BeagleBone

By: Hunyue Yau

Overview of this book

Table of Contents (18 chapters)
Learning BeagleBone
About the Author
About the Reviewers
Terms and Definitions


The BeagleBone provides a vehicle for learning embedded devices. Regardless of whether you are a maker looking to embed a computer into your latest project or just interested in learning about embedded programming, the BeagleBone is the board to use. Unlike other low-cost controller boards, the BeagleBone is a fully fledged computer using current mobile technology made accessible for custom projects, prototypes, and learning. The BeagleBone can be programmed in almost any manner that a desktop or laptop Linux system can. Design material is openly available so projects can be independently manufactured.

This book goes through the basics of the BeagleBone boards along with exercises to guide a new user through the process of using the BeagleBone for the first time. It covers unboxing a new BeagleBone and basic configuration of a desktop or a laptop system so that the board can be programmed. For anyone who has previously used a microcontroller or has only programmed desktop systems, this book provides simple exercises using no more resources than what is on the board.

What this book covers

Chapter 1, Introducing the Beagle Boards, introduces you to the idea of the Beagle boards and also serves as a quick guide to the entire family of boards, as each board has unique features that may make one board more suitable than another. It goes on to unboxing your first BeagleBone and verifying whether it is running using a desktop or laptop system. It'll also take you through useful accessories for the BeagleBone.

Chapter 2, Software in the BeagleBone, introduces the software in the BeagleBone. It covers three aspects that include getting around the software that come with the board, getting precanned images onto the board, and building software for the board on the board. As part of this chapter, analogies to desktop software are provided.

Chapter 3, Building an LED Flasher, covers a basic introductory exercise of building a simple LED pattern flasher "product" using the LEDs on the BeagleBone, along with sample solutions. The entire example is doable with just the BeagleBone itself. The only other thing needed is a PC to interact with the board.

Chapter 4, Refining the LED Flasher, builds on the previous chapter and explains how to access the I2C bus. Again, no additional hardware is needed.

Chapter 5, Connecting the BeagleBone to Mobile Devices, looks at options to connect a BeagleBone to a mobile device, such as a phone using Bluetooth. It goes through different methods suitable for different types of mobile devices and the potential pitfalls of each method.

Chapter 6, Recovering from the Mistakes, covers possible mistakes that may cause the board to appear as dead. This chapter explains the process of attempting to recover from such mistakes. It also goes through a quick diagnostic process to determine whether the board is likely to be dead.

Chapter 7, Interfacing with the BeagleBone, takes you through the very basics of connecting simple hardware to the BeagleBone. It covers the basics of how to avoid damaging the board.

Chapter 8, Advanced Software Topics, covers more advanced ways of writing software for the BeagleBone. It provides guidance to help you go beyond what this book will cover.

Chapter 9, Expansion Boards and Options, explains what a cape is and the examples of off-the-shelf things that can be added. It also goes through the process of creating your own cape or even a basic expansion board.

Appendix A, The Boot Process, provides a slightly more detailed look at how a BeagleBone loads software while powering on. This is useful in finding rapid development methods or troubleshooting.

Appendix B, Terms and Definitions, provides background information on select terms used throughout the book for new BeagleBone users. These cover terms used both in this book and terms that may be encountered in the BeagleBone community.

What you need for this book

In order to go through this book, you should have a BeagleBone. Both the BeagleBone White and the BeagleBone Black are covered and can be used for the exercises. While the BeagleBone can be programmed in a standalone fashion, this book will focus on programming it through a desktop or a laptop system. As such, a desktop or a laptop running Windows or Linux is recommended. It is possible for a reader to use a Mac OS system, but this book assumes the user is familiar with Mac OS enough to bridge the gap between Mac OS and Windows or Linux. You should have some knowledge of getting around the laptop or desktop system.

Who this book is for

If you are not familiar with embedded Linux and would like to learn about it, this book is for you. This book is specifically targeting anyone who wants to use the BeagleBone as the vehicle for their learning; this includes makers who want to use the BeagleBone to control their latest product, or anyone who wants to learn to leverage current mobile technology, or someone who wants to move beyond simple microcontroller boards.


In this book, you will find a number of styles of text that distinguish between different kinds of information. Here are some examples of these styles, and an explanation of their meaning.

Code words in text, database table names, folder names, filenames, file extensions, pathnames, dummy URLs, user input, and Twitter handles are shown as follows: "For Linux users, ssh [email protected] will log you in to the board."

A block of code is set as follows:

$ ifconfig -a
eth1      Link encap:Ethernet  HWaddr 1c:ba:8c:95:18:a0  
          inet addr:  Bcast: Mask:
          inet6 addr: fe80::1eba:8cff:fe95:18a0/64 Scope:Link
          RX packets:21 errors:0 dropped:0 overruns:0 frame:0
          TX packets:101 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:5280 (5.2 KB)  TX bytes:21808 (21.8 KB)

Any command-line input or output is written as follows:

$ mount | grep sdb
/dev/sdb1 on /media/HYBOOT type vfat (rw,nosuid,nodev,uid=1000,gid=1000,shortname=mixed,dmask=0077,utf8=1,showexec,flush,uhelper=udisks)
$ sudo umount /dev/sdb1

New terms and important words are shown in bold. Words that you see on the screen, in menus or dialog boxes for example, appear in the text like this: "Enter the IP address in the HostName section."


Warnings or important notes appear in a box like this.


Tips and tricks appear like this.

Reader feedback

Feedback from our readers is always welcome. Let us know what you think about this book—what you liked or disliked. Reader feedback is important for us as it helps us develop titles that you will really get the most out of.

To send us general feedback, simply e-mail , and mention the book's title in the subject of your message.

If there is a topic that you have expertise in and you are interested in either writing or contributing to a book, see our author guide at

Customer support

Now that you are the proud owner of a Packt book, we have a number of things to help you to get the most from your purchase.

Downloading the color images of this book

We also provide you with a PDF file that has color images of the screenshots/diagrams used in this book. The color images will help you better understand the changes in the output. You can download this file from:


Although we have taken every care to ensure the accuracy of our content, mistakes do happen. If you find a mistake in one of our books—maybe a mistake in the text or the code—we would be grateful if you could report this to us. By doing so, you can save other readers from frustration and help us improve subsequent versions of this book. If you find any errata, please report them by visiting, selecting your book, clicking on the Errata Submission Form link, and entering the details of your errata. Once your errata are verified, your submission will be accepted and the errata will be uploaded to our website or added to any list of existing errata under the Errata section of that title.

To view the previously submitted errata, go to and enter the name of the book in the search field. The required information will appear under the Errata section.


The BeagleBone is a sensitive electronic device and may be damaged by improper handling. Proper care should be taken during handling, development, and testing. Read all warnings in this book and in the BeagleBone documentation at Specifically, read and understand the SRM (Software Reference Manual). Do not attempt hardware interfacing without understanding limitations and specifications for the board and the associated components. The information in this book is provided on a best effort basis by the author. Software and hardware is constantly updated and, as such, it is possible for conflicting changes after the publication of this book. The author is not responsible for any damages.


Piracy of copyright material on the Internet is an ongoing problem across all media. At Packt, we take the protection of our copyright and licenses very seriously. If you come across any illegal copies of our works, in any form, on the Internet, please provide us with the location address or website name immediately so that we can pursue a remedy.

Please contact us at with a link to the suspected pirated material.

We appreciate your help in protecting our authors, and our ability to bring you valuable content.


You can contact us at if you are having a problem with any aspect of the book, and we will do our best to address it.