A general webservice that handles taking pictures with a webcam or DSLR.
There are two folders, one contains files that go on the computer that has the camera connected to it. The other goes on the computer to be used as a server.
Currently the camera computer is implemented on a Raspberry PI. A server on this computer listens for a button press from a button attached to the PI's GPIO, or for a mouse click from a webpage that is served by this server.
Place the cameraComputer folder on the computer the camera will be attached to. Install all of the dependencies below.
(instructions given for Raspberry Pi)
-
update the PI
-
sudo apt-get upgrade
-
sudo apt-get update
-
download node (this version specifically for Raspberry PI)
-
wget http://nodejs.org/dist/v0.10.2/node-v0.10.2-linux-arm-pi.tar.gz tar -xvzf node-v0.10.2-linux-arm-pi.tar.gz
-
paste these paths at the end of .bashrc located in the home directory
-
NODE_JS_HOME=/home/pi/node-v0.10.2-linux-arm-pi
-
PATH=$PATH:$NODE_JS_HOME/bin
sudo npm install -g express
npm install socket.io
npm install onoff
sudo npm install forever -g
sudo apt-get install gphoto2
sudo apt-get install fswebcam
Ip address of the other computer that will act as the server needs to be set here in two places, once in both of these:
- takePhoto.js
- takePictureLoadtoServer
Comment out the appropriate line in takePictureLoadtoServer
node takePhoto.js
or run with forever:
forever start takePhoto.js
Instead of starting the server run this python script for a timelapse. Right now it defaults to taking a picture every 60 seconds. You can change that in the python script.
py timelapse.py
The GPIO is set to the markings in the rectangles below, not the circles. Attach power from any 3V to the button, then take from the button to pin GPIO25 with a 10k ohm pull down resistor going from there to any ground.
The server computer actually runs two servers, one that receives uploads from the camera computer, and another that serves images requested from a webpage.
Place the serverComputer folder on the computer to be used as the server. Install all of the dependencies below.
http://nodejs.org/
[sudo] npm install forever -g
- Install Hombrew
ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"
brew doctor
- Install FFMPEG
brew install ffmpeg --with-fdk-aac --with-ffplay --with-freetype --with-frei0r --with-libass --with-libvo-aacenc --with-libvorbis --with-libvpx --with-opencore-amr --with-openjpeg --with-opus --with-rtmpdump --with-schroedinger --with-speex --with-theora --with-tools
Note - To install FFMPEG the command line tools need to be installed on the computer.
Navigate to serverComputer folder and on command line type ./startPictureServers
To assemble all the still images into a timelapse video go to the fromPI folder and on the command line type ./timeLapse
. Note that this will take all of the images in that folder in combine them into a video.