ZM DBus interface - is there a demand?

If you've made a patch to quick fix a bug or to add a new feature not yet in the main tree then post it here so others can try it out.
Post Reply
mastertheknife
Posts: 678
Joined: Wed Dec 16, 2009 4:32 pm
Location: Israel

ZM DBus interface - is there a demand?

Post by mastertheknife »

Presently, external applications or scripts communication with ZoneMinder and its daemons is very limited and difficult. For example, to detect if an alarm was triggered, some scripts continuously read the system log looking for matching strings.

In order to improve this communication, DBus can be used.
DBus is an IPC system for Linux. Its supported by many programming languages and is very simple and flexible.
By adding a DBus interface to ZoneMinder, we now have a 2-way communication and some operations are made much simpler.
With DBus it should be possible to read and write to many variables (called "Properties" in DBus), call functions ("Methods") and listen to events ("Signals").

Some examples:
An application\script can listen to StateChange signals to know if the monitor is now alarmed and act accordingly (shoot the missiles?)
An application\script can read the LastEventId and LastEventCause properties to learn more about the last event.
An application\script can listen to EventCreated signals to be notified everytime a new event is created.
An application\script can call ForceAlarmOn() and ForceAlarmOff() to temporarily enable\disable alarms.
And so on.

DBus is very flexible. New signals, methods and properties(variables) can be added at any time if enough people request them.

DBus should be definitely used in ZoneMinder2, but since ZM2 is probably far away, I wanted to play a little with DBus and learn about its potentials in ZM, including the most requested interfaces\features.

So far:
Image

So,
Is DBus something worth coding for the current ZoneMinder, and what features\interfaces would you like to see?

mastertheknife
Kfir Itzhak.
graphicw
Posts: 34
Joined: Thu May 19, 2011 12:57 am

Re: ZM DBus interface - is there a demand?

Post by graphicw »

Such a feature would be very much in demand with some people. It could be used to intelligently activate X10 modules and all kinds of goodies in response to alarm states.
Flasheart
Posts: 342
Joined: Thu Jul 06, 2006 2:27 pm

Re: ZM DBus interface - is there a demand?

Post by Flasheart »

dbus is proven to be a reliable way to transfer information between linux apps. I've never coded for it or knowingly used anything that uses it, though, so my experience is limited.

But - I wonder about something you mention. Is zm2 really that far away? Phil's mooted the idea already. ZM1 is becoming more difficult to support and install, and yet there's still no worthy open source contender out there to give it any competition. ZM1 is coming up to a decade old and still has some of that codebase, yet cctv has changed enormously in that time. Some of the dependancies are getting hard to source, perl5.12 broke quite a few things (I think my list included zm, but I'm not 100% sure) is it time for a rewrite?

Would zoneminder benefit from an overhaul? We've had two new releases lately, which is great (although I failed to compile a working 1.24.4 and ran out of time trying to find out why), but no debs out yet.

Is there enough demand? I think yes. cctv is more common than ever. zm's abilities are awesome, it's just difficult to get running sometimes.

If so, do we have the people available to commit time, skill and effort to it?
mastertheknife
Posts: 678
Joined: Wed Dec 16, 2009 4:32 pm
Location: Israel

Re: ZM DBus interface - is there a demand?

Post by mastertheknife »

Flasheart wrote: But - I wonder about something you mention. Is zm2 really that far away? Phil's mooted the idea already. ZM1 is becoming more difficult to support and install, and yet there's still no worthy open source contender out there to give it any competition. ZM1 is coming up to a decade old and still has some of that codebase, yet cctv has changed enormously in that time. Some of the dependancies are getting hard to source, perl5.12 broke quite a few things (I think my list included zm, but I'm not 100% sure) is it time for a rewrite?

Would zoneminder benefit from an overhaul? We've had two new releases lately, which is great (although I failed to compile a working 1.24.4 and ran out of time trying to find out why), but no debs out yet.

Is there enough demand? I think yes. cctv is more common than ever. zm's abilities are awesome, it's just difficult to get running sometimes.

If so, do we have the people available to commit time, skill and effort to it?
I don't know about the state of ZM2 development, but if Phil didn't begin working on ZM2 yet, its probably far away because programming takes its time.

ZM1 is indeed very old but now with the release of ZM 1.24.3 and ZM 1.24.4 it actually received nice updates and installation is much easier than installing the old ZoneMinder 1.24.2. The reason ZM is generally difficult hard to install is because it has and depends on many dependencies. Whats worse is that some of these dependencies change very often without any notice (ffmpeg especially), breaking compatibility with ZoneMinder.
What ZoneMinder needs is to reduce the amount of dependencies, and also code alternatives for systems where a dependency is not available. A list of all the dependencies used by ZoneMinder is also helpful. As far as i checked, i am not even sure the current configure script is updated to check for all the dependencies used in ZM 1.24.3 and ZM 1.24.4.

ZM2 is definitely a step forward, but not as a fix for installation difficulties and stability issues (because ZM2 will probably have them too, ZM is just big), but rather add features and simplify things.

mastertheknife
Kfir Itzhak.
mastertheknife
Posts: 678
Joined: Wed Dec 16, 2009 4:32 pm
Location: Israel

Re: ZM DBus interface - is there a demand?

Post by mastertheknife »

graphicw wrote:Such a feature would be very much in demand with some people. It could be used to intelligently activate X10 modules and all kinds of goodies in response to alarm states.
Sounds good! Although i don't know anything about X10 at the moment because i never used it :D

mastertheknife.
Kfir Itzhak.
graphicw
Posts: 34
Joined: Thu May 19, 2011 12:57 am

Re: ZM DBus interface - is there a demand?

Post by graphicw »

X10 modules can turn lights on and off, turn on appliances, set off alarms, control ptz function on cameras to follow motion and all kinds of other home security and automation features. These modules are also quite inexpensive as well and easy to come by. There are several E-bay sources that sell the modules at a lower price than the actual X10 website. A ZM DBus interface that can control the CM15a and other X10 connection devices would be all that is needed to turn ZM into a true security suite for someone with the modules on hand.
Post Reply