Introduction

If you have already purchased my book Exploring BeagleBone (thank you!), an obvious question is should I purchase this book, Exploring Raspberry Pi. This page compares and contrasts the two books to help you make your decision.

I am often asked the question: “Which should I purchase, the Raspberry Pi, or the BeagleBone Black?” The answer to that question really depends on your intentions. If you are using the board as a multimedia player, general-purpose computing device/display, range of board types, or if price is a primary concern, then consider the Raspberry Pi. If you are building a commercial product, need to interface to analog sensors, or need robust on-board storage, then consider the BeagleBone Black.

First off, the Exploring Raspberry Pi book is absolutely focused on the Raspberry Pi. It took six months of hard work to adapt and extend the coverage in Exploring BeagleBone so that I could deliver a high-quality text that I was happy to stand over. At a general level I have aimed to achieve the following:

  • Provide a wide range of hello world examples for all types of hardware interfacing tasks. Every single code example was written on and tested on the Raspberry Pi 2 or 3 boards.
  • Deal with the interfacing shortcomings of the Raspberry Pi. There is an entire chapter on this topic that shows you how to overcome the lack of interfacing options (e.g., lack of analog-to-digital conversion, limited PWMs, GPIOs)
  • I have tried to align the chapter structure with the Exploring BeagleBone book so that it is easy to move from one reference text to the other.
  • The book is considerably longer (~120 pages) than the Exploring BeagleBone book, covering topics such as wireless communication, kernel programming, slave processing (Arduino and NodeMCU/ESP8266), Internet of Things, which were not possible in my first book.
  • There is a custom GitHub repository for all of the source code in this book.

Please note that Part 1 in this book has significant overlap with Part 1 in Exploring BeagleBone, as they both build the same core competencies that are required for working with either board. However, all examples and discussions are re-written to be specific to the Raspberry Pi platform. In addition, the Exploring Raspberry Pi book is 120 pages longer as a result.

Chapter by Chapter Comparison


Part I – Raspberry Pi Basics

Chapter 1: Raspberry Pi Hardware (pg. 3) [Wholly New, following the same format]

  • This chapter performs the same function as Chapter 1 in Exploring BeagleBone
  • All of the content is wholly new and relates to the various boards that are available under the Raspberry Pi platform, including the Raspberry Pi 3 and Raspberry Pi Zero.

Chapter 2: Raspberry Pi Software (pg. 23) [Some Overlap, following the same format]

  • This chapter performs the same function as Chapter 2 in Exploring BeagleBone
  • There is summary coverage of the custom images available for the RPi
  • There is a greater focus on Ethernet Crossover cables, as Ethernet over USB is not available
  • The use of SSH/basic commands is very similar, but there is a focus on the use of the Raspberry Pi Configuration Tool, the Video Configuration tools, interaction with the RPi on-board LED/LEDs.

Chapter 3: Exploring Embedded Linux Systems (pg. 55) [Significant Overlap, following the same format]

  • This chapter performs the same function as Chapter 3 in Exploring BeagleBone
  • Linux on the Raspberry Pi is very similar to Linux on the BeagleBone so there is repetition between the two books on this topic. However, the chapter includes detailed new coverage of, Raspberry Pi bootloaders, systemd, discussion on the reliability of SD cards and extending their lifespan, etc.
  • The examples throughout this chapter are specific to tasks that you would perform with the Raspberry Pi that are different to those that you would perform with the BeagleBone (e.g., due to the absence of an eMMC and through the use of USB storage devices).

Chapter 4: Interfacing Electronics (pg. 113)  [Significant Overlap, following the same format]

  • This chapter performs the same function as Chapter 4 in Exploring BeagleBone and is almost identical to the coverage of interfacing electronics that is provided in Exploring BeagleBone.
  • There is some additional discussion on the use of cable crimping tools for custom connectors and the use of interface adapter boards such as the T-Cobbler.

Chapter 5: Programming on the Raspberry Pi (pg. 159)  [Significant Overlap, following the same format]

  • This chapter performs the same function as Chapter 5 in Exploring BeagleBone.
  • A broader range of languages are examined, but the context is very similar.
  • Testing includes multi-core processors, a mention of 64-bit processors, standard performance testing.
  • All examples in all languages perform tests on physical LED circuits
  • There is significant discussion on Python, Cython and Boost.Python; however, the emphasis languages in this book remains on C/C++, Nodejs, and Lua scripting.

Part II – Interfacing, Controlling, and Communicating

Chapter 6: Interfacing to the Raspberry Pi Input/Outputs (pg. 219) [New but with same format]

  • This chapter performs the same function as Chapter 6 in Exploring BeagleBone.
  • The chapter begins with a similar discussion on the use of file-based sysfs GPIO usage. There is some discussion on multi-core performance.
  • There is a lengthy discussion on Memory-Based GPIO Control using the BCM2835/6 registers.
  • The focus of the chapter is the use of WiringPi (gpio command and C/C++/Python programming), including discussion on press/response characteristics, memory-based communication with one-wire sensors, on-board PWM (including servo motors), and general-purpose clock signals.

Chapter 7: Cross-Compilation and the Eclipse IDE (pg. 275)  [New but with same format]

  • This chapter performs the same function as Chapter 7 in Exploring BeagleBone.
  • The chapter describes the Linaro and Debian Cross-toolchains, and multiarch.
  • The discussion on Eclipse follows the same format but is updated for recent releases.
  • SCP and RSYNC is covered by example.
  • Greater emphasis on debugging using gdb and remote gdb.
  • Discussion on how to build a Linux kernel and a Linux distribution (using Yocto)
  • Discussion on the Fully Preemptible Kernel Patch.

Chapter 8: Interfacing to the Raspberry Pi Buses (pg. 309) [New but with same format]

  • This chapter performs the same function as Chapter 8 in Exploring BeagleBone.
  • Similar background discussion on I2C, SPI and Uart devices, but applied to the RPi, e.g., setting h/w baud rates, enabling devices etc.
  • Detailed coverage of real-time clocks (and their relationships to LKMs)
  • I2C with WiringPi
  • SPI specifics on the RPi, including interfacing to 74HC595 ICs.
  • SPI with WiringPi
  • Multiple SPI slave devices on the RPi
  • Discussion on the mini-UART/full-UART on the RPi and the issues that arise with the RPi3.
  • New examples: RPi as a UART slave device, GPS using low-cost modules.

Chapter 9: Enhancing the Input/Output Interfaces on the RPi (pg. 363) [New]

  • No equivalent chapter in Exploring BeagleBone.
  • New coverage on ADC, DAC.
  • gnuplot
  • SPI/I2C GPIO expanders
  • PWM expanders
  • C Library for BCM2835
  • DAC with Op-amps for programmable voltage control
  • Udev rules
  • Adding USB UARTs to the RPi

Chapter 10: Interacting with the Physical Environment (pg. 405) [New with some overlap]

  • This chapter performs the same function as Chapter 9 in Exploring BeagleBone.
  • Additional coverage on high-powered DC motors (Pololu Simple Motor Controller)
  • Restructuring and simplification of interfacing to linear/non-linear analog sensors
  • Fitting data to a curve using gnuplot
  • Interfacing to MAX7219 character displays
  • Interfacing to low-cost OLED dot-matrix displays
  • Building C/C++ Libraries using Makefiles/CMake, with greater coverage of static/dynamic library creation and usage

Chapter 11: Real-Time Interfacing Using the Arduino (pg. 453) [New]

  • No equivalent chapter in Exploring BeagleBone.
  • This chapter is new to this book and deals in detail with the use of the Arduino as a slave processor (over UART, I2C and SPI). The use of the Arduino over I2C in particular is an important topic, as it allows you to create your own types of digital sensors.

Part III – Advanced Interfacing and Interaction

Chapter 12: The Internet of Things (pg. 483) [New with some overlap]

  • This chapter performs a similar function to Chapter 10 in Exploring BeagleBone
  • Discussion on the use of heatsinks
  • Use of Nginx rather than Apache
  • GNU Ggicc
  • LAMP and MEAN
  • Updated coverage of ThingSpeak, Cron, IFTTT, e-mail.
  • Detailed coverage of Large-Scale IoT Framework, MQTT, paho, IBM Bluemix.

Chapter 13: Wireless Communication and Control (pg. 535) [New]

  • No equivalent chapter in Exploring BeagleBone.
  • Coverage of Bluetooth (important for RPi3)
  • Detailed coverage of the NodeMCU/ESP8266 Wi-Fi slave processor
  • JSON
  • Detailed coverage of ZigBee/X-Bee devices in both AT and API mode.
  • Near Field Communication

Chapter 14: Raspberry Pi with a Rich User Interface (pg. 577) [Some overlap, new applications]

  • This chapter performs a similar function to Chapter 11 in Exploring BeagleBone
  • Fully updated for Qt5 to include easier-to-follow examples on building applications on the RPi for the RPi.
  • New weather sensor applications using the one-wire sensor from Chapter 6.

Chapter 15: Images, Video, and Audio (pg. 615) [Some overlap, updated for RPi and its devices]

  • This chapter performs a similar function to Chapter 11 in Exploring BeagleBone
  • Full coverage of the RPi camera and raspivid tools
  • Discussion on RPi audio HATs
  • Updated to include on-board text-to-speech capabilities.

Chapter 16: Kernel Programming (pg. 647) [New]

  • No equivalent chapter in Exploring BeagleBone.
  • Detailed discussion on the use of Linux loadable kernel modules (LKMs) to create custom kernel-space code for interacting with GPIOs.