Getting Started With BeagleBone
Matt Richardson
Foreword
Jason Kridner
BeagleBoard.org cofounder and author/maintainer of BoneScript
Matt is leading the charge to make technology serve you, the individual, and a new generation of innovators. BeagleBone Black is his newest, strongestand most affordabletool for building understanding, mastery, and just outright fun electronics projects. As one of the creators of this tool that enables just about anyone to sense, control and manage the data in the world around them, Im obviously proud of what it can do. No amount of pride, however, is going to help you understand BeagleBones capabilities or how to master them. Matts contribution with this book is a piece previously missing from the Beagle-verse and one Im confident will help you in your journey along the path hes paving.
When I was quite young, it was two books that set me on the path to understanding what could be accomplished with programmable electronics: Getting Started in Electronics by Forrest M. Mims III and Getting Started with TRS-80 BASIC by George Stewart. At the time, my experience with each programming and electronics was a separate endeavor. Programming was, at the time, the way you made use of a computer. The computer wasnt burdened with the storage of family photos or even precious business data, because my moms business data was safely removed using floppy disks and stored away from my exploration. I was able to type in instructions to do whatever I could imagine, as long as I didnt open the box.
Far away from the computer, I was making runs to Radio Shack and buying components to build circuits that blinked LEDs and reacted to the ambient light in the room. It was almost a decade before I started connecting components up to microprocessors. As much as I had enjoyed modifying the games Id typed into the computer such that Id always win, having my programs interact with the physical world around me was an entirely new source of fire in my soul. All the everyday technology around me took on new meaning as I could understand how to make it myself and make it behave as I wanted.
When Gerald Coley, the hardware designer of BeagleBone Black and all of the BeagleBoard.org boards, approached me in 2007 to do something new with TIs ARM processors to bring the technology to a much wider audience, the idea of bringing back something closer to my childhood programming and electronics experiences fell naturally out of our discussions with our colleagues. Geralds passion for excellence in electronics is something that has proven itself invaluable to the BeagleBoard.org community and me personally. Gerald has certainly never been one to be satisfied with typical notions of what is good enough.
With the emergence of so many new do-it-yourself electronics tools in recent years, Im thrilled that many aspects of my childhood electronics experiences are once again available to technology-minded individuals looking to build something new of their own for the first time. It seems, however, that this splitbetween programmable computers that let you do what you expect to do with a computer, such as browse the web or even act as a web server, and devices that are great to talk to real-world components like motors, temperature sensors and light switchesis still quite prevalent. BeagleBone spans that divide.
Thanks now to Matts effort with this book, Im quite hopeful many more people will learn what programmable electronics can enable for them and experience what Gerald has offered to all of us. Even more, I hope it is a part of educating the next generation at any age how to make technology serve them, rather than merely living with someone elses idea of the perfect gadget whos purpose is to serve that someone elses goals.
Preface
I first noticed the BeagleBone in 2011. At the time, most of my projects involved the Arduino, so I was quite curious when I saw a board that looked a little bit like an Arduino but acted more like a full computer. It seemed a bit complicated, so I was initially skeptical that I would be able to get anything working with it. Nonetheless, I ordered a BeagleBone and eagerly anticipated its arrival.
When it arrived, I was first amused by its dimensions. It fit in the palm of my hand and could even be enclosed within an Altoids tin. In fact, it fit almost too perfectly inside the tin. The radius of the rounded corners seemed to indicate that it was designed for such an enclosure. Id later learn that, indeed it was designed that way.
After a lot of Internet searching and brushing up on how to write scripts within Linux, I had the BeagleBone blinking an LED, a common first step with hardware development platforms. Soon thereafter, I was reading the state of buttons, pulling images from a webcam, printing text with a receipt printer, and connecting the board to the Internet.
My first big project with the BeagleBone was called the Descriptive Camera. It worked a lot like a regular camera: point it at a scene that you want to capture and then hit the shutter button. But thats where the similarities with a camera end. Instead of saving a photograph, this prototype camera outputs a text description of the scene that youve captured. And it even spits it out of the front of the camera like a Polaroid print.
The Descriptive Camera didnt use any fancy computer vision algorithms to convert the image into text. It actually used crowd sourcing. After hitting the shutter button, the photo would be uploaded to Amazons Mechanical Turk service, where you can pay people online to do small tasks like transcribing audio, identifying terms in a contract, or in this case, describe a photo. After the person submitted the text, it would be outputted by the cameras printer.
The BeagleBone was the perfect platform for this endeavor. Making a project that brings together a USB webcam, an Internet connection, buttons, LEDs, and the receipt printer, all while enclosing it in a small box would have been very difficult with many of the other platforms out there. As a tool, the BeagleBone is so capable and flexible that I could have created this same exact project in so many different ways.
But I know from experience that having a tool thats so versatile can make things hard when youre just starting out. Theres no right way to do any single thing, so you can feel paralyzed before youve even begun.
My hope is that this book will get you through that initial phase. It will give you just enough of the basics in a few different realms so that you can start digging deeper on your own. Having a few different ways to do the same thing means you can settle on the way that youre most comfortable with and focus on making your vision a reality.
Conventions Used in This Book
The following typographical conventions are used in this book:
Italic Indicates new terms, URLs, email addresses, filenames, and file extensions. Constant width
Used for program listings, as well as within paragraphs to refer to program elements such as variable or function names, databases, data types, environment variables, statements, and keywords.