Skip to content
Claude Pageau edited this page Oct 15, 2020 · 67 revisions

Setup custom overlay configurations for specialized tasks

About Plugins

Plugins configure pi-timolo for special tasks by overlaying the plugin variables over the current config.py settings. Plugin Files can be found in the pi-timolo/plugins subfolder. You can customize a particular plugin or create your own.
IMPORTANT Do Not delete the __init__.py file since it is required in order to import plugins.

How to Enable plugins

menubox.sh method

The easiest way to edit configuration files is by using menubox.sh then PLUGINS menu selection.

Manual command line method

To enable pi-timolo plugins perform the following commands From a logged in console or SSH session

cd ~/pi-timolo
nano config.py

Edit PLUGIN_ON = variable by setting value to True (default is False). False means plugin option is disabled.

PLUGIN_ON = True        # Default= False True reads customized settings from a custom.py file

Then Edit pluginName= variable and enter a valid plugin name in quotes. This will point to a plugin file in the pi-timolo/plugins subfolder. It will be imported and plugin variables will overlay config.py variables.

PLUGIN_ON = True        # Default= False True reads customized settings from a custom.py file
PLUGIN_NAME = "dashcam" # Specify filename in plugins subfolder without .py extension per below
                        # TLlong, TLshort, secfast, secstill, strmvid, secvid, secQTL, shopcam, dashcam, slowmo

Do Not include .py extension. Press ctrl-x y to save changes and exit nano editor.

How to Customize a plugin

Plugins can be edited with a text editor like nano. All plugins can be found in the pi-timolo/plugins subfolder. To edit a plugin you can use menubox.sh and select the PLUGINS menu selection

cd ~/pi-timolo.py
./menubox.sh

or edit a plugin directly.

cd ~/pi-timolo/plugins
nano pluginName   # where pluginName is the plugin you want to change
cd ..

Edit the variables per comments. The plugin variables will override the existing config.py variable settings. You can add any valid variable from config.py to the plugin.
Press ctrl-x y to save changes and exit nano editor or n to exit without saving.

How to Download plugins from GitHub

Plugins will be installed as part of the pi-timolo-install.sh script but you may want to return to a default plugin setup. To download a fresh copy of one plugin. Delete or rename the desired plugin(s) and run the plugins-install.sh curl script per steps below.

How to Replace a Copy of one plugin

Note: Replace dashcam.py* with name of plugin you want to replace.

cd ~/pi-timolo/plugins
cp dashcam.py dashcam.py.bak
rm dashcam.py
curl -L https://raw.github.com/pageauc/pi-timolo/master/source/plugins-install.sh | bash

The deleted plugin will be replaced by the latest GitHub version.

How to Replace All plugins

cd ~/pi-timolo
mv plugins plugins_bak
curl -L https://raw.github.com/pageauc/pi-timolo/master/source/plugins-install.sh | bash

All latest plugins will be downloaded from pi-timolo GitHub Repo. The previous plugins will be in the plugins_bak subfolder. You can delete this folder if you do not need it per the following commands

cd ~/pi-timolo
rm -r plugins_bak   

Description of Available Plugins

shopcam - Take a Series of Timelapse Images on Motion Tracking Event

The shopcam settings below will monitor camera view using motion tracking. When motion tracking is triggered, the camera will take a sequence of time lapse images with MOTION_TRACK_MINI_TL_TIMER_SEC seconds between images and continue for MOTION_TRACK_MINI_TL_SEQ_SEC seconds duration then stop and monitor for another motion tracking event.

Once the camera is setup, you do not need to manage it for each work session timelapse sequence, since it is only when motion tracking is activated. If work takes longer than MOTION_TRACK_MINI_TL_TIMER_SEC then the next motion will trigger another timelapse sequence per settings. Ideal for a timelapse project that spans many days with work happening at different times. Can also be useful for security monitoring.

secfast - Takes Fast Video Stream Image on Motion Tracking Event

This plugin will monitor camera view using motion tracking. When motion tracking is triggered, the camera will save a video stream image then stop and monitor for the next motion tracking event. This will allow capture of faster moving objects but lower quality. The image size will be 640x480 based on the stream size. This smaller size is suitable for gdrive sync updates.
Note - Default is for No creation of subfolders. Also Only a limited number of images will be created since image numbering is set to recycle when motionNumMax reached.

This configuration is suitable for a remote security camera or a project to capture images of faster moving objects.

secQTL - Security Camera with MOTION_TRACK_QUICK_PIC_ON on Motion Track Event

This plugin will monitor camera view using motion tracking. When motion tracking is triggered, the camera will take a series of quick timelapse images to capture motion in HD images. This may be more suitable that taking a video and uses less disk space. Once quick timelapse sequence is complete, motion tracking will resume. Note no subfolders are created and only a limited number of images will be created with image numbering getting recycled when motionNumMax reached.

This configuration is suitable for a remote security camera or a project to capture HD images of faster moving objects using a timelapse sequence.

secstill - High Quality Image Taken on Motion Track Event

This plugin will monitor camera view using motion tracking. When motion tracking is triggered, the camera will take a High Definition (HD) still image then stop and continue monitoring for the next motion tracking event. There will be a short delay in taking the image since camera needs time to change from video streaming mode to still camera mode. This may cause faster motions to be missed.

This configuration is suitable for a local security camera or a project to capture high quality images of slower moving objects.

strmvid - Take Small Video Suitable for rclone sync

This plugin will monitor camera view using motion tracking. When motion tracking is triggered, the camera will take a short video for MOTION_VIDEO_TIMER_SEC seconds then stop and monitor for the next motion tracking event. There will be a small delay for the camera to changeover from motion tracking to video mode

This plugin takes small 640x480 resolution videos at 10 fps. The Small video size makes it suitable for rclone sync to a remote storage name Takes numbered videos in a circular number sequence to display only recent motion video activity with minimal history. Reduced size reduces upload bandwidth and storage space on remote storage name. Add crontab for rclone-video.sh to regularly update videos on remote storage name.

secvid - Takes a short HD Video on Motion Tracking Event

This plugin will monitor camera view using motion tracking. When motion tracking is triggered, the camera will take a short video for MOTION_VIDEO_TIMER_SEC = seconds then stop and monitor for the next motion tracking event. Video quality

Suitable for capturing video after a motion event

dashcam - Takes Continuous Series of Videos

This plugin will take a series of videos (default is 120 seconds) like a dash cam. You can manage disk space and delete oldest videos when disk space is close to full or run video session for a set number of minutes.
Example dashcam video https://youtu.be/NcaFBPBkJ1I

slowmo - Take slow motion video on Motion Tracking Event

You have a project where you want to capture a slow motion video sequence. This plugin will monitor the camera view using motion tracking and tigger a video at a high fps. 640x480 at 90 fps This would be suitable for example capturing humming birds or other fast moving objects in the camera view.

NOTE: Slow Motion can also be done using VIDEO_REPEAT_ON = True (dashcam mode) but would Not be triggered by motion. It would save a series of slow motion videos when manually started.

TLlong - Take Long Duration Timelapse Images

This plugin is suitable for a multi week/month long duration day and night timelapse.

This setup will save HD images continuously bu number sequence in case date/time is not maintained due to a reboot and no internet NTP Time server is available. subfolders will be created every ten thousand images to make managing files easier. Depending on the full duration of the timelapse sequence it is advised you save files to an attached USB hard drive or large memory stick. It is recommended that an uninteruptible power supply (UPS) be used in case there is a power failure.

After testing to ensure correct operation, setup a crontab for sync.sh to force a reboot if pi-timolo.py process stops. Also setup pi-timolo to start on boot using /etc/rc.local see pi-timolo wiki for details here https://github.com/pageauc/pi-timolo/wiki
Example Long Duration Timelapse - https://youtu.be/oZ2do75pyy8

TLShort - Takes a Series of Images for a Short Timelapse Project

This setup will save images in number sequence in case date/time is not maintained due to a reboot and no internet NTP server is available. It will Not create subfolders. Depending on the full duration of the timelapse sequence it is advised saving files to an attached hard drive or USB memory stick. Due to the short nature no subfolders will be created.
Example Short Duration Timelapse
https://youtu.be/mipVTAe_ugA
https://youtu.be/u7VaqlA2PNQ

Clone this wiki locally