Raspberry Pi for Secret Agents
Turn your Raspberry Pi into your very own secret agent toolbox with this set of exciting projects!
Overview Detect an intruder on camera and set off an alarm Listen in or record conversations from a distance Find out what the other computers on your network are up to Unleash your Raspberry Pi on the world
Ever wished you could play around with all the neat gadgets your favorite spies use (like James Bond or Michael Westen)? With the introduction of the remarkable Raspberry Pi and a few USB accessories, anybody can now join in on the action.
Discover how to turn your Raspberry Pi into a multipurpose secret agent tool! Through a series of fun, easy-to-follow projects you’ll learn how to set up audio/video surveillance, explore your Wi-Fi network, play pranks on your friends, and even learn how to free your Raspberry Pi from the constraints of the wall socket.
Raspberry Pi for Secret Agents starts out with the initial setup of your Raspberry Pi, guides you through a number of pranks and secret agent techniques, and then shows you how to apply what you’ve learned out in the real world.
Learn how to configure your operating system for maximum mischief and start exploring the audio, video, and Wi-Fi projects. Learn how to record, listen, or talk to people from a distance and how to distort your voice. You can even plug in your webcam and set up a motion detector with an alarm, or find out what the other computers on your Wi-Fi network are up to. Once you’ve mastered the techniques, combine them with a battery pack and GPS for the ultimate off-road spy kit.
What you will learn from this book Install and configure Raspbian OS for maximum mischief Schedule a prank to happen when your foe least expects it Listen in or talk to people from a distance Detect an intruder with motion detection and set off an alarm Distort your voice in weird and wonderful ways Push unexpected images into browser windows Knock all visitors off your Wi-Fi network Control the Pi with your smartphone Keep your data secret with encryption
A playful, informal approach to using the Raspberry Pi for mischief!
Who this book is written for
Raspberry Pi for Secret Agents is for all mischievous Raspberry Pi owners who’d like to see their computer transform into a neat spy gadget to be used in a series of practical pranks and projects. No previous skills are required to follow along and if you’re completely new to Linux, you’ll pick up much of the basics for free.
Apart from the Raspberry Pi board itself, a USB microphone and/or a webcam is required for most of the audio/video topics and a Wi-Fi dongle is recommended for the networking examples. A Windows/Mac OS X/Linux computer (or second Raspberry Pi) is also recommended for remote network access.
- Paperback: 152 pages
- Publisher: Packt Publishing (April 25, 2013)
- Language: English
- ISBN-10: 1849695784
- ISBN-13: 978-1849695787
- Product Dimensions: 0.3 x 7.4 x 9.1 inches
- Shipping Weight: 9.9 ounces
I spy with Raspberry Pi
Now with this book we’re in for a treat. At least we don’t get the usual starter point of view, and get some trickery instead. The book is very educating on an operating system level. Reading it, I was able to fill some large gaps in my modest but constantly expanding Linux knowledge. Once the reader starts, it quickly becomes clear that the installments built up are simple enough, yet powerful and effective. And I wouldn’t be surprised if such tools are employed in a real-life espionage activities.
The layout of the book is presented to be dead simple. Its significance is another story
After the mandatory introduction of the Raspberry Pi’s basics (in terms of hardware and OS) to the reader in the first chapter, the actual contents related to the main topic begin from the second one. The four sub-topics of the book are respectively: Audio, Video, WiFi and Portable Pi. The simplicity is only on the surface.
Concerning the audio tasks, at first I had a difficulty to set-up a microphone due to my profanity. Without giving the proper attention to all of the Pi’s interfaces I was (wrongfully) thinking that the audio output connector can deliver also an input. After a few lessons learned and a correct setup I was ready to meet some handy tools. Most of the chapter is dedicated to the SoX tool – the working horse of the audio mechanics. Combined with the rest of the tools (some of which are built-in Linux commands) and through the secure shell a lot of possible “spy techniques” are given. Those tools include tmux, espeak and at commands. They’re for running SoX independently of the user’s session, for speech and task-in-time automation respectively.
Apart from the auxiliary elements the main idea is to be shown how the ALSA sound system is employed in the Raspberry Pi, and how easily it can be used for various projects.
Regarding the video tasks, maybe the book was written and released a bit too early, because two weeks ago the guys behind the Raspberry Pi released its own camera, plugged into the dedicated CSI connector. I guess that if written today, this chapter would look a bit different. At least it could include additional information about the Pi camera and its dedicated software tools and capabilities.
Well without that info the chapter is comprised of two main projects – video streaming with recording the stream and detection of moving objects.
For the purpose of the first task the tools related to the framework around the UVC and V4L drivers are used in order to generate a MJPG video stream. The stream then can be accessed on the network by the VLC media player and if necessary recorded by it (without sound of course).
And for the purpose of the second task the very powerful Motion software is shown to easily gather input from even more than one camera.
The chapter about the WiFi networking can make a very nice addition to another of the PACKT’s books, which I reviewed recently – Networking with Raspberry Pi by Rick Golden. Here the tool of the trade is the detection system Kismet. For it to work not only configuration but also building from source is required. And to be preserved consistency between the projects (and between the chapters of the book of course) it is shown a collaboration with SoX for the purpose of attaching sound signals to its processing events.
Further a network mapping is done with Nmap, which leads to the logical next step – to dive into the common (or not so common) network security techniques for attack and/or monitoring with programs like Ettercap and Wireshark.
In the last chapter the Raspberry Pi had to prepare its back-pack, for it was going on a field trip. Regarding the mandatory warnings for battery life, secure and low profile package and most importantly – avoiding any moisture, the portable computer can pretty quickly step outside.
Setting up an ad hoc WiFi network is not difficult following the instructions in this (and partly in the previous) chapter.
Two of the most interesting projects in the book (which I unfortunately haven’t tested yet for some reasons) are the GPS tracking of the Pi in Google Earth, and remote controlling it from a smart-phone while tweeting its current status to the social media. Merely reading through them, they seemed to comprise a powerful, portable setup and just whet one’s appetite for some future projects.
The book aims to teach us how to employ the Raspberry Pi in a set up that is robust, automated and portable. All of these are actually achieved thanks to the software tools built-in or separately added to the Linux operating system. In that sense this could be regarded as the only (although not real) drawback of the book. The small computer is there, but still in the background. Everything described can be done on a regular Linux system’s shell. No wires, no soldering, no bread-boards, no hardware projects. Yet the Pi is most suitable and prepared for taking these actions to the field and in real life situations. So the existing hardware is enough to become the real spy and the book just gives the vision on how prepared it is to do the job.
In conclusion I can say that this book very easily achieves the goal of being funny, informative and deep at the same time.
Great book on RasPi for audio, video and network real scenarios
I won’t list all the details as you can find them in the TOC. All sections in the book explain how to do the experiments it in Mac, Linux and Windows.
After the intro on how to set up the device with a touch of history comes the real thing.
First on Audio: Recording, listening, distortion, voice generation, broadcasting, scheduling the actions. A lot of real world situations to learn the how-to behind it.
Then comes webcam and video wizardry: first check camera possibilities, then capturing the images and showing them using the web server included. Also recording of the video stream. Then comes the “spy” content… Detecting an intruder and setting off an alarm! But why limit to one camera… How to hook more cameras and a security monitoring videowall showing all the streams. After that, turning a TV on and OFF using HDMI or scheduling video recording. Plenty of fun!
After that the so called “Wi-Fi Pranks” gets a little more technical covering network exploration and mapping, wi-fi airspace monitoring, pushing unexpected images into other computer browser windows, using the RasPi as a firewall and analyzing packet dumps.
Then the last part covers how to make your RasPi really portable, autonomous and headless using a battery, a case and wi-fi, bluetooth and GPS USB modules. Setting a point-to-point network between the RasPi and your computer or controlling it with your mobile device using SSH, wi-fi and an app. Or making the RasPi tweet or PM to your profile even with GPS coordinates. After that comes encryption to the game!
Again, I think you’ll enjoy every single page. I did!
Very well done.
Entertaining and Full of Good Information
The requisite intro chapter was short and to the point, giving you just what you needed to know to get started. The inclusion of information related to updating the firmware was a nice touch as I haven’t read about that aspect in too many places.
The chapter on audio for the Raspberry Pi was an unexpected surprise, as it had a wealth of information on ALSA command line information I wish I had months ago when I first started working with the device. I eventually found all the information I needed on the internet back then, but it was nice seeing the pertinent commands right here in this book. It doesn’t go into solving driver issues or anything like that, but it does walk you through it in such a way where it’s not too difficult to make adjustments. This section gets into audio processing, remote connections, audio file formats, creating alias/shortcut commands, and process scheduling. Again, while the context may be a bit contrived, I didn’t see too much fluff in the content.
The third chapter is the video complement to the audio information of chapter two. It gets into determining the capabilities of your USB webcam using UVC, streaming video over HTTP with MJPG-streamer, and saving video with VLC. It then goes into setting up a rudimentary but functional motion based video security system, and controlling your TV using CEC. There isn’t much depth there, but the examples given are easily understandable and are a great jumping off point for doing something more sophisticated.
The fourth chapter gets into monitoring WiFi traffic with Kismet, and then later on using some other tools for doing some network mapping, traffic logging, and packet sniffing. It is presented under the guise of using these tools as a way to protect yourself, essentially using them for good and not for evil. It was a good overview to get you started but not much depth, as one would of course expect from a book this size. Lastly, this chapter introduces you to Wireshark and analyzing network traffic.
The last chapter provides tips on using your Raspberry Pi “unlugged”. It goes into networking tweaks, utilizing GPS data for tracking purposes, encrypting your data, and accessing your RPi from a smartphone via SSH. I was a little surprised that the author didn’t go into any ways of maximizing battery life with the Raspberry Pi in this chapter by shutting down unneeded services and reducing processor useage.
Other than the “secret agent” goofiness (OK I admit it, it *was* kind of fun) this book offers quite a bit of information on configuring peripherals on your Raspberry Pi, performing essential linux system maintenance, and giving you some ideas on how you can use your RPi to capture and/or control the world around you. It was a good read and the information, while maybe a bit lacking in detail at times, was well presented. Bottom line is that if you want to learn how to make more use of audio and video on the Raspberry Pi, or get started with the details of networking in general, this book may be of some help.
Surprises for Would-Be Spies
As I worked through the chapters, there were a series of pleasant surprises. First, Stefan starts with audio and video recording, explaining how to capture conversations at a distance and how to detect motion to start recording. Further, he shows how to package the RasPi for mobile use, covering WiFi mapping, sniffing, and packet dumping, along with GPS, auto twittering, and of course, encryption. Besides explaining how to do these `spy’ activities, Stefan introduces many (nonobvious) tools for the RasPi, such as: ALSA, SoX, Motion, Kismet, Ettercap, Wireshark, GISKismet, ttytter, Coversal/NetIO, and crpytsetup. Finally, Stefan emphasizes the importance of a `sneaky headless’ RasPi, using SSH with a command line interface from a remote Win/Mac laptop. As a spy, he reminds us that your RasPi must be hidden with as few wires as possible. Moreover, the RasPi Linux GUI eats lots of memory and power!
In summary, the book is well motivated (with the spy theme) and well worth the price for RasPi experimenters who push the limits. My only complaint was that the book was too short. I wanted to read more…