Chapter 1. Embedded Linux for Makers

image with no caption

If you’re familiar with Linux, you probably think of it mostly as a computer operating system, like OS X or Windows. It’s usually running on user desktops and powering servers. But Linux can also be found within many consumer electronics devices. Whether they’re inside a cell phone, cable box, or exercise bike, embedded Linux systems blur the definition between computer and device.

This blurriness has made its way into the maker realm and that’s great because it’s putting more powerful tools in the hands of regular people, not just those who design electronics for a living.

Many makers who work with electronics love microcontroller platforms like the Arduino, but as the complexity increases in their projects, sometimes an 8-bit microcontroller doesn’t have the power or capabilities to do what they need it to do. For example, if you want to use a camera and computer vision algorithms to detect dirty dishes in your sink, it might be a good idea to explore your options with embedded Linux development boards. These boards are generally more powerful and more capable than their 8-bit cousins and are sometimes the perfect solution for projects that are too complex for our beloved Arduino.

Not only that, but as the price of embedded Linux platforms drops, the community of support around them grows, which makes them much more accessible to novice and intermediate makers than ever before.

The BeagleBone (Figure 1-1) is an embedded Linux development board that’s aimed at hackers and tinkerers. It’s a smaller, more barebone version of their BeagleBoard. Both are open source hardware and use Texas Instruments’ processors with an ARM Cortex-A series core, which are designed for low-power mobile devices.

The Original BeagleBone
Figure 1-1. The Original BeagleBone

Why Use BeagleBone?

These days, a typical microcontroller-based board costs around $20, while the BeagleBone Black retails for $55 at the time of press. Other than a more powerful processor, what are you getting for the extra money?

Built-in networking
Not only does the BeagleBone have an on-board Ethernet connection, but all the basic networking tools that come packaged with Linux are available. You can use services like FTP, Telnet, SSH, or even host your own web server on the board.
Remote access
Because of the built-in network services, it makes it much easier to access electronics projects remotely over the Internet. For example, if you have a data-logging project, you can download the saved data using an FTP client or you can even have your project email you data automatically. Remote access also allows you to log into the device to update the code.
Timekeeping
Without the need for extra hardware, the board can keep track of the date and time of day and can be updated by pinging Internet time servers using the network time protocol (NTP), ensuring that it’s always accurate.
Filesystem
Just like our computers, embedded Linux platforms have a built-in filesystem, so storing, organizing, and retrieving data is a fairly trivial matter.
Use many different programming languages
You can write your custom code in almost any language you’re most comfortable with: C, C++, Python, Perl, Ruby, or even a shell script.
Multitasking
Unlike a typical 8-bit microcontroller, embedded Linux platforms are capable of sharing the processor between concurrently running programs and tasks. This means that if your project needs to upload a large file to a server, it doesn’t need to stop its other functions until the upload is over.
Linux software
Much of the Linux software that’s already out there can be run on the BeagleBone. For example, when I needed to access a USB webcam for one of my projects, I simply downloaded and compiled an open source command line program which let me save webcam images as JPG files.
Linux support
There’s no shortage of Linux support information out on the web and community help sites like Stack Overflow come in handy when a challenge comes along.

Intended Audience

Even though embedded Linux development boards are becoming easier to work with, it does take some skill (or at least patience and persistence) to use them if you’re just starting out. This book assumes you know your way around a typical computer, be it with OS X, Windows, or Linux. While it’s not necessary, it will help to know how to get around the Linux command line as well. This book will equip you with only the very basics of Linux skills so that you can work through the examples and projects. As you start to create your own projects with BeagleBone, a good foundation in Linux will be incredibly helpful. Luckily, there’s an enormous community of support around Linux, so help is usually one web search away.

This book will also walk you through the fundamentals of programming the board with JavaScript and Python. There’s a lot to learn in both languages so I can’t cover all the details, but I’ll point you to additional resources for learning more. If you prefer coding in another language, this book can still give you a good idea of how to do a few special BeagleBone tricks.

Feedback

I encourage you to contact me with any feedback as you read this book. I hope to be able to incorporate your suggestions into future editions. My email address is . You can also find me on Twitter with the name @MattRichardson.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.147.70.247