PictureTel PTZ2N/PTZ2P Control Script Beta Now Available

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.
gneuf
Posts: 62
Joined: Mon Apr 19, 2004 7:24 pm

PictureTel PTZ2N/PTZ2P Control Script Beta Now Available

Post by gneuf »

I've finished the beta version of my PictureTel PTZ2N control script.

It does lots of stuff, described in the short readme file I cobbled together.

It's for 1.21.4, but the 1.22.1 version isn't far behind.

If this script hits the spot for your current ZoneMinder installation, or if you purchase one of these cameras to use with ZoneMinder because you can now control it...

...please, please, please consider donating to ZoneMinder.
Indispensability is priceless.
-Anon
Now available, for a limited time only at:

http://www.neufweb.net/zmcontrol-ptel.tgz

Let me know if you need them as straight text files instead of this gzipped-tar archive and I'll post it.
Last edited by gneuf on Thu Jun 11, 2009 2:23 am, edited 1 time in total.
jameswilson
Posts: 5111
Joined: Wed Jun 08, 2005 8:07 pm
Location: Midlands UK

Post by jameswilson »

great stuff matey
James Wilson

Disclaimer: The above is pure theory and may work on a good day with the wind behind it. etc etc.
http://www.securitywarehouse.co.uk
gneuf
Posts: 62
Joined: Mon Apr 19, 2004 7:24 pm

Post by gneuf »

And now, the PTZ2N PictureTel camera control script for

1.22.0!

EDIT: This is the updated one for 1.22.3

http://www.neufweb.net/zm_control_ptel.tgz

Check out the readme before you start...
Last edited by gneuf on Thu Jun 11, 2009 4:13 am, edited 2 times in total.
qthrul
Posts: 1
Joined: Sat May 20, 2006 4:06 am

just testing controls

Post by qthrul »

Do you have a script you were using to verify your issue of commands to your PTZ-2N? I'm still stuck on verifying that the PTZ-2N is serially connected :)
gneuf
Posts: 62
Joined: Mon Apr 19, 2004 7:24 pm

Post by gneuf »

The control script can show you the serial conversation if you turn debugging on and up in ZM. You could also uncomment all the logging stuff in the perl script - it shows the handshake as well.

Assuming your port is correct, your cable is ok, etc, etc...

You may not get any response from the camera until you reset it. You can do that by clicking the Reset button in the ZM control page on the Watch-mode window.

You could also issue the command "zmcontrol-ptel.pl reset" at a shell prompt (/usr/local/bin/zmcontrol-ptel.pl reset?).

As a last resort, try pressing the "Wake" button in the camera control window. It issues a reset and then a delayed power-on command. If those don't do it, you'll have to connect something up to the serial port with a null modem and see if anything is getting through.

If you have a Windoze box handy, I highly recommend testing your PictureTel and serial cable setup using a nice program called "BDLCAM" for Windows.

BDLCAM let's you excercise the camera with (almost) no setup with regard to serial port. If BDLCAM can't move the camera, either the cable is no good, it needs a null-modem, or the serial logic/handshake and/or servos/encoders in the camera are ill.

And...BDLCAM web-serves and controls the camera quite nicely if you're in need of such a program for a Windows software base.
mrd
Posts: 269
Joined: Wed Apr 26, 2006 12:39 am
Location: Boston USA

Post by mrd »

I can't seem to open the files on either a windows box or a unix box?

What type of file are they?

I tried Winzip and tar -xvf ...

Thanks,
mrd
MRD
gneuf
Posts: 62
Joined: Mon Apr 19, 2004 7:24 pm

Post by gneuf »

I haven't looked at them recently, but they're gzipped-tar I think.

Try:

tar -zxvf <filename>

The added z flag uses gzip to decompress the file before untarring...
mrd
Posts: 269
Joined: Wed Apr 26, 2006 12:39 am
Location: Boston USA

Post by mrd »

I think I got it. I copied the file to a .tar.Z file and then ran gunzip on it and then tar -xvf...

Wow...lol

Anyway, I've been trying to find a program to use with my PTZ4N instead of the windows based BLDCAM. Your program looks promising, but can you give me a hint on a command line that it would accept to save me some trial and error?


Thanks very much,
mrd
MRD
gneuf
Posts: 62
Joined: Mon Apr 19, 2004 7:24 pm

Post by gneuf »

Look in the zmcontrol-ptel.pl Perl script: Scroll down to line 1068.

There you'll find the "switch" statement that contains all the possible commands that the script understands.

For example, one command is "move_rel_up" - that means "move relative up". That command takes two args - $tiltstep and $tiltspeed.

So, to use that from the command line, you type:

> zmcontrol-ptel.pl command=move_rel_up tiltstep=10 tiltspeed=10

Which should make the camera tilt up at speed 10, for 10 units.

You can try the other commands by reading this switch table and trying other unit values on the command line.

Remember to start with:

> zmcontrol-ptel.pl command=reset

*First*...the camera should swing around to the park position (full left, full up), and then point straight ahead.

I hope the PTZ4N commands are similar to the -2N - otherwise, nothing will happen.

I'll go see if I can find the PTZ4N command list and compare it to the -2N...
mrd
Posts: 269
Joined: Wed Apr 26, 2006 12:39 am
Location: Boston USA

Post by mrd »

Perfect!

I'll try to play around with it ASAP...

Thanks so much!
mrd
MRD
mrd
Posts: 269
Joined: Wed Apr 26, 2006 12:39 am
Location: Boston USA

Post by mrd »

I'm getting an error "Can't locate ZoneMinder.pm" on my system that is running the Madrake live CD version of ZM. Any ideas where it is located or what to do?

Thanks
mrd
MRD
gneuf
Posts: 62
Joined: Mon Apr 19, 2004 7:24 pm

Post by gneuf »

Ooooooh.

That's a tough one. ZM's camera control setup has changed (codewise) recently - I had to take that into account when I wrote another camera controller routine.

ZoneMinder.pm contains the routines for extracting camera data from the ZM database that the camera control software uses.

You'll need some info as to how to integrate the added camera control code to the existing CDROM-based ZM data. Perhaps you can find the answer by searching the ZM site or the Wiki?

I think this code is integrated into the latest release of ZM, but I've been too busy to install the latest or to refine the camera control/video stream software I already worked on...sorry.

What version of ZM is on the Mandrake Live CD?


If I can get you some more hints I'll post again later tonight...
mrd
Posts: 269
Joined: Wed Apr 26, 2006 12:39 am
Location: Boston USA

I'm back and in need of some help again...

Post by mrd »

I'm finnaly getting back to trying to make zomeminder work for me. I have everything working in a very basic sense but I'm having trouble getting my camera controls to work. I have the latest LiveCD version installed to hard disk and I can't seem to find /usr/loca/bin/zmcontrol-ptel.zm on it. Should it be there?

Also, I've selected /dev/ttyS0 as my serial device since my system only has one serial port and sony-VISCA as my control type. Is this correct?

I'm trying this on a PTZ-4N but I also have a PTZ-2N that I can swap in.

Thanks,
MRD
mrd
Posts: 269
Joined: Wed Apr 26, 2006 12:39 am
Location: Boston USA

I jumped the gun again...

Post by mrd »

I hooked up my PTZ-2N and I've got your script working. Now I just need to know how to get it populated into the dropdown menu in the zm "control type" feild.

Thanks,
MRD
mrd
Posts: 269
Joined: Wed Apr 26, 2006 12:39 am
Location: Boston USA

While I have your attention...

Post by mrd »

I'd also like to know what all the values should be in the "control" configurations. There are many numeric values that need to be filled in, but I have no idea where to get them from.

Also, it seems that the same script will not work for my PTZ-4N. What would it take to make it work. I can probably figure it out if you can show me the commands that should be used compare to the existing 2N ones. If you have any documentation, I'd love to take a stab at building a zmcontrol-ptel4N.pl.

Thanks so much,
MRD
Post Reply