Welcome to the Companion Website
This is the companion site for the book “Exploring Raspberry Pi: Interfacing to the Real World with Embedded Linux” by Derek Molloy. It is maintained by the author and it contains supporting digital downloads, video, and source code examples. The website also contains additional materials that are too specific to include in the book. Each chapter in the book links to an individual web page (e.g., /chapter1), which can be accessed using the drop-down menu on the top right-hand side of this page.
Exploring BeagleBone Book (Second Edition, 2019)
Please also see my other book website on the BeagleBone Black. Exploring BeagleBone is a hands–on guide to bringing gadgets, gizmos, and robots to life using the popular BeagleBone embedded Linux platform. Comprehensive content and deep detail provide more than just a BeagleBone instruction manual—you’ll also learn the underlying engineering techniques that will allow you to create your own projects. The book begins with a foundational primer on essential skills, and then gradually moves into communication, control, and advanced applications using C/C++, allowing you to learn at your own pace. In addition, the book’s companion website features instructional videos, source code, discussion forums, and more, to ensure that you have everything you need.
The Book
700 pages
Purchase the Book:
Paperback and Kindle versions available Worldwide.
Americas:
- Amazon (United States) (Canada) Look Inside available
- Amazon (Brazil) (Mexico)
- Wiley (United States)
- Book Depository
- Barnes and Noble
- Books-a-Million
Europe:
- Amazon (United Kingdom) (Germany) (France) (Italy) (Spain)
- Amazon (The Netherlands) Kindle Only
- eBook.de (Paperback) (eBook — epub)
- Wiley (Europe)
- Book Depository
Rest of the World:
- Amazon (China) (India) (Japan)
- Amazon (Australia) Kindle Versions
- Book Depository
e-Books:
- Kindle versions (US)(Canada)(UK)(Germany)(France)(Spain)(Italy)(Japan)(Australia)(India)(Netherlands)
- iTunes
- Google Play
- NOOK Book
- Read online with Safari Books Online: Exploring Raspberry Pi
- Books-a-Million
Full List of Worldwide Locations: Wiley International List
Source Code
All of the source code that is described in this book is available in a public GitHub repository: Derek Molloy Exploring Raspberry Pi repository.
You can clone this repository on a Linux desktop computer or your Raspberry Pi using the command:
1 |
git clone https://github.com/derekmolloy/exploringrpi.git |
You can also install a Windows GitHub desktop application or a Mac OS X GitHub desktop application. Alternatively, you can download a full ZIP archive of the code using the following link: Download Source Code (this is a live link that automatically provides you with the very latest files).
Description
Economical and versatile, the Raspberry Pi can be adapted for thousands of applications. Open up all its possibilities by applying engineering principles along with Linux programming techniques, and develop the skills you need to design and build an endless array of projects.
BUILD THE SKILLS YOU NEED TO INNOVATE
Exploring Raspberry Pi first covers the basics of the hardware platform, recommended accessories, software, embedded Linux systems, and Linux programming techniques. Then it takes you deeper into interfacing, controlling, and communicating, with detailed information about Raspberry Pi GPIOs, buses, UART devices, and USB peripherals. You will learn to configure a cross-compilation environment in order to build large-scale software applications, as well as how to combine hardware and software to enable the Raspberry Pi to interact effectively with its physical environment. Finally, you’ll discover how to use the Raspberry Pi for advanced interfacing and interaction applications such as the Internet of Things (IoT); wireless communication and control; rich user interfaces; images, video, and audio; and Linux kernel programming.
“Exploring Raspberry Pi is THE book to go to if you are interested in learning about the impressive physical computing capabilities of the Raspberry Pi platform. Derek Molloy imparts the electronics, programming, and embedded Linux skills that are vital to today’s innovators in building the next generation of Internet of Things applications.”
Instead of recipes for a few specific projects, Exploring Raspberry Pi arms you with the skills needed to build the projects that exist in your imagination. You’ll learn to:
- Develop essential Linux and programming skills
- Build Internet of Things (IoT) applications
- Master interfacing, controlling, and communication
- Design applications that interact with the physical environment
- Utilize the Arduino platform as a service processor
- Build wireless communication applications
- Write and install a custom Linux loadable kernel module
- Apply the Raspberry Pi 3 and Raspberry Pi Zero to your projects
Author
Prof. Derek Molloy is a Professor in the School of Electronic Engineering at Dublin City University, Ireland. Derek produces a popular YouTube series on the BeagleBone platform and a wide variety of embedded Linux topics. His videos and personal blog have introduced millions of people to the BeagleBone, embedded Linux, and digital electronics. See the About the Author page for more information.
Technical Editor
Dr. Tom Betka came to the world of embedded systems development by way of a previous career in the aviation industry, and then as a physician practicing clinical medicine for well over a decade. During this time his love of computers and software development evolved toward the field of embedded systems, and his training in computer science culminated in a second undergraduate-level degree. After leaving clinical medicine, Dr. Betka began working in the world of software development and has served as a subject-matter expert in both medicine and embedded systems for various companies in the industry. His recent work has included projects at the NASA Kennedy Space Center and the Sierra Nevada Corporation. Tom’s first love is the C-family of programming languages and using these languages to program 8-bit microcontrollers. As a Linux user for the past decade, he has also been working with the BeagleBone, BeagleBone Black, and Raspberry Pi devices for the last several years as well. His hobbies include advanced mathematics, aviation, high-powered model rocketry, and robotics. Also, he can often be found building prototype devices in his home-based machine shop. In a previous life, Tom worked for several years as a professional drummer—and was one of the first in his area to embrace the use of electronic percussion devices in live music scenarios.
Molloy, D. (2016). Exploring Raspberry Pi: Interfacing to the Real Wold with Embedded Linux. New York: Wiley, 978-1119188687, 720pp.
BibTeX Citation:
1 2 3 4 5 6 7 8 |
@book{9781119188681, Author = {Derek Molloy}, Title = {Exploring Raspberry Pi: Interfacing to the Real World with Embedded Linux}, Publisher = {Wiley}, Year = {2016}, ISBN = {9781119188687}, URL = {http://www.exploringrpi.com/} } |
The “Download Source Code” link is for the beaglebone. It should be “https://github.com/derekmolloy/exploringrpi/archive/master.zip”.
Thanks Jim, I fixed that link. Derek.
Hi
On page 515, the git clone do not work (repository not found):
sudo git clone http://git.eclipse.org/gitroot/paho/org.eclipse.paho.mqtt.c.git
Is there any error with the link ?
Hi Vidal, Unfortunately they have moved the project to github from git.eclipse.org, so the repository is now at:
I will add a note to the webpage. Thanks for letting me know, Derek.
Hello Derek,
What a great book!. I’ve been looking for a book at this quality level and detail for a while on the Raspberry Pi. It is highly likely I’ll use your book for my Embedded course next year.
Kind regards,
–andrew
Thanks Andrew, I will be too 🙂 Derek.
Very detailed book. Could you provide an example parts page similar to the one you made for Exploring the BeagleBone? Would help.
Hi Charles, apologies for the delay. That is now on my list of things to do as it would be very useful for readers. Thanks, Derek.
I bought a copy yesterday because some of the chapters looked promising. I am pleasantly surprised, I am still in the early chapters, but this is one of the best written Linux guides I have read, and the Pi specific insights excellent. I will be recommending this book.
There are a couple of points I disagree with. The book repeats some of the Urban Myths circulating in Pi circles.
The Pi 3.3V rail is widely assumed to provide 50mA, and may be true for the original Pi which has an on-board linear regulator. The B+ and later have a switch mode regulator which can supply more. The regulator chip (which supplies both 3.3V and 1.8V) is rated at 1A. Tests indicate up to 800mA can be used – subject to an adequate power supply. See http://raspberrypi.stackexchange.com/questions/51615/raspberry-pi-power-limitations
The GPIO pins can safely supply 16mA. There may be a limit to the total current the GPIO can source, but does not seem to be documented.
I believe the source of the 50mA was Gert’s comment “The raspberry-Pi 3V3 supply was designed with a maximum current of ~3mA per GPIO pin. If you load each pin with 16mA the total current is 272mA. The 3V3 supply will collapse under that!” 3*17 => 51 mA.
Hi there. Thanks for the great feedback. I’m afraid that I too struggled to find an answer to that issue. Broadcom has not provided a datasheet with the technical specifications necessary to answer this question definitively. As such, I had to err on the side of caution. You will see that I avoid drawing or sinking any significant current from/to the GPIOs throughout the book by using FETs/BJTs — I think this is the safest approach. Thanks again, Derek.
Hello Derek,
Great book!. Incredibly useful!! I made a prototype of my project using Raspberry Py, but now, I would like to use one industrial board to make more quantity. Could you recommend me one? At least, I need 1GHZ and 500MB RAM.
You can see the prototype here if you want: https://vimeo.com/179820901/0ad1e16431
The first smart toaster of the world!!
Thank you very much.
Enrique.
Hi Enrique, Super work and very impressive toaster! You could look at the BeagleBone for the final version. In particular, have a look at the Octavo 3358 (http://octavosystems.com/2016/05/09/osd3358-new-era-integration/) which should greatly simplify a product roll out with the spec that you need. Kind regards, Derek.
Mr. Malloy,
Thank you for such a wonderful book. I am a newbie to this topic but found your book by way of an Amazon recommendation after purchasing a Pi 3. My background is in Operational Technology, supporting PLCs, control panels, instrumentation and HMI in the water and wastewater environment. MQTT and the IIOT has my curiosity looking to find a better way for remote monitoring. Custom I/O, Surveillance and remote control by combining new technology with existing platforms. I am looking forward to learning more from your book. Thank you.
Regards,
DeWayne
Thanks DeWayne, Derek.
Hi Derek,
I am about two weeks into the book and like it very much. I first wrote code in 1972 on an ICL1903 as part of my university science course. I used Algol 60 back then. Later I designed and wrote systems for mainframes and minicomputers all of which had less processing power and main memory than the Pi. One thing coding for these old school systems taught me was to write efficient and economical code handy things to know when working with micro controllers. Now I compute for fun as I am retired. I can thoroughly recommend your book to both advanced amateurs and professionals. The only dislike I have is with the C++ language which I have never been able to get to grips with owing to it’s awful syntax. The good thing about the Pi is the large number of languages available so there is plenty of choice. Anyway, thanks again for a great book
Thanks Steve, that is great feedback. Derek.
Hi Derek,
I am now getting into more of the hardware integration in your book Exploring Raspberry Pi. I tried to download the devmem2.c file from the http://www.lartmaker.com site, but it is refusing connection. This seems like a very useful tool and I am wondering if you have this file available at some location on the web. If you don’t, then emailing it might be an option. I appreciate your help.
It looks great again Derek!
I’m a big fan of your Exploring BeagleBone Book and the supportive website which is fabulous on its own. I appreciate your engineering approach to the platform, its more suitable for me personally.
I ordered the RPi book more as a curiosity but I found myself ordering a new Pi 3 as well.. Now looking forward to both!
Keep up the great work, and keep inspiring the minds of our future computer wizards
Hi Derek,
I love your book and have recommended it to others. Please delete my last comment (awaiting moderation), I figured out the issue.
Pertaining to your i2c slave example; for your erratta:
printf “%d.%02d\n”
i2cget -y 1 0x55 0x00
i2cget -y 1 0x55 0x01
does not work, gives errors but in Python, this works.bus.write_byte_data(0x55, 0, 0x01)
time.sleep(0.1)
data1 = bus.read_byte(dev)
print(data1)
time.sleep(0.1)
I am delighted.
Best regards,
Dave Murray
Hi Derek
Have worked on embedded control systems, 8085, Atmel . Was exploring Raspberry PI. This is really a great book. Thank you some much for putting all together.
Regards
Viveka N
Is it possible to buy the pdf version?
Hi – Purchased your Exploring Raspberry PI book and am working through the hello.ko install. No problems with getting the make file to create the module files. However, I received the following error when trying to install the finished hello.ko Last step in the process.
insmod: ERROR: could not insert module hello.ko: Invalid module format
The kernel I’m running is: Linux raspberrypi 4.9.57-v7+ #1045 SMP Fri Oct 20 11:44:49 BST 2017 armv7l GNU/Linux (per uname -a)
The source I downloaded is linux-rpi-4.9.y I’m thinking this is an incompatible version problem? But the source and current kernel appear to be the same. Confusing.
Can you please provide any suggestions. Perhaps others have encountered this problem. Many thanks – Scott
Since the post above, I was able to get an installable hello.ko file working for the pi board mentioned above. The source I downloaded was linux-rpi-4.9.y The book (page 656 step 3) uses
make oldconfig
This defaults all questions based on the contents of your existing ./.config file and asks about new config symbols. I gather if the new symbol questions aren’t answered correctly this leads to building an incompatible hello.ko, hence the error message when loading. I used the following instead:
make defconfig
Which worked. If you enter the linux-rpi-4.9.y directory there is a README file. Starting at line 146 you’ll see all the make options. In the newer linux version I was unable to find (in /proc) the .config or config.gz files. I gather this has changed since 4.1.12-v7+ Also when assigning KHEADER=’pwd’ you’ll want to use KHEADER=$(pwd) Same for the ‘uname -r’ Use $(uname -r) instead. Otherwise all is well. Hope this helps a few out there.
Hi Derek,
Thanks for the book, I have made it to Chapter 5 and I am mainly (90%) enjoying it; so far it is my favourite option.
The only downside is that I am having problems with the examples that access the GPIO in C.
As an example, the makeLED programme in Ch05, which fails to compile under C at line 38; reporting ” makeLED.c:38:7: warning: implicit declaration of function ‘usleep’ [-Wimplicit-function-declaration] usleep(100000); // sleep for 100ms. requiring the inclusion of to allow compilation.
Even then the program fails to run reporting “segmentation faults”; such as on line 48 “writeGPIO(GPIO4_PATH “value”, “1”);”
I assume that my issues surround the programming differences between the various RPi’s; personally I am using an RPi 3, running Raspbian Version 9 (“Stretch”).
In an endeavour to fully progress through your book, could you confirm which RPi and software the book was actually used for testing the programmes?
My aim is then to configure an identical RPi, to complete the book and then explore the GPIO programming across the versions.
I must confess that it is this variety of GPIO configurations that is confusing me, (and probably many other readers) and any help would be welcome.
Thank you in anticipation.
Roger King
Hi Derek,
As of the November 2016 release, Raspbian has the SSH server disabled by default. You might want to add information around page 30 to tell new users how to enable ssh. Refer to the following link. Great book by the way!
https://www.raspberrypi.org/documentation/remote-access/ssh/
Mr. Molloy,
I just got the Raspberry Pi 3B, and plan to go through your book to familiarize myself with the capabilities and uses of the device. Do you recommend installing Stretch or Jesse as the better platform for the code examples in the book, or are both equally compatible?
Best Regards,
Jim
Page 250:
*(gpio + 2) = (*(gpio + 2) & ~(7 << 21) | (0 << 21));
// Writing the 000 is not necessary but is there for clarity.
The comment below the code isn't quite accurate … rather "ORing 0" (e.g. | (0 << 21) isn't necessary …
Page 245:
pi@erpi ~/exploringrpi/chp06 $ cat /proc/iomem
At my side this command doesn’t work properly without sudo: all addresses are ‘0’, but once with sudo, it becomes Ok.
Hello! I will start studing Raspberry. Is it possible to use the book with Raspberry Pi 3 ?