-
Notifications
You must be signed in to change notification settings - Fork 102
Introduction
- Program Description
- Program Features
- File Management
- Background History
- Alternative Security Camera Solutions
pi-timolo.py is a python picamara module application for a Raspberry PI computer. A RPI camera module must be attached. It is designed for Long Duration Night (lowlight) Time Lapse and/or Motion Detection. Twilight transitions are auto detected based on a camera light threshold setting, so a clock is not required. Customization settings are saved in the config.py file.
I mainly use pi-timolo for local and remote (3000 km away) headless security cameras and managing configuration and media uploads to an rclone remote storage service names This avoids having to use a 3rd party connection solutions since my remote camera(s) are on a private RV park network where SSH and other solutions won't work. I also sync images and Media Files to my google drive using rclone that can access many remote storage services. It is also handy for timelapse and web cam tasks. There are plugins to overlay specialized usage tasks over the config.py settings. Image file names can be saved by Number Sequence or Date/Time Naming. Time Lapse and Motion image files can be named and saved to different folders or the same folder if desired since there is an optional prefix setting for each.
NOTE: PI-TIMOLO uses low light long exposure for night motion and/or time lapse images. The program can detect motion during low light, although the long exposure times can cause blurring of moving objects.
This application uses the picamera python module and a recent Raspberry PI Raspbian firmware and updates to work properly. Here are some motion and time lapse YouTube Videos
- Easy Installation using run pi-timolo-install.sh by cutting and pasting a curl command to install/upgrade of pi-timolo code and dependencies.
- Can run on single core RPI's including early Raspbian versions like Wheezy. If using the opencv motion tracking mode, a quad core processor will improve performance.
- Release 12.0 Added Panoramic Image stitching using Pimoroni or Waveshare (or compatible) pantilthat hardware. Image Stitching uses a modifed version of OpenPan that is modified to accept Output file path as the first parameter.
- pi-timolo.py can run Time lapse, Motion tracking and Pano together or separately plus other video features like video repeat (dashcam mode) and motion quick timelapse.
- Night Timelapse and Motion images use low light long exposure
- pi-timolo.py auto detects day, night and twilight changes without using a clock. This is useful if the RPI reboots without an internet connection or network ntp (time) server.
- Image date/time and name can be put directly on images. Position and color can be specified. Option to flip color between night and day to allow for better visibility.
- Allows logging of summary data to a file or detailed verbose data when enabled
- Configuration variables are saved in a config.py or video.conf files. This allows pi-timolo.py to be updated without having to redo variable values. This also allows swapping in different saved configurations.
- Has a number of plugins for specialized tasks that can overlay config.py settings and leave config.py unchanged. There are a variety of plugs for specialized tasks included or you can create your own.
- Optional Schedule Start Feature for motion, timelapse or video repeat modes. Allows delaying these modes to a future date and or time. Note: Disabled in Raspbian Wheezy due to python-dateutil pip ssl install security issue.
- menubox.sh admin menuing system makes it easier to manage and run program features
- Includes a standalone customizable web server for viewing media files from another LAN connected computer via web browser.
- watch-app.sh allows remotely managing pi-timolo.py config.py settings over the internet restart, reboot, running admin script, Etc using rclone sync folder on a remote storage service of your choice.
- Includes Rclone and sync scripts to sync media files to a remote storage service like google drive, drop box, Etc. You can then remotely view media files from internet devices/computers via remote storage service web page interface or computer/android/IOS service Apps. I use google drive and dropbox and view from their secure web interface. You can also share links to media files if desired.
- Includes a one file webserver.py to dynamically view files (images/videos) from a network computer web browser.
- Option to use threaded video streaming for opencv motion tracking detection that avoids most false positive events. Threading also speeds image frame rate.
- Option to take save a fast video frame image rather than a still image that would take time.
- Option for creating DateTime named motion and/or timelapse subfolders with new folder creation triggered by MaxFiles or MaxHours settings. These settings are in config.py
- Option for maintaining a specified number of the most recent files in separate motion or timelapse recent folders
- Option to manage disk space by deleting older files in specific folder tree with specified extensions. A free space setting is used as trigger for deletion of oldest files in the specified folder tree.
- Includes makevideo.sh script to help create timelapse mp4 or avi videos from images.
- Includes convid.sh script converts h264 videos to mp4 format and allows viewing videos from local webserver or remote storage service if sync'd
- Includes mvleavelast.sh script to move all but last file (since may still be active) This allows files to be moved to a folder mount point on a remote share if required.
See wiki main page or wiki side bar menu for details on these features and more
For managing or transferring files from an external windows or other network computer a good choice is filezilla. This allows transferring files using SFTP protocol. I use this quite a bit for development and transferring media files to my PC or NAS
For local RPI File management, I like to use Midnight Commander, although filezilla can also do some local file management tasks. This runs in an SSH console session and can use a mouse. This makes managing folders and directories easier. To install mc (Midnight Commander). From a console session
sudo apt-get -y install mc
mc
use the function keys for bottom options and/or mouse for selecting files and top/bottom menu options. type exit or press F10 key to exit.
I have been working on a headless internet capable security camera using two types of security camera cases. One is a small fake plastic security cam case from Amazon. Model A or B fits inside with wifi only.
http://www.amazon.com/gp/product/B004D8NZ52/ref=oh_details_o01_s00_i00?ie=UTF8&psc=1
Here is a larger aluminum camera case that I have a model B installed in.
This one has room for a usb power supply etc.
After some work I now have the Raspberry Pi security camera's working
efficiently from a software point of view. The current configuration uses
the pi-timolo.py script to save files to a number sequence or a date-time
sequence. I also added some code to optionally put date/time information
directly on the photo images. This is convenient to see the exact time stamp
that the photo was taken.
Using number sequencing allows limiting the number of files that need to
get synchronized to my google drive.
It was too much to manage all the dated files and clean up google drive.
This method restricts the number of motion files that need to get updated
via the sync.sh. It is suggested you set up a crontab for sync.sh script.
The pi-timolo.tar file is a complete setup including instructions. To automate the camera operation, I have setup pi-timolo.py to run from a /etc/init.d/pi-timolo.sh bash script by copying /etc/init.d/skeleton file to pi-timolo.sh script (sample included).
If you are looking for a good web based RPI camera interactive interface, I would highly recommend application links below. They are relatively easy to install and work well. But I still prefer pi-timolo for remote headless camera situations since I can upload to my google drive and run timelapse and motion simultaneously.
The GitHub Speed Camera project can be used as a motion tracking security camera. It will run using a webcam under windows, Mac, Unix operating systems as well as Raspberry pi using webcam or picamera module. It is suggested you configure plugins and use secwebcam480.py or secpicam480.py plugin. webserver.py can be used to view files on local LAN. rclone can be configured to upload security images to a remote storage service of your choice so you can view files from an internet connected computer or IOS, Android device using a web browser or device remote service application Eg Google Drive, DropBox, App Etc. See Wiki for Details
The web interface below can sometimes be a little finicky and do not allow concurrent motion and time lapse as far as I can tell. for more details see RPI-Cam-Web-Interface
MotionPie is run from a customized SD card image. For more details see MotionPie Wiki and MotionPie github repo
- Wiki Home
- Introduction
- Prerequisites
- Install or Upgrade
- Run pi-timolo from a drive mnt
- Customize config.py
- Panoramic Images
- user_motion_code.py
- Align Camera Motion Area
- Schedule StartAt
- Basic Troubleshooting
- Tuning Variable Settings
- menubox.sh
- Web Server View Files
- Make Timelapse Video
- Join or Convert h264 to MP4
- Run on Boot
- Setup & Run shutdown.py
- Rclone Media Sync
- watch-app.sh Usage
- Plugins Usage
- Mount USB Storage
- Mount Network Share
- Auto SubFolder Creation
- Manage Disk Space
- Utilities Summary
- GitHub Repo
gdrive is no longer default.