xAP/xPL support

Anything you want added or changed in future versions of ZoneMinder? Post here and there's a chance it will get in! Search to make sure it hasn't already been requested.
madmax
Posts: 55
Joined: Fri Nov 07, 2003 8:49 pm

Post by madmax »

I install the xAP plugin. So far I am able to see xAP messages from all of my monitors. I am able to Force Start/Stop/Cancel alarms from an xAP message.
I am not able to start/stop motion detection yet. Not sure why, but I see the following errors in my logs:


Can't get shared memory id '2053971978' for monitor#10: No such file or directory
Exiting subroutine via next at /usr/lib/zm/bin/zmx10.pl line 426.

any ideas??
madmax
Posts: 55
Joined: Fri Nov 07, 2003 8:49 pm

Post by madmax »

I found out what was wrong:
The following example has a mistake. It should be VMI.MonitorCmd not xAPBSC.cmd

Thanks a lot for this plugin!

# An example xAP message sent to zmxap (from some xAP sender app)
# that starts monitor activation
# Note: these messages only apply to "Modect", "Record" or "Mocord"
# monitors

xap-header
{
v=12
hop=1
uid=FFCDEF00
class=xAPBSC.cmd
source=acme.sender.test
target=zm.zoneminder.myhouse:porch_camera
}
Monitor
{
Action=<start>|<stop>
}
gliming
Posts: 33
Joined: Wed Sep 07, 2005 5:40 pm
Location: Ohio, USA

Post by gliming »

I found out what was wrong:
The following example has a mistake. It should be VMI.MonitorCmd not xAPBSC.cmd
Boy do I feel stupid. Joe Z. pointed this out earlier off-list and I forgot to update the README. As you probably noted, the documentation is quite sparse and may well be insufficient (although it's encouraging that you managed to make everything work despite mistakes!). Any suggestions would be appreciated. Likewise for any functional changes/behavior.

As to your previous reported error... I'm pretty sure that I saw this message before anytime one of my monitors was set to "None" or "Monitor" (maybe it was just "None"). Regardless, I ought to do a better job of trapping/handling the error. I'm hoping that the 1.22.x framework will provide the direct access layer so that I'm not having to deal w/ it.

I have looked briefly at the new 1.22.x framework. It has definitely dramatically changed. I will plan on migrating this script to take advantage of the new perl libs.

Gregg
User avatar
zoneminder
Site Admin
Posts: 5215
Joined: Wed Jul 09, 2003 2:07 pm
Location: Bristol, UK
Contact:

Post by zoneminder »

Yes, it is very different. I think you can probably get most things you need from perldoc'ing SharedMem.pm. I hope so at least.
Phil
madmax
Posts: 55
Joined: Fri Nov 07, 2003 8:49 pm

Post by madmax »

So far, this script is working great. If I have any further suggestions, I will post them. Thanks!
madmax
Posts: 55
Joined: Fri Nov 07, 2003 8:49 pm

Post by madmax »

The Script is still working fine. Is there any way to use this version with the new version of zoneminder, or is it incompatible?
gliming
Posts: 33
Joined: Wed Sep 07, 2005 5:40 pm
Location: Ohio, USA

Post by gliming »

I've not yet installed the latest to test. My expectation is that it should remain compatible. But, if you're concerned, then you may want to wait until I can test. I'll repost once I have something useful to report.
madmax
Posts: 55
Joined: Fri Nov 07, 2003 8:49 pm

Post by madmax »

Sounds good. Thanks
gliming
Posts: 33
Joined: Wed Sep 07, 2005 5:40 pm
Location: Ohio, USA

Post by gliming »

The xAP connector underwent a major "overhaul" motivated by the very awesome new zm API! It now runs as a stand-alone daemon (no more "mangling" zmx10.pl and related configs) and incorporates new features available to 1.22.x and requested by the xAP community. zmxap (ZM xAP connector) is available at http://limings.net/xap/zmxap. Because of it's new dependence on the 1.22.x API, it is only compatible with 1.22.x.

Gregg
User avatar
zoneminder
Site Admin
Posts: 5215
Joined: Wed Jul 09, 2003 2:07 pm
Location: Bristol, UK
Contact:

Post by zoneminder »

This is rally good news. Thanks for doing that. Is there an easy guide anywhere for it giving a high level overview and basic instructions?

By the way I edited your post as it was including the full stop in the url.
Phil
gliming
Posts: 33
Joined: Wed Sep 07, 2005 5:40 pm
Location: Ohio, USA

Post by gliming »

I plan to work on an overview that conceptually describes capabilities/features in the next few days. That info will appear on the zmxap page. There does exist a bit of a "install and usage" guide in the README embedded in the package. It is perhaps sufficient for "installation" but does not address all of the possible usage scenarios. That will also be expanded (hopefully soon).

Gregg
madmax
Posts: 55
Joined: Fri Nov 07, 2003 8:49 pm

Post by madmax »

gliming.. just a FYI - new version of zmxap is working great! thanks
pcalleros
Posts: 56
Joined: Sun Oct 02, 2005 4:53 pm

Testing xAP

Post by pcalleros »

gliming, great ap!

testing and seeing the following in Syslog:

Apr 27 00:26:35 ICS-ZM zm?[5363]: ERR [Can't read 'shared_data:alarm_x' from shared memory '7a6d2004/163844': Identifier removed]
Apr 27 00:26:36 ICS-ZM zm?[5146]: ERR [Can't read 'shared_data:state' from shared memory '7a6d2004/163844': Identifier removed]
Apr 27 00:26:36 ICS-ZM zm?[5146]: ERR [Can't read 'shared_data:last_event' from shared memory '7a6d2004/163844': Identifier removed]
Apr 27 00:26:36 ICS-ZM zm?[5146]: ERR [Can't read 'shared_data:alarm_x' from shared memory '7a6d2004/163844': Identifier removed]
Apr 27 00:26:37 ICS-ZM zm?[5363]: ERR [Can't read 'shared_data:state' from shared memory '7a6d2004/163844': Identifier removed]
Apr 27 00:26:37 ICS-ZM zm?[5363]: ERR [Can't read 'shared_data:last_event' from shared memory '7a6d2004/163844': Identifier removed]
Apr 27 00:26:37 ICS-ZM zm?[5363]: ERR [Can't read 'shared_data:alarm_x' from shared memory '7a6d2004/163844': Identifier removed]

I have an xAP hub set up to read messages from ZM and messages appear fine. I am not sending any xAP messages to ZM yet but want to integrate with Homeseer.
gliming
Posts: 33
Joined: Wed Sep 07, 2005 5:40 pm
Location: Ohio, USA

Post by gliming »

Apr 27 00:26:35 ICS-ZM zm?[5363]: ERR [Can't read 'shared_data:alarm_x' from shared memory '7a6d2004/163844': Identifier removed]
Apr 27 00:26:36 ICS-ZM zm?[5146]: ERR [Can't read 'shared_data:state' from shared memory '7a6d2004/163844': Identifier removed]
Apr 27 00:26:36 ICS-ZM zm?[5146]: ERR [Can't read 'shared_data:last_event' from shared memory '7a6d2004/163844': Identifier removed]
Apr 27 00:26:36 ICS-ZM zm?[5146]: ERR [Can't read 'shared_data:alarm_x' from shared memory '7a6d2004/163844': Identifier removed]
Apr 27 00:26:37 ICS-ZM zm?[5363]: ERR [Can't read 'shared_data:state' from shared memory '7a6d2004/163844': Identifier removed]
Apr 27 00:26:37 ICS-ZM zm?[5363]: ERR [Can't read 'shared_data:last_event' from shared memory '7a6d2004/163844': Identifier removed]
Apr 27 00:26:37 ICS-ZM zm?[5363]: ERR [Can't read 'shared_data:alarm_x' from shared memory '7a6d2004/163844': Identifier removed]


These messages are being generated from within the new ZM perl API--specifically, SharedMemory::zmShmRead. I admittedly don't fully appreciate all of the nuances of ZM's use of shared memory. Hopefully, Phil might see this and offer ideas.

Do you ever get any xAP messages on alarm? I'm guessing not from the errors above, but want to confirm.

For better troubleshooting, can you identify which zm version you're using and how many monitors and the monitor type you have?
I have an xAP hub set up to read messages from ZM and messages appear fine. I am not sending any xAP messages to ZM yet but want to integrate with Homeseer.
Can you clarify the "messages appear fine" part? Are you saying that xAP messages are in general visible or that you are getting any ZM xAP messages (e.g., VMI.MonitorInfo, or xap-hbeat.alive)?
User avatar
zoneminder
Site Admin
Posts: 5215
Joined: Wed Jul 09, 2003 2:07 pm
Location: Bristol, UK
Contact:

Post by zoneminder »

I think these errors occur when a script is still reading from shared memory that is no longer there if a cam has been shut down etc. If there is a loop it may be worth verifying the shared memory on each pass but there may be more complicated scenarios where this could occur that I haven't thought of yet.
Phil
Post Reply