ISpy and Raspberry PI: Installing the open source Agent DVR
Last Updated on 22nd April 2024 by peppe8o
In this tutorial, I’m going to show you how to install the Agent DVR of iSpy on a Raspberry PI computer board.
Tired of having a lot of low-cost surveillance cameras, everyone with its app and everyone requiring a fee for cloud storage? With iSpy and Raspberry PI, you can get your self-hosted and open-source DVR compatible with hundreds of IP cameras.
What is iSpy and Agent DVR
iSpy is an open-source video surveillance application, widely spread around the world. It’s compatible with a lot of consumer webcams and IP cameras. The list of compatible cameras can be found at the following link: https://www.ispyconnect.com/cameras. Please remember that their software is free only for personal, local use.
Agent DVR is a standalone replacement for iSpy that runs as a service, uses less CPU and features a web user interface that is accessible from a web browser. Moreover, differently from iSpy the Agent DVR can be installed on a Linux server, thus being a must to be tested in low-cost computers like our Raspberry PI.
So, from what I understand from the developer page, the difference between iSpy and Agent DVR is that the first one runs as a Service on the web, where you can connect your cameras for central monitoring, while Agent DVR works as a service that can be installed locally in your home network and manages your cameras directly from there.
Agent DVR offers a lot of features. Besides supporting a long list of cameras, it offers motion detection (with intelligent face detection), alert generation, customizing actions on alerts, and so on.
Finally, you can also set the iSpy Agent DVR to run in kiosk mode with a touchscreen display by referring to my Raspberry PI Kiosk: creating a touchscreen, informative stand.
What We Need
As usual, I suggest adding from now to your favourite e-commerce shopping cart all the needed hardware, so that at the end you will be able to evaluate overall costs and decide if to continue with the project or remove them from the shopping cart. So, hardware will be only:
- Raspberry PI 3 Model A+ (including proper power supply or using a smartphone micro USB charger with at least 3A) or newer Raspberry PI Board
- high speed micro SD card (at least 16 GB, at least class 10)
- IP Cameras (this tutorial uses as an example the good IeGeek IG62)
Step-by-Step Procedure
Prepare Operating System
Start installing the Raspberry PI OS. Please note that you must use the 64-bit Raspberry PI OS version.
You can use Raspberry PI OS Lite (for a fast, headless OS) or Raspberry PI OS Desktop (with a complete desktop environment). In case you are choosing the kiosk mode, you will need the OS Desktop.
Make sure your OS is up to date. From the terminal, please issue the following command:
sudo apt update -y && sudo apt upgrade -y
We also need curl:
sudo apt install curl -y
Install the Agent DVR
Installing the iSpy Agent DVR is really simple. Everything is done with the following command:
bash <(curl -s "https://raw.githubusercontent.com/ispysoftware/agent-install-scripts/main/v2/install.sh")
It will require a few minutes, as it will have a lot of packages to install. Quite to the end, it will require a final installation confirmation:
Install AgentDVR as system service (y/n)?
Please answer “y”, and finally you will get:
Created symlink /etc/systemd/system/multi-user.target.wants/AgentDVR.service → /etc/systemd/system/AgentDVR.service.
started service
go to http://localhost:8090 to configure
Now you are ready to complete the installation from a browser. With a remote computer (for RPI OS Lite) you will need to use the RPI IP address as the URL, followed by the “8090” port. As mine RPI has IP 192.168.1.177, I will access it with the URL http://192.168.1.177:8090, so getting the following page:
Select your language and click “OK”. A warning will appear as your browser may require permission to access the camera:
Click OK. The next screen will show you the links to get video guides for setting up your iSpy.
Press OK. Finally, you will reach the iSpy home:
Now, let’s look at some configurations.
Setup iSpy Agent DVR Access Password
Click the “Server Menu” icon on the top-left side of the page:
Scroll down the popup window to select “Configuration” -> “Settings”:
In the next window, please select the dropdown menu with the “General” label to switch to Local Server:
Here you will be able to enter your username and password to access the iSpy Agent DVR:
Once set, scroll down to confirm with the “Ok” button.
Reloading the page will now result in the browser asking for access credentials:
Add Your First Camera
Now we are ready to add our cameras. For this example, I will use my IeGeek IG62.
From the Server menu, this time please select “New Device” within the Devices list:
In the next window, you can choose the default Grid Slot by clicking on it:
Please select the “IP Camera Wizard” button:
Then you can add a few more settings, then press “Ok”:
We reach now the camera settings:
The “Make” area requires identifying the camera vendor and model. After starting to type the first digits of your vendor or model, the form will propose a list. As this list is limited, I suggest starting to type directly your camera model or the full string composed as “vendor: model”. For example, mine IeGeek IG62 will match the string “Iegeek: ig62”:
The username and password depend on the cameras. Usually, these are not the same that you use to enter the camera app, even if they can be set from their apps. Sometimes, when the username change option is missing this may be a default value that can be found with a little research on forums. For example, my IeGeek IG62 camera has “admin” as user and you can change the password from its CamHi app.
Once set, please click the “next” button.
The following window will ask for the URL in order to connect your camera. With my IeGeek camera, it has been really simple because it has been enough to add the HTTP protocol to my camera IP address. Please note that you will need to assign a static IP address to your camera in order to avoid IP changes on router reboot, even if the modern routers are enough smart to reassign the same IP to the same device on reboot.
Please click the Next button. The iSpy Agent DVR will start a scan to discover what services are available for your camera and will propose all the available to you:
The Onvif (Open Network Video Interface Forum) should be the most complete, where available, but you can choose your favourite connection type by clicking the “Use” button at the right of your option.
Finally, the full options will be available to you for more customization. In the meanwhile, your video will probably start running in the background.
You can go on with customization or just click the “Ok” button at the bottom of this page. You can change settings at every moment with a right-click from the mouse on the camera and then selecting “Edit”.
Follow up
From here you will be able to add customizations to your Agent DVR installation. A possible need may be adding external storage to save the recordings. Raspberry PI OS Lite doesn’t mount external USB drives automatically by default. You can mount automatically external storage devices by referring to my Automount USB storage with Raspberry PI OS Lite: fstab and autofs.
Also, you can go on with more customization options by using the official AgentDVR User Manual.
What’s Next
If you want to discover many other projects for your Raspberry PI, you can take a look at peppe8o Raspberry PI tutorials.
Enjoy!
You can also run Plate Recognizer Snapshot SDK on the Pi! This way, you can get license plate recognition alongside Agent DVR. Just FYI, Plate Recognizer already has a pre-integration with Agent DVR (https://platerecognizer.com/vms-integrations/agent-dvr-ispy/). More info on Plate Recognizer: https://platerecognizer.com/
Great write-up! Does Agent DVR require, or benefit from, the 64-bit version of the RPi OS? And, if the 64-bit version is used, do you recommend using “zram” as a means to protect the SD card from the significant memory swap space requirements of this version of the OS? Thanks! – Duane
AgentDVR is NOT open source as far as I know! It’s free, and probably the best DVR out there, but if true FOSS is important, see this: https://github.com/ispysoftware/iSpy/issues/109
Rpi 3B inadequate in my opinion, could not get a clean feed from 2 cameras, terrible lag.
I apologize if I ask for help, but unfortunately I’m having a problem: I carefully followed the installation procedure, and I didn’t get any errors, so it seems that everything went perfectly, however, when I try to connect to:
http://192.168.1.130:8090
it doesn’t connect, ERR_CONNECTION_REFUSED.Do you have any suggestions please
Thank you
Hi Arnaldo,
yes, I just checked that there’s an update in the path for the installation script. So, I just updated the tutorial:
1. added the line with the command to install curl (sudo apt install curl -y)
2. updated the install script path (the new path includes a “v2” between “main” and “install.sh”).
Please, can you try it now?
Grazie,
Giuseppe
Thank you for the quick reply. I did it all again but nothing changed.
I saw later that the same instructions were available at the link: https://www.ispyconnect.com/download.aspx?utmzz=utmcsr%253Dgoogle%257Cutmcmd%253Dorganic%257Cutmccn%253D%28not%2520set%29%257Cutmctr%253D%28not%2520provided%29&webuid=4vd3t 8, selecting DVR Agent – Linux/ macOS/ RPi, and pressing the Download button.
Tried with both RPi3B+ and RPi4-8GB, same behavior. It seems that no web service is available trying to access the RPi’s IP 192.168.1.130:8090. both from Windows 10 laptops and from smartphones with Chrome, Firefox and Edge.
Normally on Rpi4 I use Openhabian which I normally target at port 8080.
I don’t understand but I don’t know how to investigate further
In any case, thanks 1000
Arnaldo
It’s really strange as I tested it this morning with a Raspberry PI Zero 2 W and it worked. I started from a fresh Raspberry PI OS Lite installation, and I ca see that it work both from:
pi@raspberrypi:~ $ netstat -peanut | grep ":8090"
(Not all processes could be identified, non-owned process info
will not be shown, you would have to be root to see it all.)
tcp 0 0 0.0.0.0:8090 0.0.0.0:* LISTEN 1000 14627 325/Agent
tcp 0 0 192.168.1.18:8090 192.168.1.111:61757 ESTABLISHED 1000 16724 325/Agent
tcp 0 0 192.168.1.18:8090 192.168.1.111:61713 TIME_WAIT 0 0 -
and
pi@raspberrypi:~ $ ps -ef | grep Age
pi 325 1 27 17:40 ? 00:00:53 /home/pi/AgentDVR/Agent
pi 997 887 0 17:43 pts/0 00:00:00 grep --color=auto Age
please, can you check that you have the same outputs from the 2 commands?
This is the result of the first command:
arnaldo@raspberrypi:~ $ netstat -peanut | grep “:8090”
(Not all processes could be identified, non-owned process info
will not be shown, you would have to be root to see it all.)
arnaldo@raspberrypi:~ $
and this is the second command:
arnaldo@raspberrypi:~ $ netstat -peanut | grep “:8090”
(Not all processes could be identified, non-owned process info
will not be shown, you would have to be root to see it all.)
arnaldo@raspberrypi:~ $
I see that in the second command I didn’t get the same answer as you, I must admit my lack of experience, so I don’t know the meaning of the answers to these commands, and consequently how to make any corrections.
Thank you very much for your availability.
Arnaldo
Are you running on Raspberry PI OS?
I can’t see any result from these commands.
Please, can you try with a free MicroSD card, installing the OS with the following tutorial?
http://peppe8o.com/install-raspberry-pi-os-lite-in-your-raspberry-pi/
For history and for the users reading this comment thread, the problem has been fixed by using the 64-bit Raspberry PI OS version. Thanks to Arnaldo for the feedback
Ciao Giuseppe
mi risparmio il traduttore Google, perchè ho visto che possiamo condividere l’Italiano.
Ho rifatto l’installazione decine di volte, ho provato fino a 5 diverse schede MicroSD seguendo sia l’installazione con Raspberry Pi Imager che con Etcher, con adattatore MicroSD-USB che con Adattatore MicroSD-SD, non riscontrando mai alcun apparente anomalia. Ho pure evitato di creare l’utente: arnaldo e fatto invece quello pi, pensando che potesse in qualche modo interferire. Ogni volta sembra che tutto vada a buon fine, ma il risultato è sempre lo stesso.
Vorrei inviarti l’output dell’installazione dell’Agent, che però essendo molto lungo, evitare di fare un post kilometrico. Ho notato che ci sono 3 righe sospette, dove compare la scritta: Failed, e poi la seguente: E: Invalid operation unzip.
Eventualmente se lo ritieni opportuno e me lo acconsenti, te la invio per mail.
Intanto Grazie e buona giornata
Arnaldo
Scrivimi a giuseppe@peppe8o.com
there is something missing, you have to be root for the script, if not it runs but will not work
Hi. When I wrote this tutorial I personally tested it in my Raspberry PI and worked. Do you tested it and got errors?