Page 3 of 5

Posted: Tue Jan 17, 2006 7:14 pm
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??

Posted: Tue Jan 17, 2006 7:42 pm
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>
}

Posted: Tue Jan 17, 2006 7:52 pm
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

Posted: Tue Jan 17, 2006 10:04 pm
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.

Posted: Thu Jan 19, 2006 6:09 pm
by madmax
So far, this script is working great. If I have any further suggestions, I will post them. Thanks!

Posted: Wed Jan 25, 2006 10:46 pm
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?

Posted: Wed Jan 25, 2006 10:57 pm
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.

Posted: Thu Jan 26, 2006 7:28 am
by madmax
Sounds good. Thanks

Posted: Fri Feb 24, 2006 4:01 am
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

Posted: Fri Feb 24, 2006 11:06 pm
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.

Posted: Sat Feb 25, 2006 3:25 am
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

Posted: Sun Feb 26, 2006 5:56 am
by madmax
gliming.. just a FYI - new version of zmxap is working great! thanks

Testing xAP

Posted: Thu Apr 27, 2006 5:45 am
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.

Posted: Thu Apr 27, 2006 11:02 am
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)?

Posted: Thu Apr 27, 2006 2:35 pm
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.