Raspberry Pi as a surveillance camera - how it works
With the Raspberry Pi and a surveillance camera, you can assemble a surveillance system that automatically records when it moves. This works, for example, with the "Motion" software.
The right camera for the Raspberry Pi surveillance system
The prerequisite is of course a Raspbery Pi with the installed operating system Raspbian. You also need a camera.
- There are few requirements when choosing the camera. However, it should be compatible with the V4L driver (Video for Linux) and also appear under the Raspbian devices as "/ dev / video0".
- Almost all commercially available webcams meet this requirement. However, you can also find a list of compatible webcams on elinux.org.
- You should supply the camera with external power via a USB hub. When in doubt, the Raspberry Pi may not be supplying enough power.
- The camera module specially developed for the Raspberry is not necessarily recommended as it only becomes compatible with the Linux drivers with considerable additional effort.
- Use the "dmesg | tail" command to check whether the camera is working.
Raspberry Pi as surveillance camera: install motion
Together with the "Motion" software, you can turn the camera and the Raspberry into a functioning surveillance system.
- Motion is an open source software that addresses the device "/ dev / videoX" and streams the video.
- Enter two lines in the console to install Motion: "sudo apt-get update" and "sudo apt-get install motion".
- If you want Motion to always run at system start, edit the "/ etc / default / motion" file. After "start_motion_ daemon", replace the "no" with "yes".
Test and configure the monitoring system with Motion and Raspberry Pi
After installation, you can test the completed monitoring system and then configure it.
- You can test the system directly by starting Motion manually with "sudo motion".
- In the last line of the following edition you will find the port under which you can find the stream. "[1] Started stream webcam server in port 8081"
- So you know on the one hand that your hardware works and on the other hand where you can find the stream. If you now move the camera, it starts taking pictures automatically and saves them under "/ tmp / motion".
- Via "localhost: 8081" you get the current stream on the Raspberry.
Raspberry Pi - the most bizarre projects
In the next practical tip you will find the 5 best extensions for the Raspberry Pi.