17-Sep-2014 Version 2.0 of pimotion.py is now on github.
- Changed setup.sh so it installs python-imaging, python-picamera and mencoder dependencies and libraries
by default. Note grive_setup.sh has been replaced by setup.sh
- Added option to use picamera to take large photo instead of shelling out to raspian to run raspistill
Note small image still uses raspistill.
- Added picamera option to take low light photos during specified hours. This dramatically improves
low light photos but don't use during bright light conditions or photos will be washed out
- picamera option uses camera settings to make Daylight photo more consistent
- Added makemovie.py to create a movie from contents of google_drive folder.
- Fixed bug that crashes pimotion if numsequence is set to False caused by displaying initial settings information
Brief install instructions. ssh or open a terminal on the raspberry pi with a rpi camera module installed and working
- Code: Select all
tar -xvf pimotion.tar
If Camera does not work properly in picamera python module eg black screen then you should update the RPI firmware. I had one of my security cameras that exhibited this behavior. raspistill worked fine but picamera showed a black photo.
This will update the rpi firmware and the camera should then work properly. Try doing a hard boot to be safe.
- Code: Select all
unplug power after halt then plug back in to reboot and retest camera using picamera mode again.
- Code: Select all
# short test program to test picamera
picameraVFlip = False
width = 1296
height = 972
with picamera.PiCamera() as camera:
camera.vflip = picameraVFlip
camera.resolution = (width, height)
camera.framerate = 30
# Give the camera's auto-exposure and auto-white-balance algorithms
# some time to measure the scene and determine appropriate values
camera.iso = 200
time.sleep( 2 )
# Now fix the values
camera.shutter_speed = camera.exposure_speed
camera.exposure_mode = 'off'
g = camera.awb_gains
camera.awb_mode = 'off'
camera.awb_gains = g
Read the Readme.txt for detailed instructions
You will have to transfer any previous pimotion.py settings to the new pimotion.py. Please note that
picamera feature has additional capability like lowLight setting for night time.
Regards Claude PageauLatest Update Information 3-May-2014
Here is a link to my latest Robin Cam video http://youtu.be/JnUaB1GVVTk
using motion detection with grive sync to my google drive capability. The YouTube video comments Includes instructions for downloading readme.txt and tar files, Also see links below. The tar file includes a compiled version of grive plus a setup script to install required libraries to save everyone the effort of compiling the grive code for the RPI.. The Robin Cam setup does not currently use the grive option since it can connect to my home network via wifi. See below for details of my remote 3000 km away camera setup that has to use grive.These files are on github.
Download setup instructions here https://raw.github.com/pageauc/pi-motio ... Readme.txt
Download tar file containing all the files here https://raw.github.com/pageauc/pi-motio ... motion.tar My Remote Security Camera Setup using grive
I have this setup working at a remote location 3000 km away and it allows me to monitor things. As the camera is on a park private network I cannot SSH into my RPI security camera so you have to take special precautions. My setup has a UPS and runs a cron job to reboot the RPI every night. The synchronization script is setup to prevent grive from activating unless there is camera motion activity detected, since grive can take a while to perform a sync even if no files have changed. The sync script runs on a cron job that checks every minute to see if there are files to sync otherwise it does nothing. If syncing is required the script has a time delay since motion detection usually involves more than one photo and you don't want to do a sync for just one file if you can avoid it. This sync cron job allows the camera to run in parallel with grive syncing activity. Here is my "Almost Like Being There" video created with MeWiG from the stills. Not much activity these days. https://www.youtube.com/watch?v=-igGzfY7uKs
This setup has been working like a Champ for several months, except for a slight problem for a day or two when google drive was having issues with syncing files from google down to my laptop (google drive internet files were OK so I knew RPI was successfully uploading files). Tried cleaning laptop files but eventually things mysteriously fixed themselves and no problems since. Previous information
Here is the link to my video on timelapse and motion capture with test video samples using the Raspberry Pi with camera module and modified python programing code from brainflakes for motion capture.
Part 1 https://www.youtube.com/watch?v=ZuHAfwZlzqY
Here is the link to the video on my Picam project to create a web page interface to the RPI camera module using python cgi and lighttpd web server.
Part 2 http://youtu.be/mtlZcCK5_dg
More information here from youtube description
This is an update to my previous video on Time Lapse and Motion Capture using the Raspberry Pi Camera Module. So far I have a rough web interface passing parameters to the raspistill program. The web server is obviously running on the Pi with the camera attached. The web server is out of the box lighttpd configured to allow running of python scriptings through the cgi module. Right now the web server permissions are liberal since it is running on a home network. This allows for easier debugging until everything is tested. btw I found a setting in Notepad++ that changes tabs to spaces. Just google if you need to set this item that is hidden deep in the menu system. Makes life a lot easier when programming in python with notepad++.
Below is my project feature list.
-------------- Picam project implementation details not in any particular order ---------------------T
- Implement remaining camera raspistill image settings functional throught the web form.
- Add raspivid specific settings where different from raspistill
- Add button to return camera settings to a known good.
- Implement time delay to schedule photo(s) to be taken at future time
- implement ymdhms or no date option for image file names to avoid using disk space for testing settings
- Implement field range checking to avoid invalid functions
- Implement runtime error recovery with raspistill. Not sure what the return codes are just yet.
- implement video streaming and encoding conversion to standard video
- Add Time Delay functionality with preview
- Add Photo navigation back and forth via list and/or thumbnails
- Implement save camera settings feature plus folder navigation
- Implement Load settings feature ....
- Add feature to Encode photo series into a timelapse or motion capture video
- Add folder and directory search for loading settingss
- Try to integrate motion capture to operate with Picam with web server
- Write help and instructions web page
- add link to camera cable logo at top of web page
- Implement mounting drives to allow saving photos across network
- add ability to script sending photos by email
- Implement user camera scripting language to allow settings, mode, time, etc features to automate camera operation.
- Optimize python/web coding to make more use of functions, passing parameters and looping to reduce code size
- Implement camera collision detection in case camera is busy running, timelapse, motion detection, still photo, etc.
- fix bug or work around problem with /dev/vchiq loosing permissions sometimes. May due to camera hanging.
- Add ability to automate image file prefix sequence numbers after count or time limit reached
- Add ability to cycle through a sequence to limit disk space usage (by time or disk space quota)
- Write help screens.
-------------------------------------------------- Thanks for Watching ---------------------------------------
To be Continued ......