ZM DBus interface - is there a demand?
Posted: Thu Jun 09, 2011 11:33 am
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:
So,
Is DBus something worth coding for the current ZoneMinder, and what features\interfaces would you like to see?
mastertheknife
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:
So,
Is DBus something worth coding for the current ZoneMinder, and what features\interfaces would you like to see?
mastertheknife