Video Surveillance system on Ubuntu 8.04 with Zoneminder

4 08 2008

In this scenario we will be using:

Hardy Heron ( Ubuntu 8.04 )
Packard Bell Easynote R0933
ZoneMinder 1.22.3 website
Panasonic BL-C1 network cameras

It is assumed that the machine is a fully working Lamp server.
If you don’t have that yet, here’s a quick setup.

First we need to install a few libraries to support Zoneminder :

sudo apt-get install libarchive-tar-perl libmime-perl libstdc++6 libjpeg62 ffmpeg
libarchive-zip-perl zlib1g libdate-manip-perl libwww-perl libdevice-serialport-perl

Afterwards, we grab the latest .deb from the repositories
http://packages.ubuntu.com/hardy/net/zoneminder

Installation should go on with no complications. If needed, fix broken dependencies with
sudo apt-get -f install

Instruct apache what to do with Zoneminder a force a reload:

sudo ln -s /etc/zm/apache.conf /etc/apache2/conf.d/zoneminder.conf
sudo /etc/init.d/apache2 force-reload

Finally point the browser at :http://your_server/zm

Technically this should be it.
I had a few problems though. After configuring a camera, i would get not video output whatsoever.
No images or events were being saved nowhere, and i kept getting the same errors on logs:

tail /tmp/zmwatch.log
08/04/2008 16:56:06.730254 zmwatch[10568].INF [Restarting capture daemon for New, shared memory not valid]
08/04/2008 16:56:07.058591 zmwatch[10568].INF ['zmc -m 3' starting at 08/08/04 16:56:07, pid = 10597]
08/04/2008 16:56:17.060594 zmwatch[10568].ERR [Can't get shared memory id '4b450003', 3: No such file or directory]
08/04/2008 16:56:17.061045 zmwatch[10568].INF [Restarting capture daemon for New, shared memory not valid]
08/04/2008 16:56:17.396844 zmwatch[10568].INF ['zmc -m 3' starting at 08/08/04 16:56:17, pid = 10610]
08/04/2008 16:56:27.398852 zmwatch[10568].ERR [Can't get shared memory id '4b450003', 3: No such file or directory]
08/04/2008 16:56:27.399334 zmwatch[10568].INF [Restarting capture daemon for New, shared memory not valid]
08/04/2008 16:56:27.731874 zmwatch[10568].INF ['zmc -m 3' starting at 08/08/04 16:56:27, pid = 10612]
08/04/2008 16:56:47.123690 zmwatch[10689].INF [Watchdog starting]
08/04/2008 16:56:47.124464 zmwatch[10689].INF [Watchdog pausing for 30 seconds]

Looking at the current allocated value of shared memory on my laptop:

cat /proc/sys/kernel/shmall
2097152

And the maximum i could get:

cat /proc/sys/kernel/shmmax
134217728

(Log in as root. sudo -i, otherwise you won’t be able to)

echo 134217728 >/proc/sys/kernel/shmall
echo 134217728 >/proc/sys/kernel/shmmax

This solved my shared memory problem. To make these value permanent, edit /etc/sysctl.conf :

kernel.shmall = 134217728
kernel.shmmax = 134217728

Done, done, and done.


Actions

Information

18 responses

9 08 2008
Matt

Thank you!! After poring over a dozen howtos and various other pages for Zoneminder it was yours that finally helped me get it working after hours of trial and error. The key was your bit about the shared memory fix which was the culprit. Thanks again.

9 08 2008
sid

I think at different points in time we were going through the same struggle.
Anyhow, i’m glad i could help ;).

The next bit regarding Zoneminder that i’m working on is the streaming of Asf video feeds as Mjpeg. Not enough info on the matter though.
Feel free to throw in some input if you come across any.

Best regards.
sid

11 08 2008
» Installer zoneminder sous ubuntu

[…] Source […]

18 08 2008
shantanu goel

Instead of using zoneminder, try “motion” by kenneth lavrsen at lavrsen.dk. It is the motion detection app and even includes a basic web server that you can enable so that you don’t have to install one on your system.
And on another note, you can even get realtime updates using it and my script at:
http://tech.shantanugoel.com/2008/05/14/keep-tab-on-home-security-with-a-webcam-and-twitter.html

18 08 2008
Sidrit Trandafili

Aight then, i’ll give that a shot. Thank you πŸ˜€

18 01 2009
DIY CCTV dengan zoneminder « things left unsaid

[…] walaupun zoneminder sudah termasuk dalam paket standar ubuntu, masih diperlukan sedikit langkah untuk mengaktifkannya: […]

2 07 2009
lptr

I’ve used Zoneminder 1.22.x before with 7.10. Now wanted it on Jaunty Jackalope (9.04). Here my short description without many side notes:

>>>>>>>>>>>
2009-07-02

Zoneminder Install on Ubuntu Server (32 Bit – tested)
==========================================
Ubuntu Server 9.04 using BTTV adapter card PV-155 from Bluecherry

$ sudo su
$ apt-get update
$ apt-get upgrade
$ apt-get install openssh-server

to configure static network
$ nano /etc/network/interfaces
auto eth0
iface eth0 inet static
address 192.168.10.222
netmask 255.255.255.0
gateway 192.168.10.254

$ sudo su
$ apt-get install apache2 php5-mysql zoneminder

>> input for mysql admin/

zoneminder runs inside Apache context so Apache must be reconfigured:
$ ln -s /etc/zm/apache.conf /etc/apache2/conf.d/zoneminder.conf
$ /etc/init.d/apache2 force-reload

The default mysql installation allows only local connects.
Default user is root with no password (this is an issue for hardening). To setup the database
for zm you need to run
$ mysql -u root -p >>>>>>>>>>>>>>>>>>>>
hope this helps others to speeding up their setup πŸ™‚

rob*

2 07 2009
lptr

recognized, that things have been trunkated 😦

for zm you need to run
$ mysql -u root -p < /usr/share/zoneminder/db/zm_create.sql

$ chmod 4755 /usr/bin/zmfix
$ zmfix -a
$ adduser www-data video

$ nano /etc/sysctl.conf
# Shared memory settings changed for ZoneMinder (ZM) add this at bottom (128 MB)
kernel.shmall = 134217728
kernel.shmmax = 134217728

$ apt-get install libavcodec-unstripped-52 libavdevice-unstripped-52 libavformat-unstripped-52 libavutil-unstripped-49 libpostproc-unstripped-51 libswscale-unstripped-0 ffmpeg

install cambozola
$ cd ~/tmp
$ wget http://www.charliemouse.com/code/cambozola/cambozola-latest.tar.gz
$ tar xvfz cambozola-latest.tar.gz
$ sudo cp cambozola-0.70/dist/* /usr/share/zoneminder/

Diag:
$ tail -f /var/log/messages

From another system run zm web config in web browser:
http://192.168.10.154/zm

Add New Monitor
(general tab)
c1 – name
Function – Monitor
Maximum FPS 5
Alarm Maximum FPS 8

(Source tab)
Device Path – /dev/video0
Device Channel – 0
Capture Width (pixels) – 320
Capture Height (pixels) – 240
leave everything else on defaults

Main screen *options* (right upper corner)
(Images tab)
Is the (optional) cambozola java streaming client installed (?) – check this

To enable cams 9..16 on Port 2 (this is the port closer located to mainboard)
$ nano /etc/modprobe.d/options
# BTTV card enabling cams 9..16
options bttv gbuffers=16 card=77,77,77,77

Some notes on PV-155 from Bluecherry and addressing the channels:
/dev/video0(0) /dev/video0(1)
ATTENTION:
It is /dev/video0…3 (0…3) there is not 4 or 5.

PV-155 has two octopus cables with 8 Ports each, plugged into connector DB1 und DB2.
DB2 connector is located closer to mainboard.
Every octopus cable has 4 blue (bl) and 4 green (gn) coax connections.

DB1:
vid1 (bl) = video0 (0)
vid1 (gn) = video0 (1)

vid2 (bl) = video1 (0)
vid2 (gn) = video1 (1)

vid3 (bl) = video2 (0)

For DB2 following is valid:
vid1 (bl) = video0 (2)
vid1 (gn) = video0 (3)

vid2 (bl) = video1 (2)
vid2 (gn) = video1 (3)

vid3 (bl) = video2 (2)

2 07 2009
lptr

ok this time all is up. πŸ™‚

hope this will help others.

rob*

6 11 2009
The Idiot

I’ve had no luck getting this to run on ubunto 9.10 or 8.04, did sever installs and shared memory changes. Keep getting :

11/06/09 11:52:40.809088 zmwatch[2372].ERR [Can’t get shared memory id ‘7a6d0001’, 1: No such file or directory]

Arrrrggghhhh!!!! Maybe a permissions issue? I have 1G ram on this ubunto 9.10 box and installed 1.24 zoneminder.

Please help, anyone!!! Please!!!

11 11 2009
Sidrit Trandafili

hello there.
sorry for the delay.

quick question then we take it from there.
what version of zm are you currently using?

11 11 2009
The Idiot

I’m currently trying on Ubuntu 9.10 running Zoneminder 1.24.1 with a USB camera and a Panasonic KX-HCM10 IP camera. Could it be my cameras?

Here’s my install steps:

sudo apt-get install zoneminder
sudo ln -s /etc/zm/apache.conf /etc/apache2/conf.d/zoneminder.conf
sudo /etc/init.d/apache2 force-reload
sudo adduser www-data video

updated sysctl.conf

sudo vi /etc/sysctl.conf
kernel.shmall = 134217728
kernel.shmmax = 134217728

reboot and restart ( several times)

Thanks

8 11 2010
indah cahyati

#vim /etc/sysctl.conf
ketika dienter untuk mengedit permanen shmall dan shmmax ko’ gx bisa ya, bagaimana cara mengeditnya ???

22 04 2011
Oleg

Thank you, this fix works for the latest Ubuntu 10.10.

4 07 2011
wareddekne

Guys i have zoneminder working but i somehow dont get the device linked or set up on zone minder.

i have a usb wireless network dvr.

It is a system that operates 4 cameras and connects via usb to pc.

any body that can assist me?

1 10 2011
Pena

try chmod 777 /dev/video0

29 02 2012
Lee

Also Please Note that if you dont clear your logs your system may exhibit the back screens as well, just hunted the problem down after days of pulling out my hair i came to the conclusion that because the logs were over 36gb in size each, that it was taking a massive amount of memory to access and write to them.
This is also why my box was only recording for a few days before running out of space and deleting the recordings from only a few days prior

30 03 2015
Diamond ...

Valid 01/04/2014 – 01/31/2016.

Leave a reply to lptr Cancel reply