I had a Raspberry Pi lying around that I use to use as a media server, and an old webcam that I used before laptops came with webcams. I had an idea to create a time lapse server.
It simply takes a photo every minute and saves it to a directory within the path of a webserver (Nginx).
Then a basic webpage takes input from the user (me) a time stamp as a parameter and starts playing the images at 1 image per second (60 times faster than they were taken).
Firstly I wiped the memory card of the Raspberry Pi that original had the OpenELEC (a Kodi distribution for Raspberry Pis) operating system and installed Rasbian.
$> lsb_release -a Distributor ID: Raspbian Description: Raspbian GNU/Linux 11 (bullseye) Release: 11 Codename: bullseye
I then installed
- Python 3
I created a Github repository and cloned it down to the home directory of the logged in user (just the default
I created a virtual Python environment for development.
In the Nginx webserver root directory I copied the
To ensure the Python service is running always in the background I ran.
nohup python photo-service.py &
This will take a photo every minute and save it to the Nginx hosted webserver at
Then, knowing the IP address of the Raspberry Pi on our network, we can use a browser to see the photos.
This is a time lapse of me at my desk played back at 5 frames per second.
This is a time lapse at me buring the midnight oil, coding away at 10 frames per second.