Introduction to Event Handling and Triggered Capture of Videos and Photos
raspiCamSrv can capture events from camera and GPIO input devices and let these process actions by the camera and GPIO output devices.
Supported Triggers
- Triggers from GPIO-connected sensors
Additional Triggers when a Camera is available
- Triggers from camera events such as start and stop of video recording or streaming or detection of motion.
- Motion Capturing through image analysis
- Active Motion Capture
Supported Actions
- Actions with GPIO-connected devices, such as LEDs, motors, servos or sound devices.
- SMTP actions for sending an eMail to the configured recipient.
- Trigger-Actions define which trigger will execute which action(s).
- Under Notification, you configure the general mail recipient as well as specifics for notification on motion detection through the camera.
Additional Actions when a Camera is available
- Camera actions, such as taking photos, starting or stopping video recording or recording a video with a given length.
- Camera Actions specify the camera actions in case of motion detection through the camera.
- Under Notification, you configure whether mail notification shall include photos or videos from motion detection through the camera.
Event Dashboard
Event Handling Infrastructure
raspiCamSrv comes with two different types of event handling:
1. Motion Capturing
Originally supported was Motion Capturing with photo-taking and video recording actions as well as notification by mail.
The relevant dialogs for configuration are Motion, Camera and Notification.
2. General Event Handling
Since version V3.3.0, raspiCamSrv supports a more general approach to event handling which includes not only the camera but also various kinds of input and output devices which can be connected to the Raspberry Pi's GPIO pins.
If you have no devices connected to your Raspberry Pi, you just stay with Motion Capturing.
If you have input devices, such as sensors or buttons and/or output devices, such as LEDs, buzzers, relais or motors connected to your Pi, in addition to a camera, you can benefit from the fully integrated powerful event handling of raspiCamSrv.
- You start with configuring the connected devices in the Settings/Devices screen.
- Then, for the configured input devices, you configure Triggers which can also be based on camera events, such as start or stop of video recording, streaming or motion capturing.
- As next, you configure any type of actions which you want to see, such as LEDs being switched on, a stepper motor executing a certain number of steps or photos and/or videos being taken with the camera.
In addition, you can also configure an SMTP action for being informed about an event by mail. - Once this is done, you need to specify for each of the triggers, which actions shall be processed once an event has been triggered. This is done in dialog Trigger Actions.
- In the Triggers and Actions dialogs, you also have the possibility to deactivate or activate triggers and actions, respectively.
Integration
The two types of event handling exist independently from each other and can be used separately or simultaneously.
Events from Triggers defined as part of the General Event Handling can also be logged and visualized in the Event Viewer if their event_log control parameter is set to "True".
SMTP actions for mailing use the Notification settings. Whether photos and/or videos, created during action processing, shall be included in a mail, can be configured independently for each SMTP action.
In order to receive a mail on an event, you just activate one of your configured SMTP actions for the intended trigger.
While all actions are started simultanously in individual threads, the thread for the SMTP action will wait for completion of all other actions of the same trigger and include any information and rosources from the other action threads.
Where do Photos and Videos go?
Photos and videos taken in case of motion detection will always be stored in the event folder while events are logged in the log file and the database.
Old data can be removed with the Cleanup function.
The same applies to triggers and actions of General Event Handling if the control parameter event_log for the trigger is set to "True*.
If this parameter is "False", photos and videos will be stored at the same location as if they were taken on the Live screen and they can be inspected in the Photo Viewer.
Restrictions
You can use motion capturing through the camera as trigger.
Whereas you can associate any kind of GPIO actions with such a trigger, you can not associate any camera or SMTP action.
This is because camrea- and SMTP actions are handled already in the Motion Capturing infrastructure, which must be activated in order to capture motion detection events.
