SOHO Internet Camera CAS 230 & ZM 1.21.x

Add any particular hints or tricks you have found to help with your ZoneMinder experience.
Post Reply
Syl
Posts: 11
Joined: Mon Jul 25, 2005 7:19 am
Location: Romania

SOHO Internet Camera CAS 230 & ZM 1.21.x

Post by Syl »

Hi everybody!
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>
command should not return immediately. If it does (with or without an error mesage), you've got a problem; go check the logs.

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
The returned values are in bytes and should be larger than 134217728 (128 Mb). If these values are smaller than 134217728, you must increase the shared memory. Permanently you can do this by modifying the parameters kernel.shmall and kernel.shmmax from /etc/sysctl.conf. (If these parameters don't exist in sysctl.conf, create them) Attention: these new values won't be loaded until reboot and if you can't reboot your system soon, you can still increase the shared memory with these two commands:

Code: Select all

# echo NEW_VAL >/proc/sys/kernel/shmall
# echo NEW_VAL >/proc/sys/kernel/shmmax
e.g.: # echo 134217728 >/proc/sys/kernel/shmall

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
This camera can only capture and send images on 24bits, with 320*240 or 640*480 resolution. So you must set the monitors to grab images with there caracteristics.

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
So, in ZM_PATH_ZMS you can specify two values: /cgi-bin/zms or /cgi-bin/nph-zms. Try both...

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 :D

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:
#!/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
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 !

Have fun monitoring others with ZM ! :D
User avatar
zoneminder
Site Admin
Posts: 5215
Joined: Wed Jul 09, 2003 2:07 pm
Location: Bristol, UK
Contact:

Post by zoneminder »

Thanks for taking the time to post this, I'm sure it's going to be very useful to other members.

Phil
Solar
Posts: 13
Joined: Fri Aug 18, 2006 11:11 pm
Location: South Africa

Post by Solar »

Thanks very much for this post. If you're running CTU Linux the shared memory size is much to small to accomodate 640 x 480 streaming - I just increased the size, restarted ZM, and everything worked perfectly!!!
Post Reply