Chapter 6. Raspberry Pi as a Personal Assistant

In this project, we will build a tool using Raspberry Pi that acts as a personal assistant. This project presents ideas to overcome difficulties encountered in our day-to-day lives (for example, keeping track of daily appointments, paying bills on time), overcome procrastination, or ease our routine stress inducing activities by automating them.

Mission briefing

In this project, we build something that helps in simplifying our day-to-day activities, ease our burden in performing mundane tasks, and remind us about important appointments/tasks as well as tracking them. We will work on implementing a solution for each possible scenario (for example, we will implement a solution to check e-mails and review a solution to create an alert for a new e-mail).

Why is it awesome?

We do our best to be successful in our career and lead a healthy lifestyle. While writing this book, we had to come up with a plan to overcome our procrastination and track our tasks effectively (especially, delivering the drafts of each project on time!).

Your objectives

In this project, we will accomplish the following:

  • Setting up the e-mail feed parser
  • Setting up the parser for reminders and events
  • Designing an enclosure for the personal assistant
  • Setting up the assembly for the dish monitor
  • Setting up sensors for the key alert system

Mission checklist

In this task, we will work on installing all tools and Python modules used in this project:

  1. Before we start installing the tools required for this project, if necessary, you can update the repositories and package lists as follows:
    sudo apt-get update
    
  2. We will start with installing python-feedparser. We used the python-feedparser tool in the previous project and created e-mail alerts for the water fountain. If you skipped the previous project, the tool can be installed as follows:
    sudo apt-get install python-feedparser
    
  3. We will use Google Calendar to organize events and appointments as an example. We need to install the python-gdata tool to make use of the Google APIs:
    sudo apt-get install python-gdata
    
  4. Another important tool required for this project is OpenCV (http://opencv.org/). OpenCV is an open source computer vision framework developed by Intel. OpenCV is widely used by researchers and hobbyists in applications such as object recognition, machine vision applications such as component inspection on a manufacturing line, and more.

    Note

    It is important to know that it takes at least four hours to finish the compilation of OpenCV.

    • The installation procedure for OpenCV on the Raspberry Pi has been borrowed from http://mitchtech.net/raspberry-pi-opencv/ and the OpenCV installation guide for Linux (http://docs.opencv.org/doc/tutorials/introduction/linux_install/linux_install.html).
    • Before we get started with the installation process, the dependencies for OpenCV need to be installed. The dependencies can be installed using the following shell script available along with this project:
      sh OpenCVInstall.sh
      
    • Once the dependencies have been installed, we can get started with the OpenCV installation. The source files to install OpenCV can be downloaded from http://sourceforge.net/projects/opencvlibrary/files/opencv-unix/2.4.10/opencv-2.4.10.zip.
    • We need to extract the downloaded source:
      unzip opencv-2.4.10.zip
      
    • The next step is the makefile generation using CMake. The library has to be compiled with Python support that enables application development using a Python script library and support.
      cd opencv-2.4.5
      mkdir build
      cd build
      cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local -D BUILD_NEW_PYTHON_SUPPORT=ON -D BUILD_EXAMPLES=ON
      
    • Once the makefile has been generated successfully, OpenCV can be built and installed as follows:
      make
      sudo make install
      
    • Once the library has been installed, we need to test whether the installation was successful by executing one of the Python samples available in OpenCV:
      cd ~/opencv-2.4.5/samples/python
      python delaunay.py
      
    • If the installation was successful, we should able to launch the Delaunay triangulation sample.
      Mission checklist

      Delaunay triangulation – OpenCV

  5. Now that we have installed OpenCV, we will proceed to build our project over the forthcoming tasks of the project.
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
52.14.174.132