When the camera is recording function and falls for some reason. then when she rose again no records.
Configuration Camera:
General->
Name: 0042-SP
Source Type: Remote
Function: Record
Enabled: yes
Source->
Remote Protocol: HTTP
Remote Method: Simple
Remote Host Path: /axis-cgi/mjpg/video.cgi?resolution=320x240&compression=50&req_fps=2&text=0&date=0&clock=0
Buffers->
Image Buffer Size: 20
Warmup Frames: 25
Pre event image count: 10
Post event image count: 10
Stream Replay Image Buffer: 1000
Alarm Frame Count: 1
When the camera UP can see again but do not correctly recorded.
Error Log:
May 8 23:59:55 debian zmc_m224[11640]: INF [Debug Level = 0, Debug Log = <none>]
May 9 00:00:11 debian zmc_m224[11640]: INF [Starting Capture]
May 9 00:00:12 debian zma_m224[2942]: INF [0042-SP: 80619 - Closing event 42305, section end]
May 9 00:00:12 debian zma_m224[2942]: INF [0042-SP: 80619 - Opening new event 42329, section start]
May 9 00:03:58 debian zma_m224[2942]: INF [0042-SP: 81000 - Processing at 1.61 fps]
May 9 00:08:59 debian zmdc[29762]: INF [Starting pending process, zmc -m 224]
May 9 00:08:59 debian zmdc[11702]: INF ['zmc -m 224' started at 09/05/09 00:08:59]
May 9 00:08:59 debian zmdc[29762]: INF ['zmc -m 224' starting at 09/05/09 00:08:59, pid = 11702]
May 9 00:08:59 debian zmc_m224[11702]: INF [Debug Level = 0, Debug Log = <none>]
May 9 00:09:04 debian zmc_m224[11702]: INF [Starting Capture]
May 9 00:09:24 debian zmdc[29762]: INF [Starting pending process, zmc -m 224]
May 9 00:09:24 debian zmdc[29762]: INF ['zmc -m 224' starting at 09/05/09 00:09:24, pid = 11714]
May 9 00:09:24 debian zmdc[11714]: INF ['zmc -m 224' started at 09/05/09 00:09:24]
May 9 00:09:24 debian zmc_m224[11714]: INF [Debug Level = 0, Debug Log = <none>]
May 9 00:09:39 debian zmc_m224[11714]: INF [Starting Capture]
May 9 00:10:00 debian zma_m224[2942]: INF [0042-SP: 81531 - Closing event 42329, section end]
May 9 00:10:00 debian zma_m224[2942]: INF [0042-SP: 81531 - Opening new event 42341, section start]
May 9 00:12:58 debian zmdc[29762]: INF [Starting pending process, zmc -m 224]
May 9 00:12:58 debian zmdc[29762]: INF ['zmc -m 224' starting at 09/05/09 00:12:58, pid = 11734]
May 9 00:12:58 debian zmdc[11734]: INF ['zmc -m 224' started at 09/05/09 00:12:58]
May 9 00:12:58 debian zmc_m224[11734]: INF [Debug Level = 0, Debug Log = <none>]
May 9 00:13:03 debian zmc_m224[11734]: INF [Starting Capture]
May 9 00:15:29 debian zma_m224[2942]: INF [0042-SP: 82000 - Processing at 1.45 fps]
May 9 00:15:30 debian zmdc[29762]: INF ['zma -m 224' stopping at 09/05/09 00:15:30]
May 9 00:15:30 debian zma_m224[2942]: INF [Got signal 15 (Terminated), exiting]
Some times when restarting Zoneminder the camera record again.
in / tmp / leaves a directory with the format: zmswap-m224
224 is camera ID.
Thanks for your help !!
The cameras did not record again when they DOWN and they UP
- henriquejf
- Posts: 77
- Joined: Tue Feb 10, 2009 12:01 pm
- Location: Brazil
- henriquejf
- Posts: 77
- Joined: Tue Feb 10, 2009 12:01 pm
- Location: Brazil
wow, difficult to understand for me; when you say "the camera has a problem and then be fixed", how is that ? do you reset the camera, do you turn it off and on, do you remove it and then plug it back ?
maybe when the camera is working linux recognizes it as /dev/video0, and when it fails and comes back it comes as /dev/video1 , 2, 3... so you wont be able to configure it correctly under zm....
i actually dont think this problem is related to zm, but to the "camera that actually has a problem" as you say;
maybe when the camera is working linux recognizes it as /dev/video0, and when it fails and comes back it comes as /dev/video1 , 2, 3... so you wont be able to configure it correctly under zm....
i actually dont think this problem is related to zm, but to the "camera that actually has a problem" as you say;
-----------------------
Henrique Barbosa
Consultant
Juiz de Fora, MG - Brazil
Henrique Barbosa
Consultant
Juiz de Fora, MG - Brazil
The problem is not that the camera is up or down.
The problem is when the camera returns to UP, zma is no start.
then not start the recording.
but you can viewing.
Step 1:
Camera is UP
Zoneminder Recording OK
Zoneminder viewing OK
Step 2:
disconnect the power of the camera
Camera is DOWN (this is not the problem)
Step 3:
Connect the power of the camera.
Camera is UP
Zoneminder Recording FAIL (ZMA does not start automatically, need restarting zoneminder.) -> this is the problem
Zoneminder viewing OK
thanks for your patience!!
The problem is when the camera returns to UP, zma is no start.
then not start the recording.
but you can viewing.
Step 1:
Camera is UP
Zoneminder Recording OK
Zoneminder viewing OK
Step 2:
disconnect the power of the camera
Camera is DOWN (this is not the problem)
Step 3:
Connect the power of the camera.
Camera is UP
Zoneminder Recording FAIL (ZMA does not start automatically, need restarting zoneminder.) -> this is the problem
Zoneminder viewing OK
thanks for your patience!!
- henriquejf
- Posts: 77
- Joined: Tue Feb 10, 2009 12:01 pm
- Location: Brazil
ok, so i think its an easy workaround:
if restarting zm from time to time fixes the behavior, then make a new "cronjob" that restarts zm;
im my case, i use "service zm restart" when i need to restart it for other reasons or testing; if that works for you, then make a cronjob every x minutes with that command;
if you have webmin, its easy to set a new cronjob; if not have a look at
http://www.astahost.com/info.php/Cron-J ... t2324.html
or google to do that;
hope it helps !
if restarting zm from time to time fixes the behavior, then make a new "cronjob" that restarts zm;
im my case, i use "service zm restart" when i need to restart it for other reasons or testing; if that works for you, then make a cronjob every x minutes with that command;
if you have webmin, its easy to set a new cronjob; if not have a look at
http://www.astahost.com/info.php/Cron-J ... t2324.html
or google to do that;
hope it helps !
-----------------------
Henrique Barbosa
Consultant
Juiz de Fora, MG - Brazil
Henrique Barbosa
Consultant
Juiz de Fora, MG - Brazil
There are a couple scenerios you will want to address here.hmazzeo wrote:The problem is not that the camera is up or down.
The problem is when the camera returns to UP, zma is no start.
then not start the recording.
but you can viewing.
Step 1:
Camera is UP
Zoneminder Recording OK
Zoneminder viewing OK
Step 2:
disconnect the power of the camera
Camera is DOWN (this is not the problem)
Step 3:
Connect the power of the camera.
Camera is UP
Zoneminder Recording FAIL (ZMA does not start automatically, need restarting zoneminder.) -> this is the problem
Zoneminder viewing OK
thanks for your patience!!
The first is the possible loss of connection to the ZM server itself -- that is to say, the NIC entirely looses connectivity for a period of time. This is the easier of the two.
The second is a single camera becoming unresponsive, or temporarily loosing it's connection. This is the more complex issue of the two. (Has the camera crashed and need a cold boot? Did the cable get cut? Brown-out? etc.)
So to adress the first issue -- the ZM server temporariy looses its connection... on a Debian/Ubuntu based system, you can create a if-up.d script which will restart zoneminder when the nic obtains a new IP and comes back up. The following script is the one I use:
/etc/network/if-up.d/zoneminder.if-up.d
Code: Select all
#! /bin/sh
set -e
# Don't bother to restart sshd when lo is configured.
if [ "$IFACE" = lo ]; then
exit 0
fi
# Only run from ifup.
if [ "$MODE" != "start" ]; then
exit 0
fi
if [ "$METHOD" != "NetworkManager" ]; then
exit 0
fi
# Is /usr mounted?
if [ ! -e /usr/bin/zm ]; then
exit 0
fi
/etc/init.d/zoneminder restart >/dev/null 2>&1 || true
exit 0
The second scenerio, and probably the one you are most concerned with, is as I said - much more difficult to handle. However -- assuming the issue for the camera is limited to either power failure or connectivity issues, you can probably work around the issue by creating a cronjob which pings the cameras, and if the result is a failed ping, restart zoneminder. (For the record, I hate using cron in place of proper handling of real-time events.)
cron entry example
Code: Select all
# Run this every 5 minutes to make sure our cameras are up.
# IP addresses and hostnames are valid, no known limitation at this time.
# Bad hostnames and IPs will cause zoneminder to restart, use caution.
*/5 * * * * checkcam.sh 192.168.0.100 192.168.0.101 example.camera.host.com
Code: Select all
#!/bin/bash
#
# checkcam.sh
#
# INPUT: IP addresses or hostnames passed via command line.
# OUTPUT: Shouldn't really be any other than restarting zoneminder upon
# a detected failure.
#
# Send a single ping and exit.
PINGCMD='ping -c 1 -q'
IPLIST=($*)
# Ping each camera IP or hostname in the array one at a time.
# If ANY camera is unresponsive, exit the function with status 1 (error).
function testCameraStatus() {
for ip in ${IPLIST[@]}; do
$PINGCMD $ip || return 1
done
}
# Call testCameraStatus function and restart zoneminder if any camera fails
# to respond.
testCameraStatus || /etc/init.d/zoneminder restart
There likely is a much better way to handle this.... but I am not sure what that would be at the moment.