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.
Provides a camera to take photos or record videos from a raspberry pi.
Option | Type | Required | Description |
path | [String] | Yes | Full path where MudPi should save the images. Make sure proper write permissions are set. |
filename | [String] | No | Name to save file as with either timestamp or photo count attached. i.e. {filename}-00001.jpg |
record_video | [Boolean] | No | Set to true to put camera in video mode. Default: False i.e. photo mode. |
delay | [Object] | No | The interval for the camera to take photos. Photo taken every X hours, X minutes, X Seconds. Default: 5 seconds |
delay.hours | [Integer] | No | Interval in hours for camera to wait between photos. Default 0 |
delay.minutes | [Integer] | No | Interval in minutes for camera to wait between photos. Default 0 |
delay.seconds | [Integer] | No | Interval in seconds for camera to wait between photos. Default 0 |
resolution | [Object] | No | The resolution to take photos at. Larger resolution = larger filesize. Can only support max resolution of camera. |
resolution.x | [Integer] | No | Width to save image at in pixels. Default 1920 |
resolution.y | [Integer] | No | Height to save image at in pixels. Default 1080 |
record_duration | [Integer] | No | Time in seconds to record videos for when in record mode. Default: 5 |
framerate | [Integer] | No | Framerate to set camera at. Default: 15 |
topic | [String] | No | Channel that MudPi broadcasts new images events on. Default: camera/{key} |
sequential_naming | [Boolean] | No | Set to true to save photos with a counter instead of timetamp. Default: False |
count_start | [Integer] | No | Number to start count at if using sequential_naming |
max_count | [Integer] | No | Max 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
}]