The BeagleBones are open-source single board computers (SBCs) that share much of the design intent of a hundred other SBCs like it. That is to say, BeagleBones are small and inexpensive but very powerful computers. They are excellent learning platforms for students, hobbyists and professionals; they simplify the development process.
However, before jumping into a project, there are some things worth knowing up front that will make for a better user experience.
While there have been several BeagleBone (BB) iterations since the initial release of the BeagleBoard back in 2008, this article pertains specifically to the BeagleBone Black and Green boards.
It is not the purpose of this article to present any of these tips as a complete lesson. It is information and advice acquired through experience and compiled for the novice user so that they may sidestep some of the pitfalls and stumbling blocks of getting started with these devices.
1: Getting started on the BeagleBone
A separate keyboard, mouse and monitor are not required. In fact, some models of BeagleBone have no on-board HDMI or display-port. This will not be an impediment to getting the board running. Just plug the BeagleBone into the PC via a USB cable and then install the latest BeagleBone drivers. Next, tunnel into the BeagleBone via a SSH (secure shell) session in a browser window (don’t use Internet Explorer for this).
2: Get an enclosure
Unless the BeagleBone is going to be dropped right into a project chassis, get an enclosure. If not an enclosure, then consider mounting the board to a sheet of plastic. High-density polyethylene cutting board material is great for this. The enclosure, or plastic baseplate, protects the BB from being battered around and from accidental shorts.
When shopping for an enclosure, look for one that exposes the GPIO port and the RESET button, such as the 1593HAMBONETBU from Hammond Manufacturing (Figure 1). Exposing the port and button avoids the frustration of having to take the box apart to do a reset or to wire accessories to the GPIO header.
Figure 1: An enclosure will protect the board and prevent shorts, but pick one that exposes the GPIO port and RESET, such as the 1593HAMBONETBU from Hammond Manufacturing. (Image source: Hammond Manufacturing)
3: Warning: BeagleBone boards are very finicky about their power
A very common issue first-time BB users experience is the board not booting up when power is applied. Very often this is just the power supply having a slow voltage rise time or not being able to keep the voltage momentarily from dipping as it suddenly experiences a load.
There have been some slight changes in component selection through the BeagleBone Black (BBB) iterations in an attempt to alleviate these issues; however, selecting a good power supply is still prudent. Don’t skimp on the power supply. Saving a few dollars on a supply isn’t worth the frustration of trying to use a device that only works some of the time and has the potential to damage the BeagleBone board. Go for something like Volgen America/Kaga Electronics USA's KTPS12-05025WA-VI-P1 5 VDC, 2.5 A, barrel-plug supply. The power jack on a BeagleBone accepts barrel type power connectors with an inside and outside diameter of 2.1 mm and 5.5 mm, respectively.
An underperforming power supply is also going to negatively affect a Wi-Fi dongle, if one is used. Intermittent behavior and connection failures are some of the more common symptoms of an underpowered dongle. When using a dongle, make sure that the supply, like the KTPS12-05025WA-VI-P1, can source at least 2 A.
If experiencing a failure to boot, try holding the reset button on the board long enough for the power supply to stabilize. Then release the button. Also, shut down the BB board by using the power button on the board, rather than just pulling out the power connector.
In a related issue, don’t try to power a BB via its GPIO header; routing power though the GPIO can damage the ARM CPU.
4: The BeagleBone Black’s secret weapon: PRUs
The BeagleBone’s biggest secret weapons are the PRUs. PRU stands for “programmable real-time unit.” The PRUs are smaller, little-helper microcontrollers to which the main CPU can offload tasks.
Without PRUs, additional hardware may be needed for rapid or real-time control of I/O. Hypothetically, it’s possible to toggle a pin as fast as the code can execute. Also, they come with their own set of peripherals like UARTs and PWM. All of the resources of the PRUs are available to the main processor. Learn how to use the PRUs. They will circumvent the need to kludge parts together to augment the BB.
5: Learn Python
Arguably, the fastest way to start controlling the GPIO on the BeagleBone is to write some Python code. Debian is the current flavor of Linux that the BeagleBone uses as the default operating system. Within Debian is a development environment called “Cloud 9.” Look for Cloud 9 in the menu on the left side of the screen after SSHing into the BeagleBone.
Go to Python.org and download the Python documentation for whatever version is running on the board. To check the version, go to the command line and type “python.” This will call the Python shell and it will list the version number at the top.
To create a Python graphical user interface (GUI), one of several methods is to use the Tkinter libraries. An excellent resource on the subject is the eBook written by Jan Bodner.
A final note, something that the laymen won’t be aware of, is the incompatibility between Python 2.x.x and 3.x.x. To run, the code needs to be the correct syntax for the version of Python on the BeagleBone. That said, if there is a sample of incompatible code, it is possible to edit the code to make it run in on the board’s version of Python.
6: Print a picture of the BeagleBone pinout
The BeagleBones have almost no pin identifiers silkscreened onto the boards. While inconvenient, it does keep the boards small and tidy. Keep the pin-out handy for reference (Figure 2).
Figure 2: Print out of the BeagleBone GPIO pin-header identifier. (Image source: Embedded Basics)
7: The BeagleBone Black is very particular about its choice of Wi-Fi dongle
Figure 3: The BeagleBone Black is particular about its Wi-Fi dongle, so to get around the problem use a known good part, such as the Adafruit 814 Wi-Fi dongle. (Image source: Adafruit)
Another way to get Wi-Fi connectivity is to procure either the BeagleBone Black Wireless (Figure 4) or BeagleBone Green Wireless (Figure 5). These board iterations have Wi-Fi built-in, eliminating the need for a separate dongle.
Figure 4: Another way to get Wi-Fi connectivity is to opt for a BeagleBone Black Wireless. (Image source: GHI Electronics)
Note that some features of the non-wireless versions of these boards were sacrificed to make room for the Wi-Fi capability. For example, BeagleBone Green Wireless gains Wi-Fi and Bluetooth at the cost of on-board Ethernet.
Figure 5: The BeagleBone Green Wireless sacrificed on-board Ethernet to make room for Wi-Fi. (Image source: Seeed Technology)
8: Get to a list of Linux (Debian) commands
To successfully navigate Linux (Debian), use the command line. Start an SSH session with the BeagleBone and open a new tab within Cloud 9. From here, get a list of commands by typing “help” and then hit “Enter.” To expound on any of these commands type “man,” followed by the name of the command. A more complete description will then appear on the screen. Note that in Linux, folders are called directories.
9: Linux is not a real-time operating system
Most BeagleBone users will be running Debian. Debian, other versions of Linux, and most other operating systems work by dividing up processing time and parsing it out to whatever processes are running. CPU time must be parsed out to the kernel, the GUI, its associated processes and whatever code is running. The OS is going to consume the vast majority of these clock cycles. Whatever is left over gets set aside for code. This makes it impossible for the CPU to perform actions beyond a certain level of precision. For example, a BeagleBone running Linux cannot provide the precise timing required for communication with the commonly available strips of WS2812 LEDs. Real-time tasks should be handled by the PRUs.
10: Once up and running, use capes and accessory boards to get farther, faster
Capes are accessory boards that augment the BeagleBone’s capabilities and get a lot of extra hardware needs out of the way quickly. There are capes and accessory boards available for many common tasks.
For instance, there is no innate CAN bus interpretation onboard any of the BeagleBones. Rather than write code to bit-bang the CAN bus, get a cape to handle the intricacies of CAN bus communication.
There are display capes, sensor capes, motor drive capes, and prototype capes that are essentially blank perf-boards that plug into the BB GPIO header. Texas Instruments even supplies a PRU cape that breaks out the PRU peripherals.
Figure 6: A PRU cape “breaks-out” the peripherals of the PRUs. (Image source: Texas Instruments)
BeagleBone SBCs are powerful computing platforms that can do a lot and can make electronic projects fun and fast. With a little forethought and research, combined with advice from those who have been through it a few times, the startup process can go much smoother.