Turn that old serial PTZ into an Network PTZ

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
mrd
Posts: 269
Joined: Wed Apr 26, 2006 12:39 am
Location: Boston USA

Turn that old serial PTZ into an Network PTZ

Post by mrd »

Do you have an old laptop?
Do you have a cheap USB capture device?
Do you have a serial controlled PTZ camera?

You can turn it all into a network PTZ and use it with ZM!

Download the GenericPTZIP.pm module that I wrote and give it a shot!

http://www.filefactory.com/file/a02he29 ... cPTZIP_tar


Note: This is setup to work on the Picturetel PTZ-2N, but can be adapted to any serial PTZ.

A detailed README is included...
MRD
scapeghost
Posts: 7
Joined: Wed Aug 12, 2009 2:28 pm

Thanks!

Post by scapeghost »

Great idea, mrd! I'm already using your (and gneuf's et. al.) latest PTZ2N control script. I've got a couple questions for ya.

1) I'd like to use your GenericIPPTZ control script to control a PTZ2N connected to another machine running the daemon, but the video output of the PTZ2N is connected directly to a capture card on the ZM server (via a long cable run). As such, since it's a "local" source, ZM only allows me to choose "local" control scripts. Since GenericIPPTZ is set up as "remote", I can't see it as a choice. I tried setting up the GenericIPPTZ control as "local", but then it fails to work. I'm sure ZM isn't handling the IP and port values correctly as "local". (zmcontrol.log: "[Can't connect: No such file or directory]") This seems to be a limitation of ZM, i.e. you can't have a local source with a remote control (or vice versa). Know of any way around this, other than setting up palantir or similar on the ZM box itself and using it as a "remote" source?

2) I'd like to be able to send commands to the daemon from another script. Looking at the source, it looks to be listening on the specified port with UDP, but I'm not sure how to send those commands with something other than ZM.
mrd
Posts: 269
Joined: Wed Apr 26, 2006 12:39 am
Location: Boston USA

Post by mrd »

I bet you can just create another monitor and use the controls in one monitor and view the stream from another. Not ideal, but it would probably work. I'm not sure if when you choose "File" as your source on a second monitor, that you'll have the option to create a remote control, but that may be a trick that someone can help with.

I do have some apps that can work with the GenericPTZIP.pm control module. They are written in PerlTk or tclTk though. If you need more flexibility, you can hack the GenericPTZIP.pm code into a command line tool fairly easily.

I'll see if I can scrape together what I have and post it for download, but I'm very busy for the next few weeks as I'm getting married and heading out on a honeymoon.. :-)
MRD
scapeghost
Posts: 7
Joined: Wed Aug 12, 2009 2:28 pm

Post by scapeghost »

Well congrats and enjoy the honeymoon. Just don't hide any PTZs in the honeymoon suite. :oops:

That'd be great if you could post some example code, but no rush. Go enjoy yourselves. :)

I'm planning to put a script together to implement some timeouts, e.g. return to a preset (or sleep) after a period of inactivity, patrol (cycle through presets), etc. If I ever get around to it, I'll post it. :roll:
mrd
Posts: 269
Joined: Wed Apr 26, 2006 12:39 am
Location: Boston USA

Post by mrd »

Ok... I got a little carried away and wrote a perl script to do what you described.

Basically you can set up the script to run through cron and it will tell the remote camera to go through any series of presets and pause a specified amount of time at each one. All the while, it will use zmtrigger.pl to set the monitor from Nodect to Record and back to Nodect when the "Patroling" is finished. You'll see events that show "Patroling" as the cause and if you follow the brief instructions, the timestamp string will show "Patroling" and "Idle" as an onscreen status.

There are a number of options that can be specified on the command line, but all can be hardcoded to avoid long command strings.

The script is well documented in the header so open it up and take a look.

* GenericPTZIP_Patrol_CLI.pl

http://www.filefactory.com/file/ah2ehdb ... rol_CLI_pl

This script could easily be adapted to work with any network or even serial attached camera. As described in my original post on this thread, you can adapt my remote daemon to talk to any camera and this script will work with it by default.[/url]
MRD
scapeghost
Posts: 7
Joined: Wed Aug 12, 2009 2:28 pm

Post by scapeghost »

:shock:
Nice! I haven't looked at the code yet, but it sounds great. I was planning to toggle motion detection too :)
Post Reply