Book Image

BeagleBone By Example

By : Pei JIA, Jayakarthigeyan Prabakar, Alexander Hiam
Book Image

BeagleBone By Example

By: Pei JIA, Jayakarthigeyan Prabakar, Alexander Hiam

Overview of this book

BeagleBone is a low cost, community-supported development platform to develop a variety of electronic projects. This book will introduce you to BeagleBone and get you building fun, cool, and innovative projects with it. Start with the specifications of BeagleBone Black and its operating systems, then get to grips with the GPIOs available in BeagleBone Black. Work through four types of exciting projects: building real-time physical computing systems, home automation, image processing for a security system, and building your own tele-controlled robot and learn the fundamentals of a variety of projects in a single book. By the end of this book, you will be able to write code for BeagleBone in order to operate hardware and impart decision-making capabilities with the help of efficient coding in Python.
Table of Contents (17 chapters)
BeagleBone By Example
Credits
About the Author
About the Reviewer
www.PacktPub.com
Preface
Index

Python-Flask on BeagleBone Black


Flask is a Python framework to set up web servers using Python. In this topic, we will look at how we can set up a web server on BeagleBone Black using Python. The first thing we need to do to get started is to install the Python-Flask package on your BeagleBone Black from the Python package index. The steps below will walk you through how you can set up Flask and test it, followed by writing a Python code to interface it with your relay circuit. We will see this in the next topic followed by the main project of controlling an AC bulb from the Internet in the last topic of this chapter:

Step 1: Installing PIP as follows:

  • sudo apt-get install python-pip:

    You should see that it's been already installed, since we have the latest version of Debian installed, and its already available in version. Some of the other versions might not have this, and it will be installed if it's not available, or upgraded if a newer version is available than the one that is installed...