I had some trouble setting up this camera but I managed to make it work. I can now help others and thank ZM developers for this wonderfull software, by sharing my experience here...
First of all, let's meet the camera... It's CAS-230 - SOHO Internet Camera. I've used a cable to connect it to my network.
I've used ZoneMinder 1.21.0 (on a ZoneMinder LiveCD installed on the hard drive) and ZoneMinder 1.21.3 (on Mandrake 10.0)
I would like to start with some delicate settings that you must look upon when something goes wrong:
ZM_OPT_REMOTE_CAMERAS obviously it must be checked
ZM_OPT_USE_AUTH unfortunately it doesn't work in the ZM 1.21.3 installed on mdk 10.0. Please help!
ZM_PATH_LOGS /var/log/zm should be here, so you can easily locate the log files
ZM_COLOUR_JPEG_FILES not necesary
ZM_NETCAM_REGEXPS (doesn't exist in 1.21.0) unchecked
ZM_HTTP_VERSION I've put 1.1 on 1.21.0 and 1.0 on 1.21.3
ZM_HTTP_TIMEOUT >= 2500
ZM_WEB_REFRESH_METHOD http
ZM_VIDEO_STREAM_METHOD jpeg
Tips'n'Tricks:
The
Code: Select all
$ zmc -m <monitor_ID>
Shared memory (see the first problem) is calculated on the following formula: ring buffer size * image width * image height * 3 (for 24 bits images) + a bit of overhead. So if for instance you were using 24bit 640x480 (and you will use this setting on this camera) then this would come to about 92Mb if you are using the default buffer size of 100.
The first problem: shared memory
Solve it by increasing the shared memory!
The shared memory currently alocated can be displayed with the following commands:
Code: Select all
# cat /proc/sys/kernel/shmall
# cat /proc/sys/kernel/shmmax
Code: Select all
# echo NEW_VAL >/proc/sys/kernel/shmall
# echo NEW_VAL >/proc/sys/kernel/shmmax
The second problem: Not a JPEG file: starts with 0x48 0x54
Code: Select all
[/home/user]# zmc -m 1
Not a JPEG file: starts with 0x48 0x54
The third problem: The monitor doesn't display anything, the ZM logs seem to find everything ok, but in /var/log/messages you get error messages like these:
Got TERM signal, exiting
Select error: Interrupted system call
Shared memory not initialised by capture daemon
etc...
Take a look upon ZM_PATH_ZMS. Normally, in /var/www you should have a cgi-bin directory containing at least two files:
Code: Select all
[/var/www/cgi-bin]# pwd
/var/www/cgi-bin
[/var/www/cgi-bin]# ls
nph-zms zms
The forth problem: The camera jams.
I don't know why, but it does. If ZoneMinder doesn't receive images anymore, the camera doesn't respond to pings, you should restart the camera by shutting it down for a few seconds... These days it's been very hot in here and maybe the camera doesn't really stand the heat
The fifth problem: ZoneMinder fills the hard drive with tons of jpegs.
I've made a script to clean up the mess. Use it wisely:
I guess this is all and I hope someone will find this usefull someday. If you have something to add, say it loud and clear !#!/bin/bash
# Constants:
partition=/var/www # the partition where ZM saves the jpegs
percentMaxim="97%" # maximum load
X=2 # see below
directory=/var/www/html/camera/events/2 # the directory containing the jpegs (the last digit is the monitor ID)
# Let's see how loaded is the partition
percentLoad=$(df -h | grep $partition | awk '{print $5}')
if [[ "$percentMaxim" < "$percentLoad" ]] || [ "$percentLoad" == "100%" ];
then # we must erase directories older than X days
find $directory -type d -mtime +$X -exec rm -rf {} \;
fi
exit
Have fun monitoring others with ZM !