Skip to content

ravangen/Wilson-Cam

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Wilson Cam

Capture an image from a webcam and upload to Dropbox.

About

This project is named after Wilson, a red-eared slider turtle adopted from Little RES Q several years ago. I currently use it to take pictures of my pet turtle.

Wilson

Equipment

All components used are older versions and can easily be replaced by something newer.

NOTE: Since I only have a small memory card, the system boot happens using the memory card with BerryBoot, and the operating system is mounted from the USB drive.

Hardware

Software

Setup

  1. Using your computer, install BerryBoot onto the SD Card (see http://www.berryterminal.com/doku.php/berryboot)
  2. Assemble the Raspberry Pi and power on
  3. Place SD Card in slot
  4. Plug the USB drive in one USB slot
  5. Plug the USB hub into the other USB slot
  6. Connect any additional USB devices into the hub (e.g. keyboard, mouse, webcam, wifi adapter)
  7. Connect a monitor with a HDMI cable
  8. Connect to the internet with an ethernet cable
  9. Connect to power
  10. Install Jessie Raspbian to the USB drive using BerryBoot
  11. Configure wireless adapter to connect to wifi so that a wired connection is not necessary
  12. git clone https://github.com/ravangen/Wilson-Cam.git this repository and cd Wilson-Cam
  • The instructions assume you are cloning to $HOME (~, the default directory)
  1. Install python package dependencies: pip install -r requirements.txt
  2. Create a Dropbox app at https://www.dropbox.com/developers/apps/create using the "Dropbox API", "App Folder" access type, and an app name of your choice
  3. Open this new Dropbox app and generate a OAuth 2 access token to be used to upload the image
  • Keep this value secret, anyone can view/edit your files in the app folder with this token
  1. Generate an image by running DROPBOX_TOKEN=<YOUR-TOKEN-HERE> python $HOME/Wilson-Cam/camera.py
  • Should create image.jpeg in the Wilson-Cam local folder
  • Should upload this image to the Dropbox app folder named img.jpeg

Schedule the Script

  1. Run crontab -e to edit tasks run by cron
  2. Add */5 * * * * DROPBOX_TOKEN=<YOUR-TOKEN-HERE> python $HOME/Wilson-Cam/camera.py >> $HOME/Wilson-Cam/camera.log 2>&1
  • */5 is the frequency to run, every 5 minutes (*/1 would be every minute)
  • Writes info and error output to a log file camera.log in $HOME/Wilson-Cam
  1. Save file changes
  2. Confirm your changes with crontab -l and watch camera.log for updates about what has happened

About

Capture an image from a webcam and upload to Dropbox

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages