Print temperature on Images?
| Author |
Message |
|
lukelukeluke
Joined: Tue May 01, 2007 5:19 pm Posts: 31
|
 Print temperature on Images?
With the timestamp setting, it seems you cannot print anything dynamically loaded from an external program to the Monitor image. Is there another way to do it?
I've read about zmtrigger.pl - that it could probably be done with it. But nobody seems to know about this according to my last post:
http://www.zoneminder.com/forums/viewtopic.php?t=13850&highlight=
Also, updating the MySQL timestamp entry seems to do nothing to the current image - the timestamp entry has to be cached somewhere...?
Thanks for any hints
|
| Fri Jun 26, 2009 7:50 pm |
|
|
|
 |
|
coke
Joined: Wed Jan 30, 2008 6:53 pm Posts: 519 Location: St. Louis, MO, USA
|
I don't think timestamps are what you think they are, or at least they're not what I thought they were a couple of weeks ago in another application. A timestamp field is usually generated by the database for it's own purposes.
|
| Fri Jun 26, 2009 8:07 pm |
|
 |
|
lukelukeluke
Joined: Tue May 01, 2007 5:19 pm Posts: 31
|
Well I know what a timestamp is.
But zoneminder calls the text string timestamp, which is printed on every image top left, which contains name of the Monitor and Date/Time. I'm looking for a way to add a dynamic value there, coming from an external program. For example:
`cat /opt/currtemp`
|
| Fri Jun 26, 2009 11:02 pm |
|
 |
|
ludri
Joined: Mon Dec 15, 2008 1:10 am Posts: 13
|
I 'd interested in the same thing. Would be cool to put some weather etc data on images.
|
| Fri Jun 26, 2009 11:53 pm |
|
 |
|
Normando
Joined: Sun Aug 17, 2008 6:34 am Posts: 219 Location: Rosario - Argentina
|
Has anyone read the perfect description of zmtrigger?
At http://www.zoneminder.com/wiki/index.ph ... Components you can read:
 |  |  |  | Quote: zmtrigger.pl This is an optional script that is a more generic solution to external triggering of alarms. It can handle external connections via either internet socket, unix socket or file/device interfaces. You can either use it ‘as is’ if you can interface with the existing format, or override connections and channels to customise it to your needs. The format of triggers used by zmtrigger.pl is as follows "<id>|<action>|<score>|<cause>|<text>|<showtext>" where
* 'id' is the id number or name of the ZM monitor * 'action' is 'on', 'off', 'cancel' or ‘show’ where 'on' forces an alarm condition on, 'off' forces an alarm condition off and 'cancel' negates the previous 'on' or 'off'. The ‘show’ action merely updates some auxiliary text which can optionally be displayed in the images captured by the monitor. Ordinarily you would use 'on' and 'cancel', 'off' would tend to be used to suppress motion based events. Additionally 'on' and 'off' can take an additional time offset, e.g. on+20 which automatically 'cancel's the previous action after that number of seconds. * 'score' is the score given to the alarm, usually to indicate it's importance. For 'on' triggers it should be non-zero, otherwise it should be zero. * 'cause' is a 32 char max string indicating the reason for, or source of the alarm e.g. 'Relay 1 open'. This is saved in the ‘Cause’ field of the event. Ignored for 'off' or 'cancel' messages * 'text' is a 256 char max additional info field, which is saved in the ‘Description’ field of an event. Ignored for 'off' or 'cancel' messages. * 'showtext' is up to 32 characters of text that can be displayed in the timestamp that is added to images. The ‘show’ action is designed to update this text without affecting alarms but the text is updated, if present, for any of the actions. This is designed to allow external input to appear on the images captured, for instance temperature or personnel identity etc.
Note that multiple messages can be sent at once and should be LF or CRLF delimited. This script is not necessarily intended to be a solution in itself, but is intended to be used as ‘glue’ to help ZoneMinder interface with other systems. It will almost certainly require some customisation before you can make any use of it. If all you want to do is generate alarms from external sources then using the ZoneMinder::SharedMem perl module is likely to be easier. |  |  |  |  |
and http://www.zoneminder.com/wiki/index.ph ... estamp_Tab
So...it is very easy to add dinamically a text on the timestamp over the image. Interface with zmtrigger.pl your external program and send a series of "<id>|show||||<showtext>" to add your own text over the image. Of course, add the %Q token in your monitor timestamp settings.
|
| Sat Jun 27, 2009 5:56 am |
|
 |
|
lukelukeluke
Joined: Tue May 01, 2007 5:19 pm Posts: 31
|
That's why I mentioned zmtrigger.pl. But can you also describe how to "interface with zmtrigger.pl"? I can't see another description of zmtrigger.pl than what you posted, I also mentioned this one in my old post.
Do I just start zmtrigger.pl on command line and enter "1|show||||temp: 24C"? At least this doesn't work... Where you got this syntax from anyway? Thanks a lot for further help!
|
| Sat Jun 27, 2009 1:08 pm |
|
 |
|
Normando
Joined: Sun Aug 17, 2008 6:34 am Posts: 219 Location: Rosario - Argentina
|
1- Comment those channels you will not use. In my case I only use port 6802 to control zmtrigger.pl, so comment the rest of connection in zmtrigger.pl
 |  |  |  | Code: my @connections; push( @connections, ZoneMinder::Trigger::Connection->new( name=>"Chan1", channel=>ZoneMinder::Trigger::Channel::Inet->new( port=>6802 ), mode=>"rw" ) ); #push( @connections, ZoneMinder::Trigger::Connection->new( name=>"Chan2", channel=>ZoneMinder::Trigger::Channel::Unix->new( path=>'/tmp/test.sock' ), mode=>"rw" ) ); #push( @connections, ZoneMinder::Trigger::Connection->new( name=>"Chan3", channel=>ZoneMinder::Trigger::Channel::File->new( path=>'/tmp/zmtrigger.out' ), mode=>"w" ) ); #push( @connections, ZoneMinder::Trigger::Connection->new( name=>"Chan4", channel=>ZoneMinder::Trigger::Channel::Serial->new( path=>'/dev/ttyS0' ), mode=>"rw" ) ); |  |  |  |  |
2- Enable triggers in options and restart zm 3- Send the command to the port 6802. You can make a script in php to access the socket in that port or send directly with your external app. I have write my own php script: 4- Add the token %Q at the end of timestamp string in your monitor settings, or where you want. 5- Change the monitor function to NoDect, MoCord or MoDect. If you want more functions to use external trigger look at http://www.zoneminder.com/forums/viewtopic.php?t=129266- Send the command. In my case because script, I send via URL: in your case
Reply the results
Last edited by Normando on Wed Aug 12, 2009 11:49 pm, edited 1 time in total.
|
| Sat Jun 27, 2009 4:50 pm |
|
 |
|
lukelukeluke
Joined: Tue May 01, 2007 5:19 pm Posts: 31
|
wow! Thanks Normando! Just did everything you wrote and it worked perefctly fine like that! An instruction like this should be added into the zmwiki or manual!
Btw.: It even works with Monitor-Mode (No motion detection).
|
| Sun Jun 28, 2009 1:01 am |
|
 |
|
Normando
Joined: Sun Aug 17, 2008 6:34 am Posts: 219 Location: Rosario - Argentina
|
Great 
|
| Sun Jun 28, 2009 7:54 am |
|
 |
|
cordel
Joined: Fri Mar 05, 2004 5:47 pm Posts: 5218 Location: /USA/Washington/Seattle
|
Agreed, Thx Normando for a great example. Another feature that should be better defined in the Wiki LOL, At least this one is there. Let me know if you feel the inclination to work it, else I add something a bit down the road.
|
| Tue Jul 07, 2009 8:34 am |
|
 |
|
Normando
Joined: Sun Aug 17, 2008 6:34 am Posts: 219 Location: Rosario - Argentina
|
Thanks Cordel for your gratitude. Because my english is very little, I don't know If I undertand what you said about the work. Are you saying if I want to add this to the wiki? If yes, I reply yes, but I have no access to the wiki
Regards
Normando
Edit: upsss, sorry, I have access to the wiki. If you want I will post this ASAP
|
| Tue Jul 07, 2009 4:01 pm |
|
 |
|
lukelukeluke
Joined: Tue May 01, 2007 5:19 pm Posts: 31
|
Thanks for posting this to the Wiki Normando.
Maybe you can include my little hint for people who dont have PHP (or I can do it if you want me to).
You know you can also send the commands via telnet:
For this purpose, I created this script:
Create this script " script.sh" (executable) and enter this on the console:
./script.sh '1|show||||18' | telnet
to send a command.
Easy 
|
| Tue Jul 07, 2009 5:17 pm |
|
 |
|
cordel
Joined: Fri Mar 05, 2004 5:47 pm Posts: 5218 Location: /USA/Washington/Seattle
|
Actually Normandos example is fine and more appropriate. It's better kept generic so that it applies to and is readable by more people. It's then up to those people to tailor it to their specific needs. Maybe add another section for different script languages. It should be just to aid in understanding how it works. If you get to specific then it tends to confuse some. It's about the API, not how to do a certain thing.
We will be going though the wiki fairly shortly and trying to make it all generic in the documentation, as distro and purpose directed stuff should be under more specific headings.
|
| Tue Jul 07, 2009 7:21 pm |
|
 |
|
mrd
Joined: Wed Apr 26, 2006 1:39 am Posts: 227 Location: Boston USA
|
Ok.. I'm missing something here.
- I've edited zm_trigger.pl and commented out the other connection methods.
- I've selected ZM_OPT_TRIGGERS in options and restarted ZM
- I've added the %Q to my #4 monitor timestamp
- I've created a .php just like yours (Didn't give any errors or work)
- I've created a perl script to write to the socket and it also didn't work.
- The socket is open
- zm_trigger.pl is running
- I've tried just about all monitor states
- my URL and script syntax seem correct
http://<myserver>/zm/zm_trigger_temp.php?extTrigger=4|show||||123
root@system-z:~# ./trigger_sock.pl 4 123
4|show||||123
What am I missing?
_________________ MRD
|
| Wed Aug 12, 2009 9:34 pm |
|
 |
|
mrd
Joined: Wed Apr 26, 2006 1:39 am Posts: 227 Location: Boston USA
|
I take it back.. My perl script is working... Not sure why the .php won't work though...
_________________ MRD
|
| Wed Aug 12, 2009 9:36 pm |
|
|
Who is online |
Users browsing this forum: No registered users and 0 guests |
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot post attachments in this forum
|
|