Book Image

Raspberry Pi Blueprints

Book Image

Raspberry Pi Blueprints

Overview of this book

Table of Contents (17 chapters)
Raspberry Pi Blueprints
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Deploying web applications


Next, we will deploy the web application that will allow us to control the arm and chassis remotely and view the video stream from the Pi camera. Since this web application is also built using the Flask framework, the process of deploying it will again be similar to that used in the previous chapters.

Before we start, be sure to copy the config_files and robot_arm_webapp directories from the project files to the /home/pi directory on the Pi:

  1. First, we will install the required packages and libraries, including the RPIO Python library used to control the GPIO pins from Python:

    sudo apt-get update
    sudo apt-get upgrade
    sudo apt-get install python-pip git python-dev gunicorn supervisor nginx
    sudo pip install RPIO
    
  2. Next, download and install the Flask framework:

    git clone https://github.com/mitsuhiko/flask.git
    cd flask
    sudo python setup.py install
    cd
    
  3. Now, copy the Nginx configuration and perform the configuration self-test:

    sudo cp config_files/nginx/robot_arm.conf /etc...