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

Intermediate level project: An e-mail alert fire alarm


First of all, as in the previous chapter, take three berg wires and connect the LM35 temperature sensor to the BeagleBone board, as per the circuit diagram shown in the following image:

Then we will turn on the BeagleBone board and login to the Linux shell to start coding it.

Open the Python console to learn and test how to send an e-mail using Python:

Our first step will be to import the smtplib into Python, which is the mail transfer protocol library with the predefined function that we will be using in the program.

Next create a variable to store the e-mail ID to which you need to send the e-mail:

Then create the variables where you need to store the e-mail ID and password of the account from which you want to send the e-mail:

Create an SMTP object with a Gmail hostname and port number 587:

EHLO is just like HELO except that the server's response text provides computer-readable information about the server's abilities. The response of this...