zmtrigger.pl

Forum for questions and support relating to the 1.25.x releases only.
Locked
Simon
Posts: 19
Joined: Tue Jan 24, 2006 8:35 pm

zmtrigger.pl

Post by Simon »

Hi,

I am trying to get zmtrigger.pl to work. I have some external sensors connected to insteon devices and my goal is to get my Isy controller to cause events using zmtrigger.

So far I am just testing the basics. Starting zmtrigger.pl and then using telnet to connect to port 6802 and type in the command by hand. Sadly however, so far I haen't been able to get an event to fire off.

When I use telnet I enter the command:

Code: Select all

1|on+30|255|cause|text|showtext
I see the following in the window where zmtrigger.pl is running in the foreground:

Code: Select all

Use of uninitialized value $data in pack at /usr/share/perl/5.12.4/ZoneMinder/Memory.pm line 460.
However, I do see the following in the logs:

Code: Select all

2012-05-10 15:30:41.448200	zmtrigger	7081	INF	Trigger 'on' 'cause'
However no event is created. Whats interesting is that if I do the same thing with monitor 2 I get an error in the logs, despite the fact I do have a monitor 2.

Code: Select all

2012-05-10 15:32:20.733360	zmtrigger	7081	WAR	Can't find monitor '2' for message '2|on+30|255|cause|Text|showtext'	zmtrigger.pl
The same happens if I use the name rather than the id.

I am using mastertheknife's version which is 1.25.0. I was wondering if perhaps the Perl error could be caused by the fact I am using a ramdisk and mapped memory rather than shared memory.

If anyone has some pointers I'd appreciate it.

Thanks,
Simon
mastertheknife
Posts: 678
Joined: Wed Dec 16, 2009 4:32 pm
Location: Israel

Re: zmtrigger.pl

Post by mastertheknife »

Its an error in my version. I fixed that recently, re-download the source.
See here: http://www.zoneminder.com/forums/viewto ... 534#p74534

mastertheknife
Kfir Itzhak.
Simon
Posts: 19
Joined: Tue Jan 24, 2006 8:35 pm

Re: zmtrigger.pl

Post by Simon »

Hey,

I installed the latest version as you recommended and it seems a bit better, however zmtrigger.pl will not stay running.

In the logs I get:

Code: Select all

May 15 01:48:24 hawk zmdc[17993]: ERR ['zmtrigger.pl ' exited abnormally, exit status 9]
Multiple times. I guess zmdc is trying to start zmtrigger.pl. I turned on debug logging for zmtrigger and the following ends up in the logs:

Code: Select all

12-05-15 01:43:53.208758 zmtrigger[17477].DBG [LogOpts: level=DBG/DBG, screen=OFF, database=INF, logfile=DBG->/mnt/zm/log/zm_debug.log.17477, syslog=INF]
12-05-15 01:43:53.208862 zmtrigger[17477].INF [Trigger daemon starting]
12-05-15 01:43:53.211181 zmtrigger[17477].INF [Opening connection 'Chan1']
12-05-15 01:43:53.212574 zmtrigger[17477].INF [Opening connection 'Chan2']
12-05-15 01:43:53.215110 zmtrigger[17477].INF [Opening connection 'Chan4']
Seems like its really close to working.

If I run zmtrigger.pl from the command line it works, but I can't only send commands to monitor 1. When I try monitor 2 it doesn't recognize it. From the debug log I think some extra parameters are passed by zmdc to get zmtrigger to see the other monitors, but I'm not positive about this.

I've only started trying to debug why zmtrigger won't stay running, or what exit with status 9 means so I don't have anything beyond this. If anyone has some ideas I'd appreciate them.

Simon
Simon
Posts: 19
Joined: Tue Jan 24, 2006 8:35 pm

Re: zmtrigger.pl

Post by Simon »

So with a bit more digging I figured out the reason was that zmtrigger.pl wants to access the serial port. I use Ubuntu so I added www-data to the dialout group and restart. Now zmtrigger.pl stays running! Progress.

So I tested the following command:

Code: Select all

1|on+30|255|cause|text|showtext
Which worked great. However, it's monitor 2 I want to trigger based my external sensor, so next I tested:

Code: Select all

2|on+30|255|cause|text|showtext
However in the logs I get:

Code: Select all

Can't find monitor '2' for message '2|on+30|255|cause|text|showtext'
Damn, I thought I was really close. I tried with all my other inputs and none of them work. I have 6 and only id 1 will work. The documentation says the id number of name can be used as the first parameter, but neither work for me for any monitor greater than 1.

Simon
Simon
Posts: 19
Joined: Tue Jan 24, 2006 8:35 pm

Re: zmtrigger.pl

Post by Simon »

Quick update:

Code: Select all

5|on+30|255|cause|text|showtext
Works! I compared it with the other cameras and I don't see a difference. However, this leads me to believe it may just be a setting somewhere ... getting really close I think to making this work.

Simon
Simon
Posts: 19
Joined: Tue Jan 24, 2006 8:35 pm

Re: zmtrigger.pl

Post by Simon »

Apparently I should have done more searching on the forums. I found my answer. The camera in question needs to be in something other than Monitor for it to be usable by zmtrigger.pl I switched to Nodect, which had I not skimmed the documentation so quickly I would have learned that this is precisely what this mode is for. Once that was done I could trigger the camera.

Simon
Lourenco
Posts: 12
Joined: Sun May 13, 2012 6:34 pm

Re: zmtrigger.pl

Post by Lourenco »

Hi,
I connected an arduino board to zoneminder via ethernet to send strings.
More details in this thread: http://arduino.cc/forum/index.php/topic ... 24308.html

It works until I have this same error:
"zmtrigger.pl ' exited abnormally exit status 9"

I edited zmtrigger.pl to just have the "Chan1" (ethernet) active in "my @connections".

I tried to add www-data to the dialout group like simon did. Also my cameras are in Modect mode. I keep having this error and when it happen the monitor don't leave que alarm state.

The only thing I didn't do was applying the PATCH described here because I don't have the performance patch installed (it is just for people that installed performance patch right ??).

I'm using Zoneminder 1.25.0

Any idea?
coinageboy
Posts: 17
Joined: Sun May 27, 2012 1:06 am

Re: zmtrigger.pl

Post by coinageboy »

Same here,

when I connect to the server with telnet, port 6802, it hangs after several minutes, the message is "Connection closed by foreign host."
Is there a solution to this??
Lourenco
Posts: 12
Joined: Sun May 13, 2012 6:34 pm

Re: zmtrigger.pl

Post by Lourenco »

coinageboy wrote:Same here,

when I connect to the server with telnet, port 6802, it hangs after several minutes, the message is "Connection closed by foreign host."
Is there a solution to this??
Same thing. I also tested with telnet and i'm getting the same message and simultaneously the exit status 9 in the LOG window.


I saw a solution to a similar problem here:
http://www.zoneminder.com/forums/viewto ... trigger.pl

I disabled the option of using zmtrigger in the zoneminder options (via web interface), restarted the computer, and started zmtrigger manually using ssh connection:

Code: Select all

sudo /usr/local/bin/zmtrigger.pl
In Zoneminder web interface in the LOG window I see zmtrigger starting, but in ssh window it hangs for some.

Zmtrigger works perfectly and doesn't give the error "exit status 9" and I can get triggers to work via telnet.

But in the ssh window, after some minutes frozen, it gives me this:

Code: Select all

variable is not a string at /usr/local/share/perl/5.12.4/ZoneMinder/Memory/Mapped.pm line 109.
At the same time it gives this message in the ssh window, in the telnet window it closes the telnet connection and it doesn't allow me to make another connection giving "connection refused" every time after that.

The difference is that it doesn't allow to reconnect but does not give the "exit status 9" error.
Lourenco
Posts: 12
Joined: Sun May 13, 2012 6:34 pm

Re: zmtrigger.pl

Post by Lourenco »

mastertheknife wrote:Its an error in my version. I fixed that recently, re-download the source.
See here: http://www.zoneminder.com/forums/viewto ... 534#p74534

mastertheknife
I have the version 1.25.0. This "performance patch" isn't included in my version, right?
I was wondering if installing that patch should solve my problem.... (because simon solved this problem updating the patch).
Lourenco
Posts: 12
Joined: Sun May 13, 2012 6:34 pm

Re: zmtrigger.pl

Post by Lourenco »

Locked