Banana Pi Cookbook
()
About this ebook
- Design, develop, and customize real-world applications and projects rapidly and easily using Banana Pi
- Quick solutions to the most common real-world problems on the amazing Banana Pi
- Step-by-step recipes to help you experience the vast possibilities of the device by setting up interesting applications
This book is intended for anybody who wants to learn how they can utilize the capabilities of the Banana Pi to its full potential. It's full of step-by-step guides and detailed descriptions for the whole range of possibilities in a language that is appropriate for computer enthusiasts and experts alike. It would be helpful to have a basic knowledge of Unix-like operating systems or programming, but no prior experience is required as every concept is explained in the appropriate sections.
Related to Banana Pi Cookbook
Related ebooks
Learning Raspbian Rating: 5 out of 5 stars5/5Raspberry Pi By Example Rating: 0 out of 5 stars0 ratingsRaspberry Pi Server Essentials Rating: 0 out of 5 stars0 ratingsBuilding a Home Security System with Raspberry Pi Rating: 0 out of 5 stars0 ratingsManage Partitions with GParted How-to Rating: 5 out of 5 stars5/5Programming the BeagleBone Rating: 0 out of 5 stars0 ratingsRaspberry Pi Super Cluster Rating: 0 out of 5 stars0 ratingsInstant Optimizing Embedded Systems Using BusyBox Rating: 0 out of 5 stars0 ratingsPuppet Cookbook - Third Edition Rating: 5 out of 5 stars5/5Raspberry Pi 3 Projects for Java Programmers Rating: 0 out of 5 stars0 ratingsBeagleBone Essentials Rating: 0 out of 5 stars0 ratingsAndroid for the BeagleBone Black Rating: 0 out of 5 stars0 ratingsRaspberry Pi for Python Programmers Cookbook - Second Edition Rating: 0 out of 5 stars0 ratingsBeagleBone Black Cookbook Rating: 0 out of 5 stars0 ratingsRaspberry Pi 3 Project: Raspberry Pi 3 for Beginners Rating: 0 out of 5 stars0 ratingsFlash Development for Android Cookbook Rating: 3 out of 5 stars3/5Raspberry Pi Cookbook for Python Programmers Rating: 0 out of 5 stars0 ratingsRaspberry Pi: Amazing Beginners Guide on How to Start Using Raspberry Pi Rating: 0 out of 5 stars0 ratingsMastering BeagleBone Robotics Rating: 5 out of 5 stars5/5Learning Raspberry Pi Rating: 0 out of 5 stars0 ratingsGetting Started with Raspberry Pi: Program Your Raspberry Pi! Rating: 4 out of 5 stars4/5SignalR Realtime Application Cookbook Rating: 0 out of 5 stars0 ratingsInternet of Things with Arduino Cookbook Rating: 1 out of 5 stars1/5Raspberry Pi Gaming - Second Edition Rating: 0 out of 5 stars0 ratingsWorking with Linux – Quick Hacks for the Command Line Rating: 5 out of 5 stars5/5Instant Debian - Build a Web Server Rating: 0 out of 5 stars0 ratingsAdvanced Home Automation Using Raspberry Pi: Building Custom Hardware, Voice Assistants, and Wireless Nodes Rating: 0 out of 5 stars0 ratingsLearn Raspberry Pi Programming with Python: Learn to Program on the World's Most Popular Tiny Computer Rating: 0 out of 5 stars0 ratingsGoogle Home User Manual: Beginner's Guide to Start Using Google Home Like a Pro! Rating: 0 out of 5 stars0 ratingsFearless Experiments With Microcomputers Rating: 0 out of 5 stars0 ratings
Hardware For You
iPad and iPad Pro For Dummies Rating: 0 out of 5 stars0 ratingsTI-84 Plus CE Graphing Calculator For Dummies Rating: 0 out of 5 stars0 ratingsTor Darknet Bundle: Master the Art of Invisibility Rating: 0 out of 5 stars0 ratingsiPhone Photography: A Ridiculously Simple Guide To Taking Photos With Your iPhone Rating: 0 out of 5 stars0 ratingsCompTIA A+ Complete Review Guide: Core 1 Exam 220-1101 and Core 2 Exam 220-1102 Rating: 5 out of 5 stars5/5Comprehensive Guide to Personal Cybersecurity: Personal Cybersecurity Practices for a Safer Digital Life Rating: 0 out of 5 stars0 ratingsUsing the TI-84 Plus Rating: 0 out of 5 stars0 ratingsiPhone 14 Pro Max User Guide for Beginners and Seniors Rating: 0 out of 5 stars0 ratingsCompTIA A+ Complete Review Guide: Exam Core 1 220-1001 and Exam Core 2 220-1002 Rating: 5 out of 5 stars5/5Incredible iPad Apps For Dummies Rating: 3 out of 5 stars3/5Programming Arduino: Getting Started with Sketches Rating: 4 out of 5 stars4/5Unlock Any Roku Device: Watch Shows, TV, & Download Apps Rating: 0 out of 5 stars0 ratingsBuild Your Own PC Do-It-Yourself For Dummies Rating: 4 out of 5 stars4/5Upgrading and Fixing Computers Do-it-Yourself For Dummies Rating: 4 out of 5 stars4/5Computer Science: A Concise Introduction Rating: 4 out of 5 stars4/5Dancing with Qubits: How quantum computing works and how it can change the world Rating: 5 out of 5 stars5/5Computer Organization and Design: The Hardware / Software Interface Rating: 4 out of 5 stars4/53D Printing For Dummies Rating: 4 out of 5 stars4/5Raspberry Pi for Secret Agents - Second Edition Rating: 3 out of 5 stars3/5iMac For Dummies Rating: 0 out of 5 stars0 ratingsMastering ChatGPT Rating: 0 out of 5 stars0 ratingsSo you want to build a computer... Rating: 5 out of 5 stars5/5How to Hack Like a GOD: Hacking the Planet, #2 Rating: 5 out of 5 stars5/5Raspberry Pi Electronics Projects for the Evil Genius Rating: 3 out of 5 stars3/5Laptops All-in-One For Dummies Rating: 4 out of 5 stars4/5Raspberry Pi Cookbook for Python Programmers Rating: 0 out of 5 stars0 ratings
Reviews for Banana Pi Cookbook
0 ratings0 reviews
Book preview
Banana Pi Cookbook - Ryad El-Dajani
Table of Contents
Banana Pi Cookbook
Credits
About the Author
About the Reviewers
www.PacktPub.com
Support files, eBooks, discount offers, and more
Why Subscribe?
Free Access for Packt account holders
Preface
What this book covers
What you need for this book
Who this book is for
Sections
Getting ready
How to do it…
How it works…
There's more…
See also
Conventions
Reader feedback
Customer support
Downloading the example code
Downloading the color images of this book
Errata
Piracy
eBooks, discount offers, and more
Questions
1. Installation and Setup
Introduction
Banana Pi Overview
Operating systems for the Banana Pi
Android
Linux
Downloading an operating system for the Banana Pi
Getting ready
How to do it…
See also
Setting up the SD card on Windows
Getting ready
How to do it…
Writing an Android image to the SD card on Windows
Writing a Linux distribution image to the SD card on Windows
How it works…
See also
Setting up the SD card on Linux
Getting ready
How to do it…
How it works…
See also
Booting up and shutting down the Banana Pi
Getting ready
How to do it…
Booting up
Shutting down Android
Shutting down Linux
How it works…
See also
2. Administration
Introduction
Determining the IP address and hostname
Getting ready
How to do it…
How it works…
There's more…
Connecting via SSH on Windows using PuTTY
Getting ready
How to do it…
How it works…
There's more…
See also
Connecting via SSH on Unix-like systems
Getting ready
How to do it…
How it works…
There's more…
See also
User maintenance
Getting ready
How to do it…
Adding a new user
Setting a password for a user
Deleting a user
How it works…
There's more…
See also
Searching, installing, and removing the software
Getting ready
How to do it…
Searching for packages
Installing a package
Removing a package
How it works…
There's more…
See also
Updating the operating system
Getting ready
How to do it…
How it works…
There's more…
Wireless network on the Banana Pro
Getting ready
How to do it…
Loading the ap6210 module
Configuring the wireless network with WiFi Config
Configuring the wireless network manually
How it works…
There's more…
3. External Disks
Introduction
Mounting a USB drive
Getting ready
How to do it…
How it works…
There's more…
See also
Mounting an SSD or HDD via SATA
Getting ready
How to do it…
How it works…
Mounting via fstab
Getting ready
How to do it…
How it works…
There's more…
See also
Booting from an external disk
Getting ready
How to do it…
Formatting the drive
Copying the root filesystem and editing uEnv.txt
How it works…
See also
4. Networking
Introduction
Sharing files over the network via Samba
Getting ready
How to do it…
Installing the Samba server
Accessing the Samba share on Windows
Accessing the Samba share on Linux manually
Accessing the Samba share on Linux using fstab
How it works…
There's more…
See also
Setting up a web application
Getting ready
How to do it…
Installing the Nginx web server
Installing the PHP scripting language
Installing the MySQL database server
Installing WordPress
How it works…
There's more…
Setting up PhpMyAdmin
Other technologies
See also
Securing the Nginx web server using SSL
Getting ready
How to do it…
Creating the certificate
Configuring Nginx to use an SSL certificate
How it works…
There's more…
Importing a self-signed certificate on Windows
Importing a self-signed certificate on Linux
See also
Synchronizing files over the Internet
Getting ready
How to do it…
Setting up a Dynamic DNS
Updating the Dynamic DNS hostname
Setting up a port forwarding
Installing ownCloud
How it works…
There's more…
See also
Controlling the desktop remotely using VNC
Getting ready
How to do it…
Installing the VNC server on the Banana Pi
Installing and using a VNC client on Windows
Installing and using a VNC client on Linux
How it works…
There's more…
Adding a SSH tunnel for VNC in PuTTY
Using an SSH tunnel for VNC on Linux
See also
Securing SSH using SSH keys
Getting ready
How to do it…
Using SSH keys in PuTTY
Using SSH keys on Linux
Disabling the SSH password login on the Banana Pi
How it works…
See also
Setting up a UPnP media server
Getting ready
How to do it…
How it works…
There's more…
See also
5. Using the GPIO Pins
Introduction
Lighting up an LED using the gpio command
Getting ready
How to do it…
How it works…
There's more…
The Banana Pi pin layout
The Banana Pro pin layout
Using a GPIO extension board
See also
Programming the LED
Getting ready
How to do it…
Programming the LED with C
Programming the LED with Python
How it works…
Explaining the C code
Explaining the Python code
Using the GPIO input with a pushbutton
Getting ready
How to do it…
Preparing the circuit
Programming the software
How it works…
Explaining the C code
There's more…
See also
6. Multimedia
Introduction
Configuring the audio device
Getting ready
How to do it…
Configuring HDMI pass-through
Configuring analog audio
Testing the audio output
How it works…
There's more…
See also
Getting accelerated video playback
Getting ready
How to do it…
Preparing the building of the required components
Building and activating the hardware-accelerating components
Installing and configuring MPlayer
Installing and configuring VLC media player
How it works…
There's more…
See also
Setting up Kodi
Getting ready
How to do it…
How it works…
There's more…
See also
Setting up an infrared remote control using LIRC
Getting ready
How to do it…
Configuring LIRC to recognize the remote control
Controlling applications using the remote control
How it works…
There's more…
See also
Index
Banana Pi Cookbook
Banana Pi Cookbook
Copyright © 2015 Packt Publishing
All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews.
Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the author, nor Packt Publishing, and its dealers and distributors will be held liable for any damages caused or alleged to be caused directly or indirectly by this book.
Packt Publishing has endeavored to provide trademark information about all of the companies and products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this information.
First published: June 2015
Production reference: 1240615
Published by Packt Publishing Ltd.
Livery Place
35 Livery Street
Birmingham B3 2PB, UK.
ISBN 978-1-78355-244-3
www.packtpub.com
Credits
Author
Ryad El-Dajani
Reviewers
José Manuel Cerrejón González
Kenny Hsu
Michał Piątkowski
Commissioning Editor
Priya Singh
Acquisition Editor
Sam Wood
Content Development Editor
Arwa Manasawala
Technical Editor
Pankaj Kadam
Copy Editor
Laxmi Subramanian
Project Coordinator
Shweta H. Birwatkar
Proofreader
Safis Editing
Indexer
Rekha Nair
Production Coordinator
Manu Joseph
Cover Work
Manu Joseph
About the Author
Ryad El-Dajani is a software engineer and passionate technology enthusiast. He developed an interest in computers when he was 10 years old. Soon thereafter, he began to learn his first programming languages.
After he had completed his training as an IT specialist, he worked on several e-commerce Internet projects. Currently, he is studying business computing and works for a big IT company in Germany, realizing various IT projects based on Java or .NET technologies.
Besides the classic application development, he has professional experience in realizing projects based on web frameworks such as Spring, Play, Symfony, eZ Publish, and Magento. Moreover, he has been excited about all kinds of Unix-like embedded systems since the revolutionary SheevaPlug.
I would like to thank my family for their support during the authoring of this book. Special thanks go to my grandpa, Jürgen, and my uncle, Thomas, who introduced me into the world of computers against the wishes of my parents when I was a child.
Furthermore, I would like to thank the Internet community for spreading their knowledge. Without amazing guys like you, I would have never been able to understand and, in the end, write about the complex technologies surrounding us today.
I am particularly grateful to my beloved girlfriend, Marlene. Without her infinite support, patience, understanding, and cooking skills, I would not have been able to complete this project.
About the Reviewers
José Manuel Cerrejón González is a full-stack freelance software developer based in Huelva, Spain, and a Raspberry Pi, Odroid, and Banana Pi enthusiast. Nowadays, he blogs regularly on his own website at http://misapuntesde.com/ in both Spanish and English, and he has compiled a great Raspberry Pi resource on Google Docs at http://goo.gl/Iwhbq.
He has also contributed to the community with a project called PiKISS (Pi Keeping It Simple, Stupid!) that you can download from GitHub (https://github.com/jmcerrejon/PiKISS).
Although this is the first book he has reviewed, he has written other articles for the press, such as ODROID Magazine.
You can follow him on Twitter at https://twitter.com/ulysess10.
To my daughter, Laura: I hope to see your smile every morning for a long time.
Kenny Hsu is a Linux system administrator, database administrator, and web developer who has over 7 years of experience. He has executed projects in a broad range of technologies, including Java, Spring Framework, jQuery, MySQL, MariaDB, Ubuntu, Debian, and so on. He is also an open source contributor. This year, he has written some dev board-related tutorials for beginners (who are interested in Banana Pi, Cubieboard, and OpenWRT router), in Chinese. He is also a native Chinese speaker residing in Taiwan.
Some of the tutorials he wrote earlier this year are as follows:
OpenWRT wr841n mod (https://github.com/annbigbig/wr841nd-memo)
Cubian memo (https://github.com/annbigbig/cubian_memo)
If you can speak Chinese, you can interact with him directly in Chinese. He would be very glad to talk to you. You can follow him on Twitter at @annbigbig and you can also e-mail him at <annbigbig@gmail.com>.
This is my first book with Packt Publishing, and I am very glad to meet you.
My dear kitten called PaPa passed away in summer 2013. He was a 17-year-old white Persian kitten, and I will always miss him.
Michał Piątkowski is a young freelancer, who always tries to develop his potential. Although he mainly programs in Java, he is also interested in C and C++, especially where microcontrollers are concerned. Moreover, he is fascinated by Banana Pi and Raspberry Pi projects. He devotes his spare time to robotics and electronics. On the Internet, he can be found as Axandar or @Axandar29 on Twitter.
www.PacktPub.com
Support files, eBooks, discount offers, and more
For support files and downloads related to your book, please visit www.PacktPub.com.
Did you know that Packt offers eBook versions of every book published, with PDF and ePub files available? You can upgrade to the eBook version at www.PacktPub.com and as a print book customer, you are entitled to a discount on the eBook copy. Get in touch with us at
At www.PacktPub.com, you can also read a collection of free technical articles, sign up for a range of free newsletters and receive exclusive discounts and offers on Packt books and eBooks.
https://www2.packtpub.com/books/subscription/packtlib
Do you need instant solutions to your IT questions? PacktLib is Packt's online digital book library. Here, you can search, access, and read Packt's entire library of books.
Why Subscribe?
Fully searchable across every book published by Packt
Copy and paste, print, and bookmark content
On demand and accessible via a web browser
Free Access for Packt account holders
If you have an account with Packt at www.PacktPub.com, you can use this to access PacktLib today and view 9 entirely free books. Simply use your login credentials for immediate access.
Preface
Packed with recipes for the Banana Pi, solving the most common real-world problems, viewers get a practical assistance to avoid difficulties.
Full of supportive guides, this book is designed to help you build and expand your device into a versatile box. Any computer enthusiast can quickly learn how to become a Banana Pi expert, while not requiring skills in programming or Linux. Banana Pi Cookbook will allow you to use the technology start from the very beginning, through the daily usage and maintenance, up to setting up a WordPress from scratch, sharing files using Samba or ownCloud, blinking an LED, or playing 1080p videos.
What this book covers
Chapter 1, Installation and Setup, introduces the Banana Pi device. It also explains which distributions are available and how to download and install a Linux distribution. Moreover, we present Android as a contrast to our upcoming Linux adventure.
Chapter 2, Administration, introduces the reader to the most common tools to administrate their fresh Linux installation. We will connect remotely using SSH from Windows (using PuTTY) and Linux (using the command-line SSH application). Besides user modification (adding a new user, changing passwords, and so on), we will also cover basic maintenance tasks, such as searching and installing a new software, updating the system using the distributions package manager, and so on.
Chapter 3, External Disks, covers all about external disk drives. We will connect and mount USB drives and HDD drives using the SATA interface and explore the possibility of switching the root filesystem to and boot from an external drive.
Chapter 4, Networking, presents recipes for common networking tasks using the Banana Pi. One of the key strengths of the device is the fast Ethernet and wireless (Banana Pro) adapters it provides—especially combined with the fast SATA interface—which is the base of powerful network applications.
Chapter 5, Using the GPIO Pins, introduces the GPIO pins. We will