Book Image

BeagleBone Black Cookbook

Book Image

BeagleBone Black Cookbook

Overview of this book

There are many single-board controllers and computers such as Arduino, Udoo, or Raspberry Pi, which can be used to create electronic prototypes on circuit boards. However, when it comes to creating more advanced projects, BeagleBone Black provides a sophisticated alternative. Mastering the BeagleBone Black enables you to combine it with sensors and LEDs, add buttons, and marry it to a variety of add-on boards. You can transform this tiny device into the brain for an embedded application or an endless variety of electronic inventions and prototypes. With dozens of how-tos, this book kicks off with the basic steps for setting up and running the BeagleBone Black for the first time, from connecting the necessary hardware and using the command line with Linux commands to installing new software and controlling your system remotely. Following these recipes, more advanced examples take you through scripting, debugging, and working with software source files, eventually working with the Linux kernel. Subsequently, you will learn how to exploit the board's real-time functions. We will then discover exciting methods for using sound and video with the system before marching forward into an exploration of recipes for building Internet of Things projects. Finally, the book finishes with a dramatic arc upward into outer space, when you explore ways to build projects for tracking and monitoring satellites.
Table of Contents (16 chapters)
BeagleBone Black Cookbook
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

First boot up


BeagleBone Black (BBB) designers have worked hard to simplify the user's first out-of-the-box experience. Although things get more challenging later, which is natural, it is pretty close to Plug and Play at the outset.

You do not even need to load any software as the platform arrives preloaded with a custom distribution of Linux Debian on the internal solid-state drive (eMMC).

Getting ready

Here's what you need:

  • Desktop client PC: As noted in the introduction, we will principally be using a Mac box as our client machine. However, the following steps apply equally to a Windows or Linux machine.

  • USB cable: A mini USB-B to USB cable is required, which is typically supplied with your board.

  • BeagleBone Black Rev. C: To reiterate a point from this book's introduction, our recipes use Rev. C, which is the currently shipping version of the board. If you have an earlier board, you may run into occasional conflicts with the recipes.

How to do it…

Perform the following steps:

  1. To power up, plug the USB cable into the BBB and your client box.

  2. Wait for the three blue LEDs to light up; each of them functions as a useful indicator of the board's health:

    • Power: Once power is supplied to the board, the LED next to the 5V barrel jack will remain on without flashing

    • USR0: Next to the tiny reset button (S1), this light maintains a continuous, solid "heartbeat" blink when powered

    • USR2: Two down from the Ethernet jack, this LED flutters subtly during CPU access

    Note

    Unless otherwise noted, all images are copyright Charles A. Hamilton.

  3. Within a few moments on your client machine, the BEAGLE_BONE drive should appear as a visible volume on your desktop. Browse the folder and open up the START.htm file.

  4. Once opened, you will find a clear set of quick start steps, including how to install drivers (if needed).

  5. Browse your board—BeagleBone Black's boot system includes a handy web server that allows immediate connectivity. Clicking on the link will take you to the local IP address of the board at 192.168.7.2. Once there, you will find a very helpful presentation on the board.

    There is no reason to recapitulate all the material covered in the START.htm presentation. Instead, review it as a good jumping off point for the upcoming recipes in this chapter.

Getting ready

Power down: Before proceeding, remove all cables and power (USB, Ethernet, DC cord, HDMI, and so on).

How to do it...

Perform the following steps:

  1. Connect the USB cable: With a USB 2.0 A to Mini-B cable, connect the BBB to a USB port on your desktop PC.

  2. Look for status lights: After plugging in the USB cable, you will see the board's first LED light up, followed subsequently by the three other LEDs. If all goes well, the BEAGLE_BONE device will appear on your desktop.

  3. Install drivers: I won't belabor this step. It suffices to say that your desktop—whether it's a Windows, Mac, or Linux machine—requires certain drivers to recognize and run the BBB via USB properly. If your desktop OS doesn't come with the drivers already installed (as some do), install them via the link, http://beagleboard.org/Getting-Started.

  4. Once your drivers are installed, browse to the BASIC_START.htm file on the BEAGLE_BONE device and open it.

If the planets are aligned and the drivers are installed properly, you will see the following at the top of the browser window:

Your board is connected! BeagleBone Black rev 0A5C S/N xxxxxxxxxxxx running BoneScript 1.2.3 at 192.168.7.2.

At this point, you're ready to fly; at least at low altitude. With a co-pilot…on an emulator.