Create your own security recording system with Raspberry Pi and Foscam

Foscam and Raspberry Pi recording system

I came across this project the other day and found it very interesting both to show you how to do it and to start distributing Foscam cameras, which it must be said, for chinese they are one of the best I've seen in terms of quality/price.. The idea is to create a closed recording circuit that can be accessed from anywhere, as we use Raspberry Pi as a switchboard for the cameras that we have configured.

Basically, what we will do is to order the cameras that when they detect movement, they save a capture via FTP in a specific folder on the Raspberry Pi.

The first step is common to almost all projects, we prepare the Raspberry Pi with RaspianI am not going to expand here because we have already explained it perfectly well in another article.

Materials

  • Raspberry Pi
  • uSD of 8Gb with Raspbian (it doesn't matter the capacity and the class as the ideal is to save the screenshots on an external HDD).
  • Power supply
  • Network cable.
  • Foscam camera, in this case we have used the FI8909W model.

Note: There is no need for a video connection, because once the project has been set up, we can remotely manage the system via VNC Viewer.

Using Raspberry Pi as an FTP server

With this, the camera will automatically upload a series of captures to the server once it detects motion, i.e, we will automatically save on the hard disk that we put in the Raspberry Pi images of everything that happens in front of our Foscam.

To set up the FTP server on the Raspberry Pi the software we are going to use is VSFTPD. We open a terminal session and start updating repositories:

sudo apt-get update

And then installing the programme:

sudo apt-get install vsftpd

Once installed we will need to change some parameters, so:

sudo nano /etc/vsftpd.conf

Setting up FTP server on Raspberry Pi

We are looking for the following lines, remove the front cushions and press Ctrl+O to save.

#local_enable=YES

#write_enable=YES

This will allow reading/writing by users of the programme.

We restart the service:

sudo service vsftpd restart

The FTP server is now installed, so we can move on to configuring the camera itself.

Configuring Foscam

Getting IP from Foscam

From Windows, we download the IP Camera Tool to find out the IP address of our camerawhich must already be connected to our network for it to be detected. We run it (no installation required) and if all goes well, we will obtain the local IP of our camera or cameras.

We put the IP in our browser and access the login panel, enter the credentials, by default admin for the user and the empty pass. If we are using Chrome, Safari or Firefox, we choose Server Push ModeIf we are using Internet Explorer, we will use ActiveX Mode and if we are using a mobile phone, we will use Mobile Phone.

Foscam Access

Now we will see the camera with some parameters that we can touch and we will have to look for the FTP settings (FTP Service Settings) at Device Management at the bottom left.

Once there, we introduce the Raspberry Pi IP (remember, from the Raspberry itself, you can get it using the command ifconfig), the username and password (Raspbian default), the username and password (Raspbian default pi / raspberry) and the directory in which you want to save the screenshots. In this last step I recommend you to create one on the desktop for testing purposes. and give it all permissions (right click Properties).

Foscam FTP configuration

Once we have all this, we click on save in the Foscam menu and then click on TestIf it does not give us an error message, it means that it is correctly configured.

Configuring alert actions

Now we are going to configure the camera so that when it detects movement it automatically sends the captures to the directory we have chosen on our Raspberry Pi.

We enter Alarm Service Settings and we will see two options, to capture when detecting sound or when detecting movement. This is obviously a matter of personal preference, but my tests were done with motion detection and the following parameters:

Foscam Alarm System

Once I had it perfectly adjusted, I left it overnight to test it and to my surprise in the morning, my cat had taken a few walks in the early hours of the morning. You can see some of the pictures in the gallery below.

If we have several cameras we can create different directories for each of them and thus have a complete security network at home or in the company at a very low cost.

22 thoughts on “Crea tu propio sistema de grabación de seguridad con Raspberry Pi y Foscam”

  1. Hi and thanks for the software, one question, how do I set up a hard disk and how do I set up a desktop using a SSH connection, thank you very much.

    Nacho

  2. Eduardo Lira

    Do you have a project to connect 4 IP cameras to the raspberry, store video and connect it to a screen via HDMI to see the images in real time?

Leave a Comment

Your email address will not be published.

en_GBEnglish
Scroll to Top