Previous Post: Setting up your Raspberry Pi Camera
Once I set-up my Raspberry Pi camera, I wrote a simple script to take a picture from my camera every 2 minutes.
Option 1: Writing a Python Script
Initially I wrote a small Python code which takes a photo every 2 minutes from my Raspberry Pi Camera. The code can be found on my GitHub here.
Next I wrote a small shell script which can run my Python program and added a command to Crontab to run the shell script at start up.
Option 2: Run from Shell Script
The problem with Option 1 is that the camera is always on. To avoid this I ditched the python script and prepared a shell script that can directly take a picture from my camera.
For this I wrote a small shell script which can take a picture and save it to my desktop and added a command to Crontab to run the shell script every 2 minutes. (instead of @reboot, use */2 * * * *)
I attached the Raspberry Pi in my balcony as in the post below. A sample of half a day of photos is shown in the video above.
Camera V1.3 Specs - https://www.raspberrypi.org/documentation/hardware/camera/
ReplyDelete