#Pi Time-lapse Camera ##Introduction A Raspberry PI camera with time-lapse functionality. This project is combines Adafruit's DIY WiFi Raspberry PI touchscreen Camera and some features from David Hunt's Lapse Pi - Motorised time-lapse Rail with Raspberry Pi. The time-lapse image(s) can be uploaded to dropbox and used on a webpage such as a blog or in this read.me as shown below.
##Overview An overview of the capabilities of this application, to a large extent a repetition of the information provided by the linked documents in the previous chapter. ###Startup screen The startup screen as shown below has three buttons at the bottom, from left to right:
- Settings: navigate to settings menus
- Timelapse: toggles timelapse between on and off
- Preview: show photos taken
Touching the screen anywhere else besides the buttons will take a photo, as shown in the righ-hand screenshot below.
###Settings To navigate between the various settings use the top arrows in the settings menus.The done button at the bottom of the settings menu takes the user back to the main screen.
####Storage Where your photos should be stored by selecting the desired option. To use Dropbox, which is essentail for the webcam mode described further below, a Dropbox account must be created as described on raspi.tv
####Size Select the size for your photos.
####Effect Use the bottom arrows to select the desired effect.
####ISO Use the bottom arrows to change the ISO setting
####Time-lapse Here we can define the number of photos (Images), max 9999, and the time-delay in seconds (Interval) between the photos for the time-lapse mode. Click the sprocket symbol next to these values to change them using the keypad dialog as shown in the two screen shots below.
####Webcam When the Webcam mode is enabled then each image taken is resized, renamed and copied to $HOME/Photos/webcam/IMG_0001.JPG and from there to dropbox folder Photos/webcam/IMG_0001.JPG, each time overwriting the previous webcam image. This only works when Storage Mode: Dropbox is selected. The original photo in its chosen resolution is not uploaded, it is however stored locally in $HOME/Photos. Webcam mode works independent from the time-lapse mode. This mode and the following two options can be set through the Webcam settings screen as shown below by ticking or un-ticking the associated check-boxes
The Webcam image only setting works only in conjunction with Webcam mode activated and Storage Mode: Dropbox. When the checkbox for "Webcam image only" is ticked the camera takes a small image only which is stored locally ($HOME/Photos/webcam/IMG_0001.JPG) and uploaded to dropbox folder Photos/webcam/IMG_0001.JPG. Every new image overwrites the previous one.
Annotate image also only works in conjuction with Webcam mode ativated. When the checkbox for Annotate image is ticked a timestamp is embedded at the top of each picture taken.
##Setup
Setup your Raspberry PI and follow the instructions to setup Adafruit's PITFT - 2.8" Touchscreen display for Raspberry PI(pdf). It is not necessary to add the shutdown button or any other tactile buttons on the PiTFT.
To install the Pi Timelapse camera software follow Adafruit's instructions to setup the DIY WiFI Raspberry Pi Touschscreen Camera (pdf), with the following exceptions:
-
Install the latest version of picamera
sudo apt-get install python-pip sudo pip install picamera
-
Install python dropbox library
sudo pip install dropbox
-
Download and use PiTimelapseCam
wget https://github.com/tarababa/05-PiTimelapseCam/archive/master.zip unzip master.zip sudo python ./05-PiTimelapseCam/src/cam.py
In order to use the webcam mode it is essential to setup a dropbox account and allow your (this) app access as described Developers - Dropbox
In for cam.py to run with dropbox you have to run it at least once with your dropbox access token hardcoded, find the below code in cam.py and replace YOUR_ACCESS_TOKEN with yours.
#Set your dropbox access token here, the program must run at least once to
#"pickle" the access token
if dropboxAccessToken is None or dropboxAccessToken == 'None':
dropboxAccessToken = 'YOUR_ACCESS_TOKEN'
saveSettings()