About the Perl/Raspberry Pi eBook
In the usual Perl tradition, a number of Perl modules for the Raspberry Pi already exist, including RPi::WiringPi and Device::WebIO::RaspberryPi. There are also modules for interacting with sensors, such as Device::TMP102 (a temperature sensor) and Device::Gyroscope::L3GD20 (a gyroscope). Despite this, there are few writeups on Perl-based hardware projects in the wild.
As Perl programmers, we all like to use existing CPAN modules whenever possible. Still, new hardware devices are coming out all the time, and there won't be modules available for all of them. That's why this book will walk you through how to read a datasheet and implement a new piece of hardware. It's easier than you think, and will help expand Perl into a whole new niche.
Basic knowledge of Perl will be assumed. If you would like to learn Perl before the book is released, we recommend Learning Perl by Randal L. Schwartz, brian d foy, and Tom Phoenix. You should also know how to use basic Linux commands. The Raspberry Pi itself makes a good platform for learning Linux, so why not pick one up ahead of time and start playing around?
Existing knowledge of hardware interfacing or the Raspberry Pi is not required. Knowing how to solder will be helpful, but this is something you can learn as you go.
The eBook will be self-published on Leanpub. It's expected to be completed by August 2018.
Outline
Here's the currently planned material:
- RPi Models, and Tools/Hardware You Need
- Basic Setup
- GPIO [blink an LED, read from a switch, pullups/pulldowns]
- SPI
- i2c
- Camera [GStreamer1, face tracking with OpenCV]
- Serial
- Expanding with Firmata
- Interfacing from the Web [Device::WebIO]
- PWM and Analog Input
- Asynchronous code
- Build Project: Temperature Logger
- Build Project: Garage Door Opener
- Build Project: Indoor Grow Room
Stretch Goal
If we make it to $4000, we will add chapters on:
- Infrared remote control
- MQTT
- Developing a device module in C and interfacing with Perl
About Timm Murray
I've been programming Perl professionally for 15 years, and have authored 33 CPAN distributions. I've also written for Perl.com, and keep a regular blog at wumpus-cave.net. Many of my modules cover hardware integration, such as Linux::IRPulses (parsing infrared control signals from LIRC) and UAV::Pilot (a framework for controlling drones).
About Steve Bertrand
I've coded in Perl since 2001.
I have 40+ published CPAN distributions, and currently author berrybrew, the Perlbrew for Windows.
My main focus in Perl has been writing software to help the developer; test software (Test::BrewBuild) (testing reverse dependencies included), examination software (Devel::Examine::Subs), and over the last two years plus, I've been focusing on writing software for the Raspberry Pi, including WiringPi::API and numerous custom sensor and Integrated Circuit (IC) software based on C/XS code.
Risks & Challenges
Hardware can be a tricky subject with lots of hidden pitfalls. You may spend hours trying to figure out why you can't communicate with a module, only to find out it works fine after wrapping a ground wire around a signal wire to block interference. That said, the authors have gone down this path before and have already amassed some hard won experience.