/pi-spy

Primary LanguageJavaScriptMIT LicenseMIT

Pi Spy Logo

GitHub license Build Passing

Table of Contents

  1. About The Application
  2. How To Install
  3. How To Use
  4. Necessary Hardware
  5. User Sign Up
  6. User Sign In
  7. Accessing Surveillance Footage
  8. Deleting Surveillance Footage
  9. Pi Spy Dependencies
  10. How To Report Bugs or Issues
  11. Credits And Thanks
  12. Upcoming Features
  13. FAQs

About the Application

Pi Spy is a user-based, motion-activated video security and surveillance system built using Raspberry Pi using MotionEye and Google Drive. Users can create an account, sign in, and either live view or record via a preset USB camera. Files from the camera are stored on a user's Google Drive account.

For required hardware to use application, see the Necessary Hardware section. For required dependencies for use of the Pi Spy project, see the Pi Spy Dependencies section. For all other questions, see the FAQs section.

How To Install

To install the Pi Spy API, either clone the repository and install all package.json dependencies, or fork, clone, and install all dependencies.

In order to use our app, you will also need to configure hardware such as the camera and Raspberry Pi, listed in our Necessary Hardware section. We recommend using the PiUpMyLife tutorial to set up your Pi and associated hardware components.

Finally, you will need to set up (or use a prexisting) Google Drive account, where the Raspberry Pi will store video and/or still images from the camera.

How To Use

After all hardware is in place, sign up for a user account with Pi-Spy. Next, authenticate your Google Drive account so your Raspberry Pi can store files there.

Google supports OAuth 2.0 that will request you to sign in with your Google Drive account. From there it will dispense you a token to enter into the Pi-Spy UI. From now on your Drive and Pi-Spy Device will be connected.

Once Google Drive authentication has taken place and you have signed in, your camera will begin to stream live. To end stream, simply sign out or shutdown your camera. Once a user signs out, the stream will be captured, and pushed to the Google Drive account you specified. Pi-Spy will also notify you via email if there is movement in front of the camera.

You can easily name your file streams, but it will default to the time the stream started, and appear in a folder for the day. For more information on creating a user account and signing in, see the following sections User Sign Up and User Sign In.

Necessary Hardware

Raspberry Pi

Raspberry Pi Camera or USB WebCam

Power Supply

SD Card (8 GBs recommended) or Micro SD Card if using a Raspberry Pi 2, 3, or B+

Ethernet Cord or WiFi Dongle

Raspberry Pi Case(Optional)

We recommend assembling your hardware using the PiUpMyLife tutorial.

How Hardware Integrates with Google Drive via Use Case Example

In the below graph, a user has signed in and placed their camera next to a precious bag of Doritos. When their hungry roommate nears the bag, the Raspberry Pi (using MotionEye) senses the movement and generates a .mp4 video. This video is stored internally on the Pi and then uploaded to Google Drive in a matter of seconds. Using our front-end website, the user is able to see the hungry roommate video and take action to protect their Doritos.

A graphical interpretation of the above use case:

user sign up process

User Sign Up

Code example:

http POST :3000/api/signup name=harry username=potterman123 password=lumos email=harry@hogwarts.com

To create a user, certain parameters are required. Your name, a user name, your email address, and a password are all required. Optional fields include an address, phone number, status, user profile description, user icon, and a joined date.

Your account will be assigned an ID for file storage purposes. For your security, all passwords are masked and hashed. After successful user account creation, a user can sign in and begin their camera. For instructions on user sign in, please refer to the next section.

A graphical interpretation of the User sign up process: user sign up process

User Sign In

Code example:

http GET localhost:3000/api/signin/potterman123

To sign into your account, simply enter your email and password into the appropriate fields. Example below.

A graphical interpretation of the User sign in process: user sign up process

Accessing Surveillance Footage

Once a user signs in, the camera will instantly start up. To access previous footage, simply visit the front-end website (to be located at www.pispy.services/ in the future), which displays the files via Google Drive's Picker.

Deleting Surveillance Footage

To delete footage, simply delete it using tools available on the front-end through Google Drive's Picker.

Pi Spy Dependencies

A list of all the Node Package Manager (npm) dependencies used to create Pi Spy, with a short description and links to the documentation.

Developer Dependencies

  • debug : A dependency used to catch errors in the creation of Pi Spy. If a user wants to contribute to solving issues for Pi Spy, it's suggested you fork our repository, and use debug to help us find where the issues stem from. For my information on contributing to Pi Spy, see the "How To Report Bugs or Issues" section.

  • eslint : A linting tool used to evaluate our code to catch any syntax errors. It is heavily suggested to use this if you plan to contribute to our code. For my information on contributing to Pi Spy, see the "How To Report Bugs or Issues" section.

  • faker : A dependency used to create users with fake information, used in our testing environment.

  • jest : Our dependency for our testing environment.

  • superagent : An additional dependency for our test environment. It is used to fire off our servers with a test connection to see if our users can properly access their camera.

Dependencies

How To Report Bugs or Issues

Bugs and Issues can be reported through our GitHub repository located at https://github.com/arn1313/pi-spy/issues. To create a new issue, simply click the green "New Issue" button, and add a description of the issue or bug, with a method for replication if possible. If you want to contribute to the project, feel free to fork our repository and create a pull request, which will be reviewed by one of our team members. You will be credited for your contributions in our "Credits And Thanks" section of this README.

Credits And Thanks

Credits for this project idea are courtesy of https://pimylifeup.com/. Without their incredible tutorials and walk through, this project would not have been possible. Please support their page and contribute to their success! A special thanks to Scott Schmidt, for pointing out this project and giving us the opportunity to work with hardware. Thank you to Katherine for helping us with tests!

Upcoming Features

Features that Team Pi Spy would like to continue working on are..

  • Email notification! Set up your camera to operate through motion sensors and if any videos are created, you will receive an email notification after file creation.

FAQs

Why did we choose to build this project? We chose to do this project based on our mutual fascination with the Raspberry Pi hardware and a desire to challenge ourselves.

What languages are used in this project? Our code is written in JavaScript, although the setup files we used for the Raspberry Pi uses C, Python, and others.

How long did it take your team to construct this app? This app took about 4 days to build.

Who is this app designed for? We envision this as an app for the casual user who wants to surveil their home or desk and try out a fun project for Raspberry Pi. This app is probably unsuitable for professional surveillance use. We do not condone using this app for any kind of illegal surveillance activities.

What is the file format for videos? Video is uploaded in mp4 file format.

Do I need a Google Drive account to use this app? Yes. Because this app stores the web camera's video files in Google Drive, you will need an account.

Who built this app? Our team is comprised of 4 talented (and hireable!) developers:

  • Aaron:

LinkedInProfile View My Github

Aaron

Aaron moved to Seattle from San Francisco in 1999. He worked in retail and bank management for many years but transitioned into a role as an Office Manager and Paralegal in 2012. During that time he assisted on several high profile lawsuits including the Oso Land Slide case in Snohomish County. Earlier this year he decided that he needed a change and a career more inline with the direction Seattle has been moving. This led him to Code Fellows and a future in tech.

  • Michelle:

LinkedInProfile View My Github

Michelle

Michelle Scharlock is a Full Stack Javascript developer, interested in becoming a Technical Program Manager. A strategic thinker and planning powerhouse, she brings insight to the surface and translates dev-speak for the non-technical. Along with being fluent in JavaScript, Michelle speaks French, German, and Italian thanks to her background as an opera singer. In her spare time (ha!), she can be found hunting for antiques, taking ukulele lessons, and writing plays. Insatiably curious, she is probably raiding your local library right this minute.

  • Shaun:

LinkedInProfile View My Github

Shaun

Shaun is finishing Full-Stack Javascript Certificate at the Code Fellows Dev Bootcamp. He is currently working on supplementing his education through free-lance work and self-study. Web services and development are two of his passions, meaning he can work on anything from the back end of a web solution (NodeJS) to the front end (HTML, CSS, Javascript). When not coding, he can be found enjoying his homemade churros, traveling, motorcyling, or giving wine tasting classes.

  • Zach:

LinkedInProfile View My Github

Zach

Zach is a software developer, and former Army medic with a passion for learning and a track record of absorbing new information in a short amount of time. A positive team player, he enjoys tackling challenges with other people. Most recently, he began working on "Project Valor," a website which helps veterans find healthcare services nearest to them with the shortest wait time to see a doctor or mental health professional.

Are you obscenely proud of this project? Yes, yes we are. 🏆