-
Notifications
You must be signed in to change notification settings - Fork 22
camera_setup
The raspberry pi has various ways of connecting and controlling a camera, the most common connection types are via the Camera Serial Interface (CSI) which is the ribbon cable used to connect the picam and similar modules, USB using standard webcam protocols, and over WIFI as an IP camera.
To use a camera with the pigrow the required dependencies must be installed and enabled, this can be done in the Pigrow Install tool found in the pigrows system tab.
To use the camera to monitor a growspace a script is called using CRON at regular intervals which enables the camera, takes a picture and saves it to the designated capture directory (default ~/Pigrow/caps) - various camera capture scripts exist for use with different cameras and with different features, you need to pick the right one for your camera.
The GUI has a camera tab with tools to allow the user to control all the available options on a connected camera, this creates a config file in the ~/Pigrow/config folder which can then used by the camera capture script.
There are also a range of Image Tools which are used with the output of any of the capture scripts.
The raspberry pi's camera interface allows a wide range of camera modules to be connected, as the range has grown some of the newer models and 3rd party devices no longer work with the original software so newer versions have been made.
This is the original pi camera capture script for the pigrow which uses the python module picam to capture and save an image
This works with newer cameras such as the arducam autofocus, it reads the config file and creates a command which calls the program libcamera with the appropriate options.
this is a slightly more complex tool used to configure motion which is a camera tool used to detect movement while also being able to capture timelapse images
To use a webcam plug it into the USB and it should automatically be detected, to configure it go into the gui camera tab and select
this is a script which reads the camera config file and creates a command to run either UVCcapture or FSWebcam
This can be used with either a webcam or picam to detect motion and record timelapse.
To start recording a short timelapse sequence open the Quick Timelapse dialog box, choose your settings, send them to the pi then press start - you can change settings such as set name and delay between images without stopping the recording.
set name is the name that will be used in the filename, this allows you to select only one set from the folder in the timelapse tab.
delay between frames is the amount of seconds paused between taking an image, note that there is a natural delay between images so take this into account.
frame limit is the amount of frames to take before stopping, alternatively set it to -1 for it to loop continually until the stop button is pressed.
When running it will display the output of the capture script as the images are taken.
To record Long Duration timelapse we use cron to call the appropriate capture script at intervals, to easily set this up running there's button 'Long Timelapse' which opens a dialogue box allowing you to create or edit the cron job for the camera tool associated with the currently selected camera config file.
If you want to do more complex things such as using .sh scripts or custom capture scripts it's not recommended to use this feature but rather to use the cron tools directly.
Motion runs continually and can be set to record timelapse in it's configuration file.