Axis motion detection.. what am I missing?

Forum for questions and support relating to the 1.24.x releases only.
Locked
jbmia
Posts: 50
Joined: Sat Jul 30, 2011 1:56 pm

Axis motion detection.. what am I missing?

Post by jbmia »

Hey guys,

I've followed the wiki here: http://www.zoneminder.com/wiki/index.ph ... nDetection and I'm not able to generate any triggered events. Can anyone lend a hand? This is driving me nuts.. From all the forum posts, it should just work... Per the following, I'm getting the cam to send the tcp message and zmtrigger is doing something with.. not sure what, but I'm not getting any events.

- OPT_TRIGGERS is checked and monitor is set as enabled and in NODECT mode.

Here are the mods to zmtrigger.pl:

Code: Select all

sub handleMessage
{
        my $connection = shift;
        my $message = shift;

       #  CUA  - Axis camera send the message quoted with"
       #  CUA  - Also Axis camera cannot save the plus sign which
       #  CUA  - possibly exists in the 1|on+20|score|cause|text|showtext formatted msg
        $message=~ s/^\"//g;
       	$message=~ s/\"$//g;
        $message=~ s/on /on\+/;
       #  CUA - end of modifications



        my ( $id, $action, $score, $cause, $text, $showtext ) = split( /\|/, $message );
        $score = 0 if ( !defined($score) );
        $cause = "" if ( !defined($cause) );
        $text = "" if ( !defined($text) );

Code: Select all

# Include from system perl paths only
use ZoneMinder;
use ZoneMinder::Trigger::Channel::Inet;
#cuause ZoneMinder::Trigger::Channel::Unix;
#cuause ZoneMinder::Trigger::Channel::Serial;
use ZoneMinder::Trigger::Connection;

my @connections;
push( @connections, ZoneMinder::Trigger::Connection->new( name=>"Chan1", channel=>ZoneMinder::Trigger::Channel::Inet->new( port=>6802 ), mode=>"rw" ) );
#cuapush( @connections, ZoneMinder::Trigger::Connection->new( name=>"Chan2", channel=>ZoneMinder::Trigger::Channel::Unix->new( path=>ZM_PATH_SOCKS.'/zmtrigg$
#cuapush( @connections, ZoneMinder::Trigger::Connection->new( name=>"Chan3", channel=>ZoneMinder::Trigger::Channel::File->new( path=>'/tmp/zmtrigger.out' ),$
#cuapush( @connections, ZoneMinder::Trigger::Connection->new( name=>"Chan4", channel=>ZoneMinder::Trigger::Channel::Serial->new( path=>'/dev/ttyS0' ), mode=$

zmtrigger.pl is running:

Code: Select all

# ps aux | grep zmtrigger
apache   18233  0.1  0.2 192208 10988 pts/0    S    12:01   0:03 /usr/bin/perl -wT /usr/local/bin/zmtrigger.pl
I've configured my Axis 216FD and my Axis 225FD properly as verified by the following ngrep output:

Code: Select all

ngrep port 6802
T 192.168.1.105:1093 -> 192.168.1.2:6802 [AP]
  "59|on 5|5|Motion|Motion|Motion".
and here we can see the zmtrigger.log:

Code: Select all

==> zmtrigger.log <==
08/19/2011 12:33:49.060153 zmtrigger[18233].INF [Trigger 'on' 'Motion']
08/19/2011 12:33:53.925921 zmtrigger[18233].INF [Trigger 'on' 'Motion']
08/19/2011 12:33:55.180129 zmtrigger[18233].INF [Found actions expiring at 1313771634]
08/19/2011 12:33:55.180341 zmtrigger[18233].INF [Found action '59|cancel']
08/19/2011 12:33:55.180587 zmtrigger[18233].INF [Cancelled event]
08/19/2011 12:33:59.190240 zmtrigger[18233].INF [Found actions expiring at 1313771638]
08/19/2011 12:33:59.190429 zmtrigger[18233].INF [Found action '59|cancel']
08/19/2011 12:33:59.190611 zmtrigger[18233].INF [Cancelled event]
Both cams send tcp packets with results detailed above... I'm pretty confident this isn't a cam problem based on the ngrep results and they both work fine with in MODECT mode. Again, they're currently in NODECT mode.

What throws me in the zmtrigger.log is that it's picking up an "'on' Motion" but it's not saying it's for Monitor 59. It's not till the action "'59|cancel'" is displayed do I see that it was tied to Monitor 59... Is this normal?? Does log above look normal for this config??

Another thing that throws me is that zma is running for that monitor even though it's in NODECT mode... is this normal??

Code: Select all

08/19/2011 12:35:13.265444 zmdc[18153].INF ['zma -m 59' starting at 11/08/19 12:35:13, pid = 26257]
Anything else I might be overlooking on this?

Thanks for any advice!!

jbmia
snake61
Posts: 64
Joined: Thu Jul 17, 2008 1:44 pm
Location: South Carolina

Re: Axis motion detection.. what am I missing?

Post by snake61 »

See you gotta lotta help. I recal a fews years ago trying to get the Axis cameras to work. Followed the Wiki but couldn't get ti to work.

I believe you have to go into the camera itself, and there is a setting you have to check/or uncheck which I think allows an anonymous login to the camera. Ill try to find the thread and emil it to you if this doesn;'t help. Im not a Linux guru so that's the extent of my help. I have got Axis to work.
Thanks for all the Help.
New to Linux
jbmia
Posts: 50
Joined: Sat Jul 30, 2011 1:56 pm

Re: Axis motion detection.. what am I missing?

Post by jbmia »

Thanks for the reply...

Never had a problem getting the camera to work.. I pass the user/password in the monitor config along with the ip address.. When in MODECT mode, alarms go off on motion with no problem.. All the zone and monitor configs work fine. What doesn't work is actually generating an event based on the tcp trigger from the camera when the monitor is in NODECT mode...

I troubleshooted it pretty good I think.. I've verified that the camera is sending the appropriate tcp messge with ngrep.. I've triple check my zmtrigger.pl changes to make sure I didn't screw that up... and I've validated that zmtrigger.pl is running and it is doing at least "something" with the tcp message... Whether it's doing the "right" thing or whether something is broken in the linkage between zmtrigger and whatever process actually creates the event in the database is what I"m wondering... Something is broken or not properly config'd somewhere in there...

What it smells like to me.. from reading the logs, is that zmtrigger is picking up an "on" trigger, but it doesn't know that it's for monitor 59 and thus can't create the event... But, I'm not sure of that.. I only think that because zmtrigger specifies monitor 59 in the "cancel" portion of the log, but monitor 59 is never mentioned in the "on" portion of the log?? Shouldn't there be something like a "[Found action '59|on]" and a" [59| created event]"?? Something like those??

Here's the zmtrigger.log again for reference:

Code: Select all

		
==> zmtrigger.log <==
08/19/2011 12:33:49.060153 zmtrigger[18233].INF [Trigger 'on' 'Motion']
08/19/2011 12:33:53.925921 zmtrigger[18233].INF [Trigger 'on' 'Motion']
08/19/2011 12:33:55.180129 zmtrigger[18233].INF [Found actions expiring at 1313771634]
08/19/2011 12:33:55.180341 zmtrigger[18233].INF [Found action '59|cancel']
08/19/2011 12:33:55.180587 zmtrigger[18233].INF [Cancelled event]
08/19/2011 12:33:59.190240 zmtrigger[18233].INF [Found actions expiring at 1313771638]
08/19/2011 12:33:59.190429 zmtrigger[18233].INF [Found action '59|cancel']
08/19/2011 12:33:59.190611 zmtrigger[18233].INF [Cancelled event]
I'm sure there aren't that many folks using this functionality and maybe a handful that actual cruise around here on a regular basis, hopefully one of them will take a swing by and have a look at this issue. Otherwise, perhaps someone who knows the relationship between zmtrigger and whatever process creates the events can clarify the situation? Is my assessment above correct?

Thanks again snake61!

update: I ran debug and I'm not seeing anything there either.. 5 is like drinking from a fire hose and it's that way till I turned it down to 2 and then I don't get anything related to this issue anyway... Just thought I'd throw that out there as well.. I put zmtrigger in "EXTRA_DEBUG_TARGET" and I don't get anything..

jbmia
jbmia
Posts: 50
Joined: Sat Jul 30, 2011 1:56 pm

Re: Axis motion detection.. what am I missing?

Post by jbmia »

(bump)...
Locked