Skip to content
rupa dachere edited this page Mar 21, 2014 · 7 revisions

Welcome to the PiDoorbell wiki!

Note: Always check the README file for the latest updates. The wiki is a nice-to-have and, therefore, lower on the priority list.


 CodeChix PiDoorbell - Home Automation with RaspberryPi with optional Arduino
 codechix.org - May the code be with you...
         2013-2014

  License:             Apache 2.0 (ONF requirement)
  Version:             3.0
  Project/Library:     PiDoorbell
  Description:         Top level README - individual subdirs
                       might also have their own README files
  Assumptions:         You know Python and Linux basics. And you like to fiddle with hardware.
  Testing:             Limited - needs lots of testing
  Authors:             Rupa Dachere

  Main Contact:   rupa@codechix.org
  Alt. Contact:   organizers@codechix.org

 Additional acknowledgements:  Akkana Peck - modifications to the HC_SR04.py script
                       for averaging of sensor readings

This is PiDoorbell version 3.0

Version 1.0 - Supports photos with Arduino Version 2.0 - Supports video/audio clip with Arduino Version 3.0 - Supports GPIO without Arduino - specifically for 2014 tutorial/workshop

Copyright: CodeChix 2013-2014

PiDoorbell was created by Rupa Dachere in January 2013 and went through several revisions (v1-3). This is a live project and is subject to random updates with new features and bugfixes.

License information

PiDoorbell license: Apache 2.0

What’s new in this release?

This is version 3.0 which removes the reliance on the Arduino Uno R3 and connects the proximity sensor directly to the RaspberryPi via GPIO. It still captures photos as well as video/audio clips.

Possible: Use of the Rpi camera module instead of USB camera

Documentation

For the tutorial, take a look at the "Docs" dir/folder.

What software you get and what you need to create

  1. What you get

     You will get the PiDoorbell code that runs on the RaspberryPi and
     connects to the proximity sensor and USB camera so that you can take
     photos or video/audio clips.  This includes
             pidoorbell-recognizer-gpio.py - main code for detection, notification
             send-notifications.py - code to send tweet, sms etc.
             dropbox_uploader.sh - script to upload photo/video to Dropbox
    
  2. What you will need to create/modify

     (a) In order for notifications to be tweeted/sms'd as well as uploading
             of photos/videos, you will need to create accounts on Twitter, Twilio
             and Dropbox.
             You will need to get your API keys and tokens/secrets from each of these services and modify
             the file called "sms_auth_info.py".  This should be in the same dir/folder as (1).
             If you want to use any other service/API, you will need to put the authentication
             tokens and secrets in this file.  Although the filename might indicate sms content, this
             file holds information on all services.  I might change the filename at some point if this
             turns out to be a bit of a stumbling block for people.
    
     (b) You will also need to create a directory to store your video/audio clips to upload
             to Dropbox.  Do:
             "mkdir -p dropbox-pidoorbell; chmod 744 dropbox-pidoorbell"
    
     (c) You will need to get your Dropbox token and add it as the first and only line
             in the following file.  This should be in the same dir/folder as (1).
             dropbox_token.txt
     (d) Download the Dropbox Python SDK and install it.  This is used by the dropbox_uploader.sh
             script to upload and share the file/url.
    

How to run PiDoorbell from the command line

Assuming you've cloned the repo and have all necessary packages installed (see Dependencies) and have read & followed the documentation, you should be able to run pidoorbell as follows:

  1. sudo python ./pidoorbell-recognizer-gpio.py -i

  2. If you want to adjust the latency to account for slow bandwidth when uploading to Dropbox, append the latency value to the end of the command like:

     "sudo python ./pidoorbell-recognizer-gpio.py -i <latency_value>"
    
     Note that the default latency is 20 seconds.
    

Web sites

https://github.com/codechix/pidoorbell http://codechix.github.io/PiDoorbell - web page

Bug report

  1. There is a bug with the sequential count (noise tolerance) where the count isn't tracked

Supported systems

Wheezy Raspbian - any release since Dec. 2012 USB camera - Logitech c270, c210 Arduino Uno R3 HC-SR04 sonar proximity sensor Dropbox, Twilio, Twitter

Dependencies

  1. Dropbox Python SDK (1.5.1 and up)
  2. sudo apt-get install python-rpi.gpio
  3. Install Twilio SDK
  4. Install Dropbox SDK (1.5.1 or higher)
  5. Install python-twitter package
  6. Install GIT if it isn't there - sudo apt-get install git
  7. sudo apt-get install pip pyserial
  8. For photos, use fswebcam (should already be installed) or uvccapture
  9. For video/audio, use ffmpeg (you can also try pyffmpeg - I haven't tried it).
  10. Download dropbox_uploader.sh sript - https://github.com/andreafabrizi/Dropbox-Uploader. Please give him some money - he's done a great job.

ToDo

  1. Documentation on how to setup and run on Windows
  2. Web-ize configuration and running PiDoorbell from a GUI
  3. Fix bugs
  4. Update code to handle photo + video/audio via command line argument
  5. Audio notification to visitor when they are detected - welcome message
  6. Two-way video/audio
  7. PiDoorbell Mobile app

Distribution structure

  1. Main directory with README pidoorbell-recognizer.py send_notifications.py sms_auth_info.py - you will have to create this. See Doc. dropbox-uploader.sh

  2. Subdirectories dropbox-pidoorbell - stores video/audio clips to upload to Dropbox Docs - Additional documentation and tutorial, slides

Contributors

All contributors are members of: CodeChix http://www.codechix.org/ https://github.com/codechix https://github.com/rdachere http://shallowsky.com

Sorted by last name:

Dachere, Rupa - rupa@codechix.org Peck, Akkana - akkana@gmail.com