O'Reilly logo

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Banana Pro Blueprints

Book Description

Leverage the capability of Banana Pi with exciting real-world projects

About This Book

  • Delve into the expanse of Banana Pi’s self-managing functionalities and develop real-world projects
  • Gain hands-on experience of developing various wireless, multimedia, robotic, and sensor-based applications with Banana Pi
  • Develop your applications using Banana Pi through a project-based approach

Who This Book Is For

This book is designed for those who are interested in exploring the capabilities of Banana Pro. Basic know-how of Linux and embedded systems would be an added advantage.

What You Will Learn

  • Remotely connect to Banana Pro and program the embedded board
  • Use Banana Pro as a hotspot or provide an AirPlay server for wireless audio transmission
  • Find out about the different programming languages that can be used with Banana Pro
  • Build and program your own multimedia centre in order to watch television and movies
  • Connect peripherals such as a camera, LCD, or hard disk to Banana Pro
  • Manage and regulate your Linux system with Banana Pro
  • Stream music wirelessly from your mobile phone to Banana Pro

In Detail

This book follows a tactical plan that will guide you through the implementation of Banana Pro and its configurations. You will then learn the various programming languages used with Banana Pi with the help of examples. In no time at all, you’ll be working on a wireless project that implements AirPlay servers, hotspots, and so on. Following this, you’ll develop a retro-style arcade kiosk game. Then we’ll move on to explore the multimedia features of Banana Pro by designing and building an enclosure for it. After this, you’ll learn to build a remote-controlled smart car and we’ll examine how to control a robotic arm. The book will conclude with the creation of a home sensor system that has the ability to expand or shrink to suit any home.

Style and approach

This book follows a project-based approach that covers the most important features of Banana Pro. Every chapter dives into the practical side of the implementation.

Downloading the example code for this book. You can download the example code files for all Packt books you have purchased from your account at http://www.PacktPub.com. If you purchased this book elsewhere, you can visit http://www.PacktPub.com/support and register to have the code file.

Table of Contents

  1. Banana Pro Blueprints
    1. Table of Contents
    2. Banana Pro Blueprints
    3. Credits
    4. About the Authors
    5. About the Reviewers
    6. www.PacktPub.com
      1. Support files, eBooks, discount offers, and more
        1. Why subscribe?
        2. Free access for Packt account holders
    7. Preface
      1. What this book covers
      2. What you need for this book
      3. Who this book is for
      4. Conventions
      5. Reader feedback
      6. Customer support
        1. Downloading the example code
        2. Downloading the color images of this book
        3. Errata
        4. Piracy
        5. Questions
    8. 1. Introduction to Banana Pro
      1. Banana Pro
        1. Specifications of Banana Pro
        2. Banana Pro onboard LEDs
      2. Getting started
        1. The first boot
      3. Available operating systems for Banana Pro
        1. Android
        2. Linux
          1. The FEX file
          2. Transferring an OS to a hard disk
      4. Add-ons
        1. The LCD module
          1. The 7-inch LCD step-by-step guide
        2. The camera module
          1. A step-by-step guide to the camera module
        3. Cases
        4. GPIO add-ons
        5. An onboard microphone
      5. Summary
    9. 2. Programming Languages
      1. Basic principles
        1. Remote connections
          1. Secure Shell
          2. Using xrdp for remote desktop connection
        2. Basic requirements for programming Banana Pro
          1. Editors
      2. Shell programming
        1. Checking the Banana Pro temperature
        2. Controlling Banana Pro's LEDs from SSH
        3. Programming GPIOs from SSH
          1. Another shell example
        4. WiringBP
      3. Python
        1. The basics
        2. A simple web server
        3. Using Python for GPIO
        4. Setting LEDs in Python
        5. A Python window example
      4. C/C++
        1. The WiringBP C code example
        2. C access to onboard LEDs
        3. Debugger
      5. Scratch
        1. Hello world – example for Scratch
        2. Using LN Digital with Scratch
      6. New kernels
        1. Compiling on Banana Pro
        2. Cross-compilation
      7. Summary
    10. 3. Wireless Projects
      1. OpenVPN
        1. Connecting from Android
      2. WLAN
        1. Setting up WLAN
        2. Setting up an access point mode
      3. On air
        1. The AirPlay protocol
          1. Using an external USB SPDIF soundcard
        2. AirPrint
          1. Configuring CUPS
        3. Printing from Android and iOS
      4. Serving web pages
        1. Installing PHP and MySQL
        2. Installing contao
      5. A measurement server
        1. The FTDI/SPI control of devices
        2. A web server
        3. Explanations
          1. The Python web server
          2. The Python/C interface
          3. C programming
      6. Summary
    11. 4. An Arcade Cabinet
      1. Implementing hardware accelerations
        1. Installing dependencies
          1. Installing modules
          2. Installing packages
          3. Installing a directory
        2. Installing libdri2
        3. Installing libump
        4. Installing the sunxi-mali driver
          1. The X11 version of the sunxi-mali driver
          2. The framebuffer version of the sunxi-mali driver
        5. Installing xf86-video-fbturbo
        6. Getting device permission
        7. Testing hardware acceleration
      2. Implementing libretro emulators
        1. Installing dependent packages
        2. Installing libretro frontend - RetroArch
          1. The X11 version of RetroArch
          2. The framebuffer version of RetroArch
        3. Installing libretro cores
          1. Installing iMAM4ALL libretro core
          2. Installing the SNES libretro core
        4. Configuration
        5. Playing games
          1. Playing a game directly with a command line
            1. iMAM4ALL games
            2. For SNES
          2. Playing a game from the RetroArch menu interface
        6. Testing games
      3. Building PCSX
        1. Installing dependent packages
        2. Installing PCSX
          1. Downloading PCSX ReARMed
          2. Patching
          3. Compiling and installing
          4. Playing PCSX games
        3. Configuration
        4. Testing PCSX games
      4. Making an arcade cabinet for Banana Pro
        1. Preparing the materials
          1. A suitcase
          2. A joystick
          3. A micro USB extended line
          4. A USB hub
          5. An LCD display
          6. An audio extended line
          7. A mini keyboard
        2. Designing a frame
        3. Assembling
          1. Assembling a base frame
          2. Assembling Banana Pro and a joystick
          3. Mounting an LCD
          4. Assembling a top frame
      5. Playing the Banana Pro arcade cabinet
        1. Configuring output to an LCD
        2. Configuring a joystick controller
        3. Playing the game on the arcade cabinet
      6. Summary
    12. 5. A Multimedia Center
      1. Kernel preparation
        1. Adding the I2S audio device
        2. Setting the graphics memory to maximum
        3. Deactivating display driver kernel logging
        4. Activating IR driver key repetition
        5. Activating the sunxi lirc driver
        6. Correcting display driver brightness
        7. Adding the DVB-SKY S960 USB box
        8. Installing the accelerated mali driver
      2. Video Disk Recorder (VDR)
        1. Setting display settings
        2. Setting locales
        3. Adding (non-free) Debian multimedia packages
        4. Loading required modules
        5. A network address
        6. Editing the FEX file
        7. Installing required packages
        8. Installing and patching VDPAU
        9. Compiling VDR
        10. Defining a sound device
          1. Adding a default sound device
          2. Using an electrical SPDIF with Banana Pro
        11. Configuring a remote control
          1. irexec
        12. Adding a USB DVB stick
          1. The DVB kernel driver
          2. The DVB userspace driver
        13. VDR scripts
        14. Adding plugins to VDR
          1. Watching DVDs
          2. Listening to audio CDs
          3. Watching teletext
          4. Changing VDR's skin
          5. Streaming TV to mobile devices
          6. Switching to external players
          7. Additional plugins
        15. Remote controlling the VDR
        16. Troubleshooting
          1. Device permissions
          2. Changing libvdpau version
      3. The Xbox Multimedia Center (XBMC) installation
      4. Summary
    13. 6. Remote Controlling a Smart Monitor Car
      1. Implementing the IP camera
        1. Installing ffmpeg
        2. Installing nginx
        3. Configuring the nginx server
          1. Starting the nginx server
          2. Accessing the nginx server
          3. Autostarting the nginx server at system boot
        4. Setting up a camera
          1. Camera specifications
          2. Connecting the camera module
          3. Testing the camera module on Banana Pro
        5. Streaming a video via the Internet
      2. Setting up the hardware of a smart monitor car
        1. Preparing the materials
          1. A car suite
          2. The L289N motor drive board
          3. Battery
          4. A 5 inch LCD
        2. Assembly
        3. Configuring the display output for the 5 inch LCD
      3. Controlling a smart monitor car using a remote
        1. Webiopi for Banana Pro
          1. Installing webiopi for Banana Pro
          2. Testing webiopi on Banana Pro
        2. Using webiopi to control the car
          1. The control logic
          2. Writing the webiopi controlling code
        3. Adding the car controls to the IP camera web page

      4. Summary
    14. 7. A Laser Engraver
      1. Setting up the frame for laser engraving
        1. Preparing materials
        2. Setting up the laser engraving machine hardware
      2. Configuring software on Banana Pro
        1. Installing dependencies
        2. Installing the GrblController software
      3. Installing software on a PC
        1. Installing Inkscape
        2. Installing Arduino
      4. Loading a program into the laser CPU
        1. Loading bootloader
        2. Loading the driving code
      5. How to use a laser engraver
        1. Generate the G code
        2. Beginning the engraving process
      6. Summary
    15. 8. Scratch – Building a Smart House
      1. Configuring LeScratch
        1. Installing the prerequisites
          1. Setting up the system
          2. Setting up Scratch Mesh
        2. Running LeScratch
      2. Controlling the LeScratch peripherals
        1. General Purpose Input Output (GPIO)
          1. Instructions
          2. Example: The GPIO board
        2. Inter-Integrated Circuit
          1. Instructions
          2. Example – a LN-HUB-32IO USB hub
        3. Serial Peripheral Interface (SPI)
          1. Instructions
          2. Example – LN digital or SPI general
          3. Example: LN Digital (the LNDI commands)
        4. The step motor
          1. Technical specifications
          2. Example – the step motor
        5. Real-time clock
          1. Technical specifications
          2. Example – RTC
        6. The ultrasonic sensor
          1. Technical specifications
          2. Example – the ultrasonic sensor
        7. The humidity and temperature sensor
          1. Technical specifications
          2. Example – the DHT sensor
        8. The sound detect sensor
          1. Technical specifications
          2. Example – the sound detect sensor
        9. The AD/DA converter
          1. Technical specifications
          2. Example – the AD/DA convertor
        10. Photoresistor
          1. Technical specifications
          2. Example – a photoresistor
        11. The touch sensor
          1. Technical specifications
          2. Example – the touch sensor
        12. The tilt sensor
          1. Technical specifications
          2. Example – the tilt sensor
        13. The LCD1602 display
          1. Technical specifications
          2. Example – the LCD1602 display
      3. Building the LeScratch smart house
      4. Summary
    16. Index