Skip to content

camera_setup

Pragmatismo edited this page Feb 19, 2023 · 8 revisions

Camera Tools

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.

Capture Scripts

Picam

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.

picamcap

This is the original pi camera capture script for the pigrow which uses the python module picam to capture and save an image

libcamera

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.

motion

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

USB Webcam

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

camcap

this is a script which reads the camera config file and creates a command to run either UVCcapture or FSWebcam

Using camcap.py

motion

This can be used with either a webcam or picam to detect motion and record timelapse.

Clone this wiki locally