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.
gliming
Posts: 33
Joined: Wed Sep 07, 2005 5:40 pm
Location: Ohio, USA

Post by gliming »

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.
Yes--I used to see these kinds of errors when I was directly reading from shared memory prior to using your API. But, zmShmRead is now protected by the internal call to zmShmVerify. There is a loop on the fields argument, but my only call to zmShmRead (or it's wrapped derivatives) only passes a single field.

pcalleros--can you comment on whether you're unplugging/disabling/etc the cameras/monitors?
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.
I haven't yet looked at all of the API calls to see if they might implicitly pass in more than one field into zmShmRead. Assuming that they don't and zmxap doesn't, then I'm really stumped as the zmShmVerify in zmShmRead should catch it. In addition, I'm always calling zmShmVerify explicitly anyway.

pcalleros--are the log entries occurring continuously or sporadically? Are you able to correlate their occurance to anything that you know of (e.g., an alarm is occuring, etc.)?

One thought is that if these occurances are sporadic is that I can recall zmShmRead (or the wrapped function) after some minor delay if the return is undef or treat it as an ending event. If it is only occuring when the data gets reset (on event going idle), then this ought to be obvious by having the initial xAP VMI.AlarmEvent, optional telemetry xAP messages but no ending xAP VMI.AlarmEvent. pcarlleros--I'm guessing/hoping that you're monitoring output by a xAP viewer? Can you comment on the above?

Gregg
pcalleros
Posts: 56
Joined: Sun Oct 02, 2005 4:53 pm

xAP

Post by pcalleros »

I am using latest 122 Mandriva updated version of ZM.

The errors are regularly timed.

I am using a Kodiccom 8 port and 1 Panasonic camera.

I have 5 cameras hooked up to the 8 port card and I have not unplugged them. I have 3 of the 8 ports disabled.

I am seeing alarm events - xAP - IE


v=12
hop=1
uid=FFEA0905
class=VMI.AlarmEvent
source=zm.zoneminder.house:Driveway-MB
}
Alert
{
cause=Motion
alarmid=2624
frames=25
state=off
maxscore=19
alarmframes=4
duration=2.00
totalscore=54
avgscore=13
}

and regular Heart beats - IE

xap-hbeat
{
v=12
hop=1
uid=FFEA0900
class=xap-hbeat.alive
source=zm.zoneminder.house
interval=60
port=3639
pid=4624
}


I am using a P4 1.8 Ghz / 1 Gig Ram machine to run ZM.

Apr 27 18:05:20 ICS-ZM zmc_dvideo4[4237]: INF [Deck-Door: 121000 - Capturing at 1.99 fps]
Apr 27 18:05:20 ICS-ZM zma_m3[4232]: INF [Rear-Door: 121000 - Processing at 1.99 fps]
Apr 27 18:05:20 ICS-ZM zmc_dvideo5[4242]: INF [Driveway-MB: 121000 - Capturing at 1.99 fps]
Apr 27 18:05:45 ICS-ZM zmc_m9[4252]: INF [Net-Cam-1: 121000 - Capturing at 1.99 fps]
Apr 27 18:06:50 ICS-ZM zma_m5[6663]: INF [Driveway-MB: 43000 - Processing at 1.99 fps]
Apr 27 18:08:30 ICS-ZM zm?[4624]: ERR [Can't get shared memory id '7a6d2006', 6: No such file or directory]
Apr 27 18:08:30 ICS-ZM zm?[4624]: ERR [Can't get shared memory id '7a6d2007', 7: No such file or directory]
Apr 27 18:08:30 ICS-ZM zm?[4624]: ERR [Can't get shared memory id '7a6d2008', 8: No such file or directory]
gliming
Posts: 33
Joined: Wed Sep 07, 2005 5:40 pm
Location: Ohio, USA

Post by gliming »

The errors are regularly timed.
Any chance they are at 5 min intervals? If so, it is clear where the problem lies (I think).
I have 3 of the 8 ports disabled.
By disabled, do you mean setting the zm monitor's function to None? If so, then this confirms my suspicion that I am not properly handling monitors set as such.
pr 27 18:08:30 ICS-ZM zm?[4624]: ERR [Can't get shared memory id '7a6d2006', 6: No such file or directory]
Apr 27 18:08:30 ICS-ZM zm?[4624]: ERR [Can't get shared memory id '7a6d2007', 7: No such file or directory]
Apr 27 18:08:30 ICS-ZM zm?[4624]: ERR [Can't get shared memory id '7a6d2008', 8: No such file or directory]
The indexes--6, 7 and 8--suggest what I have been wondering. That is that you have defined a total of 8 monitors and have set 5-8 as 'None'. Is that correct? Regardless, I've found a part of the code that is not properly handling this case and have made a mod. If this is indeed your situation, then I'll create a release tomorrow (Friday) evening. If not, then please let me know so that I can consider other options for diagnosis.

On the 'up side', the new version will support more 'fine grained' polling (more frequent polling by default as well as user overrides) and an ability to report causing zones (a new zonedata property in the VMI.AlarmEvent msg). There are also a couple of other minor bug fixes.
pcalleros
Posts: 56
Joined: Sun Oct 02, 2005 4:53 pm

xAP

Post by pcalleros »

Yes the monitors not used are set to none.

Yes it bseems to be happening every 5 minutes: (clipped and pasted first of each set)

Apr 27 21:58:53 ICS-ZM zm?[4624]: ERR [Can't get shared memory id '7a6d2006', 6: No such file or directory]

Apr 27 22:03:54 ICS-ZM zm?[4624]: ERR [Can't get shared memory id '7a6d2006', 6: No such file or directory]

Apr 27 22:08:54 ICS-ZM zm?[4624]: ERR [Can't get shared memory id '7a6d2006', 6: No such file or directory]

gliming
u are right on with all your assumptions. I can test some more tommorrow night. Now to get my Homeseer server to talk to the ZM server.
gliming
Posts: 33
Joined: Wed Sep 07, 2005 5:40 pm
Location: Ohio, USA

Post by gliming »

pcalleros - thanks for validating that. I'll repost when the next release is available (tomorrow evening). In the mean time, the only real problem/inconvenience is the zmxap is filling your logs with unuseful info. I realize that this may indeed be more than just inconvenience, but all events for enabled monitors should be reported properly as well as being able to respond to xAP messages (e.g., monitor stop/start/cancel/motion-suspend/motion-resume).

On the off-chance that you have interest, zmxap also now reports message.display xAP msgs. These include both the url into the live stream as well as the event. Also, textual message content exists (now including the extended cause/notes info). James from mi4.net extended his intranet launcher app that will pop-up a live zm stream out of system tray (assuming a windows box) and linger for a user-configurable (via zmxap) time. Better still, he's working on a very cool screen saver that works similarly. No xAP message mapping is required--it just works.
pcalleros
Posts: 56
Joined: Sun Oct 02, 2005 4:53 pm

xAP

Post by pcalleros »

gliming - I do not mind my logs filling up, am happy to be a volunteer and appreciate the time you are spending on this plugin! I have been waiting for the opportunity to be able to utilize xAP for ZM. I am currently using xAP for my HA application - specfically one-wire sensors and sprinkler system. I would prefer it to using a directly connected CM11.

I have looked at James' application and would like to integrate it into my touch screens.

I am in the process of putting in some touch panels thru-out the home and looking at two applications. Both of these applications would have the ability to link to the ZM cameras.

IE:
http://www.harmony-home.com/More/home.htm
http://www.cinemaronline.com/mainlobbyscreenshots.html

The installation of the touch panels have to meet the WAF (wife acceptance factor) - so using 8" for some - depending on location 14" for others.
pcalleros
Posts: 56
Joined: Sun Oct 02, 2005 4:53 pm

xAP - HSII - Plugin

Post by pcalleros »

I have an HSII setup configured for testing (also an HSI - using it in "production") and have installed James' plugin - I am currently configuring some Zoneminder devices - very impressive.
gliming
Posts: 33
Joined: Wed Sep 07, 2005 5:40 pm
Location: Ohio, USA

Post by gliming »

I do not mind my logs filling up
I've just posted the latest release (zmxap-v0.5) at http://limings.net/xap/zmxap. It should be much better about recovering from zm restarts (shared memory pointers are then changed) and not polling monitors set as none. In addition, it now fully supports the new, extended cause and notes facility in 1.22.1. This latter feature means that your HA system can know exactly why the alarm occurred and alter it's behavior as a result. This further means that you could implement dyanmic monitor linking if the new zm static monitor linking is insufficient.
I have looked at James' application and would like to integrate it into my touch screens.
I would be quite interested in how you make out with those. Something that you might want to investigate/consider is the ability to alter the URLs and/or text that is output in Message.Display xAP messages. Specifically, zmxap tries to use sane defaults, but does permit user overrides. The syntax for the urls and text allows substituting variables in addition to fixed or literal text. As of zmxap v0.4, it is possible to override these settings on a per monitor basis. The implication here is that you don't need to be constrained by the defaults which may not be best for your touchscreens. Take a look at the sample conf for the defaults and feel free to post back if you have questions here.
pcalleros
Posts: 56
Joined: Sun Oct 02, 2005 4:53 pm

zmxap-v0.5 testing

Post by pcalleros »

working well. logs look good.

forced an alarm:

xap-header
{
v=12
hop=1
uid=FFEA0901
class=Message.Display
source=zm.zoneminder.house:Driveway
}
Display.Text
{
line1=CCTV - Driveway
line2=Forced Web
duration=90
priority=80
}
Display.Web
{
link=http://xxx.xxx.xxx.xxx/zm/index.php?view=event&eid=2680
refresh=0.1
pic=http://xxx.xxx.xxx.xxx/cgi-bin/nph-zms? ... 1146256115
}


xap-header
{
v=12
hop=1
uid=FFEA0901
class=VMI.AlarmEvent
source=zm.zoneminder.house:Driveway
}
Alert
{
alarmid=2680
state=on
cause=Forced Web

For touch screens - last event stills / plus live would be kind of the direction I would be heading to. I have installed James' application on HSII server and starting to play. If there is anything in particular or if you would like to test directly (accessing ZM) let me know.
pcalleros
Posts: 56
Joined: Sun Oct 02, 2005 4:53 pm

xAP Messages

Post by pcalleros »

Originally wanted to separate external vs. internal motion sensor and TTS - this will let me get very grainular with my TTS for the outside IR/cameras.
pcalleros
Posts: 56
Joined: Sun Oct 02, 2005 4:53 pm

Found this in the xAP log

Post by pcalleros »

xAP server starting at 06/04/28 15:09:45
Use of uninitialized value in numeric eq (==) at ./zmxap.pl line 656.
Use of uninitialized value in split at ./zmxap.pl line 664.
Use of uninitialized value in concatenation (.) or string at ./zmxap.pl line 812.

not sure when it happened though.
madmax
Posts: 55
Joined: Fri Nov 07, 2003 8:49 pm

Post by madmax »

can someone please send me zmxap-v0.5 ?? Looks like the site is down.
madmax at lightningbolts.net
madmax
Posts: 55
Joined: Fri Nov 07, 2003 8:49 pm

Post by madmax »

nobody?
pcalleros
Posts: 56
Joined: Sun Oct 02, 2005 4:53 pm

AM xAP latest version

Post by pcalleros »

Let me know your email address and I will send it to you.

Pete (Homeseer)
madmax
Posts: 55
Joined: Fri Nov 07, 2003 8:49 pm

Post by madmax »

it is: madmax@lightningbolts.net

Thank you very much!
Post Reply