PicturetelControlScript

From ZoneMinder Wiki
Jump to navigationJump to search

Where to get the control script

Here!

How to get the Control Script Ready

Unzip and untar the files somewhere. Copy the zmcontrol-ptel.pl file to /usr/local/bin.

Make it executable. You might need to be root to do that:

shell> chmod +x /usr/local/bin/zmcontrol-ptel.pl.

With your favorite editor, go into the zmcontrol-ptel.pl file and edit the serial port information - the linux device node of the serial port your camera is connected to.

The default line looks something like:

my $device = "/dev/ttyS0"

Replace this with your serial port. Serial ports are tricky - see below

Remember to save the file when you're done.

Setting up the control in ZM

First, you'll have to "Install" the control by following these steps. From the ZM Console, click on the source link of the monitor you created for the camera. It's listed as the IP address of your camera. When you click it, it's configuration page opens in a new window.

Now click on the "Control" Tab. Put a check mark in "Controllable".

Here you need to look closely - on the next line, marked "Control Type", there's a pulldown. Next to the pulldown to the right, there's a link named "Edit".

Before you can use this new control script you downloaded, you have to create an entry for it by clicking on "Edit".

A new window opens that shows you all the types of control scripts ZM knows about. In this window, you need to press the "Add New Control" button.

A newer window opens that shows you all the things ZM needs to know about a Control Script. Here's what to put in there:

In the first Tab, "Main", enter the following values.

  • Name
    • PictureTel-PTZ2N
  • Type
    • Pulldown <Local>
  • Command
    • zmcontrol-ptel.pl
  • Can Wake
    • <Check This>
  • Can Sleep
    • <Check This>
  • Can Reset
    • <Check This>

Now click on the "Move" Tab, and enter the following:

  • Can Move
    • <Check This>
  • Can Move Diagonally
    • <Check This>
  • Can Move Mapped
    • <Check This>
  • Can Move Absolute
    • <Check This>
  • Can Move Relative
    • <Check This>
  • Can Move Continuous
    • <Check This Only If You Prefer Continuous Motion Mode - I prefer Relative Motion Mode>

Click on the "Pan" Tab, and enter the following:

  • Can Pan
    • <Check This>
  • Min Pan Range
    • 700
  • Max Pan Range
    • 2900
  • Min Pan Step
    • 1
  • Max Pan Step
    • 999 <This is so the script can change modes seamlessly>
  • Has Pan Speed
    • <Don't Check This>
  • Min Pan Speed
    • <Leave Blank>
  • Max Pan Speed
    • <Leave Blank>
  • Has Turbo Pan
    • <Do Not Check This>
  • Turbo Pan Speed
    • <Leave Blank>

Click on the "Tilt" Tab, and enter the following:

  • Can Tilt
    • <Check This>
  • Min Tilt Range
    • 750
  • Max Tilt Range
    • 1200
  • Min Tilt Step
    • 1
  • Max Tilt Step
    • 999 <This is so the script can change modes seamlessly>
  • Has Tilt Speed
    • <Don't Check This>
  • Min Tilt Speed
    • <Leave Blank>
  • Max Tilt Speed
    • <Leave Blank>
  • Has Turbo Tilt
    • <Do Not Check This>
  • Turbo Tilt Speed
    • <Leave Blank>

Click on the "Zoom" Tab and enter the following:

  • Can Zoom
    • <Check This>
  • Can Zoom Absolute
    • <Check This>
  • Can Zoom Relative
    • <Check This>
  • Can Zoom Continuous
    • <Check This>
  • Min Zoom Range
    • 1
  • Max Zoom Range
    • 999
  • Min Zoom Step
    • 1
  • Max Zoom Step
    • 300
  • Has Zoom Speed
    • <Do Not Check This>
  • Min Zoom Speed
    • <Leave Blank>
  • Max Zoom Speed
    • <Leave Blank>

Click on the "Focus" Tab and enter the following:

  • Can Focus
    • <Check This>
  • Can Auto Focus
    • <Check This>
  • Can Focus Absolute
    • <Do Not Check This>
  • Can Focus Relative
    • <Check This>
  • Can Focus Continuous
    • <Do Not Check This>
  • Min Focus Range
    • 1
  • Max Focus Range
    • 1000
  • Min Focus Step
    • 1
  • Max Focus Step
    • 8
  • Has Focus Speed
    • <Do Not Check This>
  • Min Focus Speed
    • <Leave Blank>
  • Max Focus Speed
    • <Leave Blank>

Click on the "White" Tab and enter the following:

  • Can White Bal.
    • <Check This>
  • Can Auto White Bal.
    • <Check This>
  • Can White Bal. Absolute
    • <Do Not Check This>
  • Can White Bal. Relative
    • <Check This>
  • Can White Bal. Continuous
    • <Check This>
  • Min White Bal. Range
    • 1
  • Max White Bal. Range
    • 100
  • Min White Bal. Step
    • 0
  • Max White Bal. Step
    • 10
  • Has White Bal. Speed
    • <Do Not Check This>
  • Min White Bal. Speed
    • <Leave Blank>
  • Max White Bal. Speed
    • <Leave Blank>

Click on the "Iris" Tab and enter the following:

  • Can Iris
    • <Check This>
  • Can Auto Iris
    • <Check This>
  • Can Iris Absolute
    • <Do Not Check This>
  • Can Iris Relative
    • <Check This>
  • Can Iris Continuous
    • <Check This>
  • Min Iris Range
    • 1
  • Max Iris Range
    • 100
  • Min Iris Step
    • 1
  • Max Iris Step
    • 8
  • Has Iris Speed
    • <Do Not Check This>
  • Min Iris Speed
    • <Leave Blank>
  • Max Iris Speed
    • <Leave Blank>

Click on the "Presets" Tab, and enter the following:

  • Has Presets
    • <Check This>
  • Num Presets
    • 11
  • Has Home Preset
    • <Don't Check This>
  • Can Set Presets
    • <Check This>

Don't forget to Click Save!!!

Done! Close all the ZM windows in reverse order, reopen a Monitor window for your camera, and look for a link in the upper left of the window that says Control. When you click on it, the camera controls will appear and you're in business! Pan and Tilt away...

Using the control in ZM

In the monitor window, you'll now have a "Control" link in the upper left. Clicking it gets you the control panel below the video window.

Clicking the arrows moves that camera in the current mode which is Relative. You can change the various setting from Relative to Continuous to Absolute for different effects when clicking the controls. See the README for more information about the control script and the ZM control modes.

Click a preset to make the Camera slew to that preset position; Click the Preset "Set" button to pick a preset and save the current camera position into that preset.

The Center X centers the camera.

Other nifty commands implemented in the control

I'm not telling. HA! There...now you'll HAVE TO read the README file...

Why it's not doing what you expect when you change the Control Setup in ZM

It's all in the README file. Short version: some of the control settings values are synthetic in order to be able to change control modes without adjusting any values.

Darn these serial ports!

Yes, they're tricky. Which port is which dev node? Is the cable correct? Is something else using the port in the inittab (getty?)?

You'll have to consult the README for other tips and tricks for the serial ports.