RaspiCam-Timelapse (rev3)

What is it? questionmark

A follow up on my old project https://timdows.com/projects/timelapse-camera/, this project is going to capture the construction across my apartment. You can see this as rev3 of this project.

In this project I’ve upgraded the Raspberry Pi 1 to a 3, eliminating the wireless issues that I had, and gaining more overall processor power.

Starting the project, I swapped the hardware and made the 3d print fit again (the screen sticks a bit out on the Pi 3)

The original version PID 1601 is designed to fit nicely onto the Pi Model A or B but also works perfectly fine with the Pi Zero, Pi 2, Pi 3 or Pi 1 Model A+ or B+ as long as you don’t mind the PCB overhangs the USB ports by 5mm
Source: https://learn.adafruit.com/adafruit-pitft-28-inch-resistive-touchscreen-display-raspberry-pi/overview

Next I setup a fresh sd-card and configured the wireless access, giving it a static IP address from my DHCP server.

Learning from my previous build, I also found that taking a picture every 5 minutes was way to few, there were days that the demolition was so quick, that in the timelapse it looks odd. Due to this I decided to take a picture every 20 seconds, and just speed up the movie afterwards if the constructrion takes a long time at some points.

End result (rev3) questionmark

Old and new hardware together

Running raspbian from the Adafruit image (https://learn.adafruit.com/adafruit-pitft-28-inch-resistive-touchscreen-display-raspberry-pi/easy-install)

Pi 3 doesn’t fit that good in the 3d case

Sawing some PLA away to make space

Command and control webpage in Node.js questionmark

I found this perfect project https://github.com/not-implemented/raspicam-timelapse
In his TODO list I found some issues I wanted to tackle before using it.

I forked this project, https://github.com/timdows/raspicam-timelapse,  and implemented the following changes:

  • Use cron to make the images (i.e. every image is taken by the node application and not a raspistill deamon);
  • Save images in a folder per day (before every start of the deamon would create a new folder, quickly losing overview);
  • Change the imagename to human readable timestamp (not possible with the raspistill timelapse option);
  • Console log the pictures being taken (every 20 seconds in my setup);
  • Make some options from the cron implementation manageable via the webpage;

Around the node application, I used PM2 (Process Manager 2) to make sure the application is always running.

The result webpage

Rsync the images to my synology

To make sure that my 8GB sd-card doesn’t run out of space, the images have to be downloaded from the device asap.
As an image is around 1.5MB, and I have 2.5GB of free space on avarage, I can store 1666 images, with 3 images per minute that gives me a runtime of a bit more than 9 hours.
I always choose to actively download the images from these kind of projects, and not use an upload mechanism (just because).

For this my Synology NAS comes in action, making sure that the NAS can login via RSA keys (eliminating the need for passwords), following this guide: http://www.linuxproblem.org/art_9.html.

Setting up remote login without passwords

Setting up a task in my Synology DiskStation

The task itself just runs rsync and removes the old files after downloading

Making sure the sd-card won’t get full

Yup, it already happened, at some point it didn’t get the images synced, the sd-card got full, and I got stuck with a non working Raspberry Pi.
At that point, login is impossible and the 4.7″ touch screen won’t go on any more. Ubuntu live cd to the rescue to access the sd-card and remove some images (didn’t even bother to save them).

Changed some code (and tested it) to avoid this in the future.
See commit: https://github.com/timdows/raspicam-timelapse/commit/31cb2418a2043d7f5fb7147ffbd2c3ff52c5526b

TODO questionmark

  1. Changing the cron settings now requires a restart of the node application;
  2. The webpage shows only the date part of the latest picture taken (a space issue perhapse?);
  3. Delete empty directories on the Pi after all images are downloaded and the folder is not from today;

Project costs in € or $ questionmark

Object Price
Raspberry Pi 3 € 40
Raspberry Pi Camera Board € 25
320×240 2.8″ TFT Touchscreen € 38
3d print € 38
Other materials € 2
Total € 143

What could be better questionmark

  1. I wanted to build this revision for quite a while now, I struggled to much with making my own software for making pictures, using already created software from not-implemented saved me a lot of time. I should have let go of my own ambition to make everything myself from scratch.

Comments are closed.