Sunday, August 13, 2017

Open Source Time Lapse Manager

[ Intro ]

This weekend I decided I wanted to get some time lapses of my peppers and basil plants I have in both my indoor and outdoor gardens.  Not only will it be fun to watch the difference between the two environments but it can also be very useful having on demand time lapses of anything we want.  I wrote this system to run on a Raspberry Pi model 3 but, you can run it on almost anything.

[ What You Need ]

  • Windows/Mac/Linux machine to run the software.  I will be using a Raspberry Pi Model 3
  • USB Webcam
  • Micro SD Card(Only needed for Raspberry Pi)
  • Git Installed
  • Pyton 2.7

[ Instructions ]

Plug in your webcam preferably using a USB hub with dedicated power.  The client and server are written in Python and node js so they should run on any of the major operating systems.  In this guide, I will be using a Pi model 3 running the latest version of Raspbian Jessie.  The very first step is to get all of the source code we need from GitHub.  This can be accomplished by cloning the repositories for both the client and server.  This can be done using the following two commands below:

    cd ~/

    git clone

    git clone

[ Server Setup ]

Now that we have both the server and client side code we need to get everything setup and running.  First, enter the server directory using the command below.

    cd ~/growlapse-server

In the root of the server repo and run the commands below to install opencv on both your system and in the python enviroment.

    sudo apt-get update
    sudo apt-get install python-dev python-opencv

Once we have completed that we can install the python dependencies using the command below.

    pip install -r requirments.txt

    pip install -U numpy

We should now be able to run our server by issuing the following command.


Our server is now ready to go.  All we need now is the client in order to give us a nice UI to manage our time lapses.  If you would like to know that the server is running for sure you can use curl to test it.  Running the following command should issue you back a blank response with a 200 status code.


[ Client Setup ]

Before we get the client up and running we need to upgrade nodejs.  The easiest way to do this is to first run the following commands to remove any old version of node that may be on the system.

    sudo apt-get remove nodejs

    rm -f /usr/bin/node /usr/bin/npm

Now we will grab the latest version of node and unpack it to our home directory from the node download servers.



    tar xvf node-v6.11.2-linux-armv7l.tar.xz

    cd node-v6.11.2-linux-armv7l

Once we have the latest version of node for ARMv7 we need to link our new npm and node binaries to our path making it easier to run node.  To do this we use the following commands.

    sudo ln -s bin/node /usr/bin

    sudo ln -s bin/npm /usr/bin

Now that we have the latest version of node its time to install our dependencies for the client using the command below.

    cd ~/growlapse-client

    npm install

Once this finishes we can run the client in dev mode by using the following command.

    node_modules/.bin/ember serve

This will give you the output shown below after getting everything setup and ready.  I have also attached images of the main dashboard and the create new time lapse screen.  Hope you enjoyed this entry and as always don't forget to comment and check back regularly for more content!

No comments:

Post a Comment