Set-up Tutorial

From SynWiki
Jump to navigation Jump to search

Welcome to the First Edition of the set-up tutorial for the Time-lapse Camera

Basic Overview

System Design Draft.png


The current System consists of 3 systems.

  1. Camera (Raspberry Pi)
  2. Server
  3. Website


The chain of events is as follows:

  1. The Camera Takes a Timelapse of Photos during the day
  2. The Camera compresses those photos into a small .mp4 video
  3. The Camera then Uploads the .mp4 video to the Server
  4. When the Server gets the uploaded video, it will stick it to the end of the current video
  5. When the Server has completed that, the video will be viewable on the WebPage

How to Set-up

Camera

Hopefully in the future there will be a Plug n' Play system where when we need another camera we can simply:

  1. Build the Camera
  2. Plug in an Image SD Card
  3. Run Basic Tests
  4. Ready to be placed (Calibration Testing may or may not also be needed)


However that's not currently the Case

Set-up scripts

We assume that we have a working Pi that has just logged in for the first time

The Pi will first need the timelapse folder. It will be placed in /home/pi directory

This folder will contain the scripts to actually run the program and some testing scripts

Set-up Packages

Here is a list of modules that must be installed in order for the program to work

Modules : ffmpeg, pysftp


To install them you must copy and paste the below commands into the terminal. (you can be at any directory when installing)

Links are provided above for official documentation


https://pypi.org/project/pysftp/

  =>   'pip install pysftp'

https://pypi.org/project/ffmpeg-python/

  =>   'pip install ffmpeg-python'

Set-up Crontab

Crontab is a default program that allows us to automatically run a script (python file) at a certain time.

Checkout the websites below (the first one has more detail) on how to create a crontab code line

Better Generator https://crontab.guru/

Simplier Generator https://crontab-generator.com/


To edit the crontab file type this into any terminal on the pi

  =>   crontab -e


An editor will then appear (likely vim) and the following line will need to be inputted and saved

  =>   */30 8-16 * * 1-5 python3 /home/pi/timelapse/timelapse.py

Server

Website