SourRon, I think you have some leading spaces in the script that prevent it to be able to execute. Or your script is not in linux-format.
To make is easy, I uploaded the script to
http://pastebin.com/yH7JHz9w and here comes a step by step instruction to get it working on your pi:
1. Open a terminal on your pi. If you have a Keyboard and a Screen attached to your pi, just start your pi. If you see the command line, you have your terminal ready. If you see a graphical desktop, you must double click on the "Terminal"-Icon. You can also ssh from a remote computer to your pi. If you see a black screen and a prompt (e.g. "pi@raspberrypi ~ $"), you are ready with step 1.
2. You need to install PIL to run this script. Type
Code: Select all
sudo apt-get install python-imaging-tk
in the terminal window to do this.
3. Download the script to your pi. To do this, enter the following code in the terminal:
Code: Select all
wget -O - http://pastebin.com/raw.php?i=yH7JHz9w | tr -d '\015' > ~/picam.py
Explaination for experts: The wget-command downloads the given URL, the "tr -d" deletes the Carriage Return because the script is in windows-format with CR LF instead of unix-format with just LF.
4. Make the script executeable by typing:
5. Create the folder for the pictures:
6. Start the script by typing:
the script is now running and taking pictures
7. To stop the script, hit the "STRG" and the "c"-key on the same time. in some cases, the "STRG"-Key is the "CTRL"-Key
8. You can adjust the setting of the script, e.g. if you want to flip your images (see cameraSettings in the script) or if you want to change the resolution of the saved pictures.
To open the script in an editor, type
See the instructions on the bottom of the editor window to see how to use the nano editor.
9. If you want to prevent, that moving trees trigger your motion detection, you should set the variable
debugMode in the script to value
True. Open a editor (e.g. nano of step 8) and change line 66:
debugMode = True
Then start your script, wait until some pictures are saved, then stop the script. In your picture-folder, you will find a Bitmap-Picture called
debug.bmp. Use this picture to determine, which pixel you want to exclude from your motion detection. Open this picture in a picture-viewer, zoom in, and count the pixel.
Read the lines 42 to 66 of the script to see how you have to adjust the variables
testBorders and
testAreaCount.
Save your changes in the script, start it, wait for some pictures, stop the script, and check the
debug.bmp to see if you have choosen the right pixel.
When you are finished, set
debugMode = False.
More description see above:
http://www.raspberrypi.org/phpBB3/viewt ... 67#p391667
10. If you want to auto-start the script on system-boot, read the description above:
http://www.raspberrypi.org/phpBB3/viewt ... 00#p392700
11. If you want to save the pictures on a remote unix-server, see the description above:
http://www.raspberrypi.org/phpBB3/viewt ... 89#p392089 and
http://www.raspberrypi.org/phpBB3/viewt ... 30#p392630
Line 84:
subprocess.call("raspistill %s -w %s -h %s -t 200 -e jpg -q %s -n -o - | ssh username@servername 'cat >%s'" % (settings, width, height, quality, filename), shell=True)
Disable keepDiskSpaceFree:
Line 81:
# keepDiskSpaceFree(diskSpaceToReserve)
PS: sorry for bad english, auf Deutsch könnte ich alles viel besser erklären!