Hardware Reference
In-Depth Information
Figure 13-13:
A breadboard
layout for the
wireless receiver
connected to a
Raspberry Pi.
Software
he program in Listing 13-8 will loop and wait until the key-fob button is pressed. When it is
pressed it will poll the door switch, motion detector and temperature sensor and get the latest
picture created by the webcam. You then send an e-mail using the sendemail.py program
you created in Listing 13-4. he status of all the sensors is in the body of the text, and the latest
webcam photo is attached to the e-mail. Every time you press the key fob, an e-mail will be sent.
Listing 13-8 Send E-mail Using a Wireless Remote
#!/usr/bin/env python
“””
Home Automation: send e-mail using wireless remote
For the Raspberry Pi
“””
import os, glob, time, operator
import RPi.GPIO as GPIO
import time
import sys
import smtplib
from email.mime.text import MIMEText
from email.mime.application import MIMEApplication
from email.mime.multipart import MIMEMultipart
Search WWH ::




Custom Search