Controlling PTZ from command line for scheduling presets.
Controlling PTZ from command line for scheduling presets.
I understand the usage for zmcontrol.pl is:
Usage: zmcontrol.pl --id <monitor_id> --command=<command> <various>
but I don't really know the options for $command or "various options." Can someone please give me an example command for moving a given camera id to a given preset? My goal is to schedule a preset so that the camera monitors my kid's bus stop at a scheduled time every day and then returns home after a short amount of time. Thank you for any help!!!
Usage: zmcontrol.pl --id <monitor_id> --command=<command> <various>
but I don't really know the options for $command or "various options." Can someone please give me an example command for moving a given camera id to a given preset? My goal is to schedule a preset so that the camera monitors my kid's bus stop at a scheduled time every day and then returns home after a short amount of time. Thank you for any help!!!
If you have a PTZ camera working on your system, you should be able to look in the /var/log/zm/zmcontrol.log file and see what is being executed when you move the camera with the ZM controls.
I think it's:
zmcontrol.pl --id=3 --command="presetgoto 2"
I'll have to try this out when I get a chance, but there are a few posts that talk about what you want to do.
http://www.zoneminder.com/forums/viewtopic.php?t=12929
I think it's:
zmcontrol.pl --id=3 --command="presetgoto 2"
I'll have to try this out when I get a chance, but there are a few posts that talk about what you want to do.
http://www.zoneminder.com/forums/viewtopic.php?t=12929
MRD
Any other ideas?
I tried the command and it goes through without error, but I didn't get any movement. I'm stumped. If you have any other ideas, let me know, please.
Controls from the web interface work fine, but there is no option to schedule controls from the front end. I need to figure out how to move to a preset from the command line so that I can schedule that command as a cron job and have a second cron job return it to the default location shortly afterward. My reason for this is in my first post. Thanks for the help. Please, let me know about any other ideas.
[/list]
[/list]
With debugging set a level 9, all I get is:
10/15/2009 16:20:15.554061 zmcontrol[4238].INF [Starting control server 2/PelcoD]
10/15/2009 16:20:15.558138 zmcontrol[4241].INF [Control server 2/PelcoD starting at 09/10/15 16:20:15]
10/15/2009 16:20:16.581280 zmcontrol[4241].FAT [Can't access preset=4 member of object of class ZoneMinder::Control::PelcoD]
10/15/2009 16:20:54.963589 zmcontrol[4262].INF [Starting control server 2/PelcoD]
10/15/2009 16:20:54.967800 zmcontrol[4265].INF [Control server 2/PelcoD starting at 09/10/15 16:20:54]
10/15/2009 16:20:55.996647 zmcontrol[4265].FAT [Can't access presetgoto=4 member of object of class ZoneMinder::Control::PelcoD]
10/15/09 16:23:36.089723 zmcontrol[4391].INF [Starting control server 2/PelcoD]
10/15/09 16:23:36.093721 zmcontrol[4394].INF [Control server 2/PelcoD starting at 09/10/15 16:23:36]
10/15/09 16:53:44.420512 zmcontrol[4394].INF [Control server 2/PelcoD exiting at 09/10/15 16:53:44]
10/15/09 18:18:46.063412 zmcontrol[5544].INF [Starting control server 2/PelcoD]
10/15/09 18:18:46.067349 zmcontrol[5548].INF [Control server 2/PelcoD starting at 09/10/15 18:18:46]
10/15/09 18:27:44.923752 zmcontrol[3801].INF [Starting control server 2/PelcoD]
10/15/09 18:27:44.949371 zmcontrol[3804].INF [Control server 2/PelcoD starting at 09/10/15 18:27:44]
but I'm still open for ideas! Thanks again.
10/15/2009 16:20:15.554061 zmcontrol[4238].INF [Starting control server 2/PelcoD]
10/15/2009 16:20:15.558138 zmcontrol[4241].INF [Control server 2/PelcoD starting at 09/10/15 16:20:15]
10/15/2009 16:20:16.581280 zmcontrol[4241].FAT [Can't access preset=4 member of object of class ZoneMinder::Control::PelcoD]
10/15/2009 16:20:54.963589 zmcontrol[4262].INF [Starting control server 2/PelcoD]
10/15/2009 16:20:54.967800 zmcontrol[4265].INF [Control server 2/PelcoD starting at 09/10/15 16:20:54]
10/15/2009 16:20:55.996647 zmcontrol[4265].FAT [Can't access presetgoto=4 member of object of class ZoneMinder::Control::PelcoD]
10/15/09 16:23:36.089723 zmcontrol[4391].INF [Starting control server 2/PelcoD]
10/15/09 16:23:36.093721 zmcontrol[4394].INF [Control server 2/PelcoD starting at 09/10/15 16:23:36]
10/15/09 16:53:44.420512 zmcontrol[4394].INF [Control server 2/PelcoD exiting at 09/10/15 16:53:44]
10/15/09 18:18:46.063412 zmcontrol[5544].INF [Starting control server 2/PelcoD]
10/15/09 18:18:46.067349 zmcontrol[5548].INF [Control server 2/PelcoD starting at 09/10/15 18:18:46]
10/15/09 18:27:44.923752 zmcontrol[3801].INF [Starting control server 2/PelcoD]
10/15/09 18:27:44.949371 zmcontrol[3804].INF [Control server 2/PelcoD starting at 09/10/15 18:27:44]
but I'm still open for ideas! Thanks again.
Ok... I looked at the code.
zmcontrol.pl --id=<Monitor ID> --command=presetGoto --preset=<1 to what ever number of presets your camera supports>
Code: Select all
if ( !GetOptions(
'id=i'=>\$id,
'command=s'=>\$options{command},
'xcoord=i'=>\$options{xcoord},
'ycoord=i'=>\$options{ycoord},
'speed=i'=>\$options{speed},
'step=i'=>\$options{step},
'panspeed=i'=>\$options{panspeed},
'tiltspeed=i'=>\$options{tiltspeed},
'panstep=i'=>\$options{panstep},
'tiltstep=i'=>\$options{tiltstep},
'preset=i'=>\$options{preset},
'autostop'=>\$options{autostop},
)
)
MRD
You should also take a look at the post I mentioned (I wrote it) and there is a link to a script that I wrote discussed there that does a "Patrol" of camera presets for monitoring (recording) different areas of my home at different times using cron. You can adapt the code or at least the concepts into your needs.
MRD