PiCamera (Raspberry Pi)

The picamera extension adds support for PiCamera allowing you to take photos of your plants using a rapsberry pi camera. Connect a camera to your raspberry pi and make sure you enabled camera support through raspi-config for your pi if you have not done so.

This extension does not take an extension level config and is focused on interfaces.


Camera Interface

Provides a camera to take photos or record videos from a raspberry pi.

OptionTypeRequiredDescription
path[String]YesFull path where MudPi should save the images. Make sure proper write permissions are set.
filename[String]NoName to save file as with either timestamp or photo count attached. i.e. {filename}-00001.jpg
record_video[Boolean]NoSet to true to put camera in video mode. Default: False i.e. photo mode.
delay[Object]NoThe interval for the camera to take photos. Photo taken every X hours, X minutes, X Seconds. Default: 5 seconds
delay.hours[Integer]NoInterval in hours for camera to wait between photos. Default 0
delay.minutes[Integer]NoInterval in minutes for camera to wait between photos. Default 0
delay.seconds[Integer]NoInterval in seconds for camera to wait between photos. Default 0
resolution[Object]NoThe resolution to take photos at. Larger resolution = larger filesize. Can only support max resolution of camera.
resolution.x[Integer]NoWidth to save image at in pixels. Default 1920
resolution.y[Integer]NoHeight to save image at in pixels. Default 1080
record_duration[Integer]NoTime in seconds to record videos for when in record mode. Default: 5
framerate[Integer]NoFramerate to set camera at. Default: 15
topic[String]NoChannel that MudPi broadcasts new images events on. Default: camera/{key}
sequential_naming[Boolean]NoSet to true to save photos with a counter instead of timetamp. Default: False
count_start[Integer]NoNumber to start count at if using sequential_naming
max_count[Integer]NoMax number of photos before overwriting if using sequential_naming

Below is an example of a camera configuration.

"camera": [{
    "key": "pi_cam_1",
    "interface": "picamera",
    "path":"/home/pi/images",
    "filename": "pi_cam_capture",
    "topic": "camera/pi_cam_1",
    "delay": {
        "hours":0,
        "minutes":10,
        "seconds":0
    },
    "resolution": {
        "x":1920,
        "y":1080
    },
    "sequential_naming": true,
    "count_start": 10,
    "max_count": 100,
    "record_video": false,
    "record_duration": 5
}]