PicturetelControlScript

From ZoneMinder Wiki
Revision as of 19:07, 2 December 2007 by Gneuf (talk | contribs)
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-SNC-M3W.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

<DONE TO HERE FOR NOW>

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
    • SNC-M3W
  • Type
    • Pulldown <Remote>
  • Command
    • zmcontrol-SNC-M3W.pl
  • Can Wake
    • <Check This - waking forces the camera into MJPEG mode for ZM>
  • Can Sleep
    • <Check This - Sleeping sets the camera to MPEG mode>
  • Can Reset
    • <Check This - Sleeping sets the camera to MPEG mode also>

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
    • -60
  • Max Pan Range
    • 60
  • Min Pan Step
    • 0
  • Max Pan Step
    • 60 <This makes clicking the tip of the arrow move the camera about 1/2 it's pan range>
  • Has Pan Speed
    • <Check This>
  • Min Pan Speed
    • 0
  • Max Pan Speed
    • 10
  • 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
    • -60
  • Max Tilt Range
    • 10
  • Min Tilt Step
    • 0
  • Max Tilt Step
    • 40 This makes clicking the tip of the arrow move the camera about 1/2 it's tilt range
  • Has Tilt Speed
    • <Check This>
  • Min Tilt Speed
    • 0
  • Max Tilt Speed
    • 10
  • Has Turbo Tilt
    • <Do Not Check This>
  • Turbo Tilt Speed
    • Leave Blank

Click on the "Zoom" Tab. Since the control script can't zoom the camera (it doesn't have any actual built-in Zoom function AFAIK), make sure these are all unchecked boxes and blank (empty) fields.


Click on the "Focus" Tab. Since the control script can't Focus the camera (it doesn't have any actual built-in Focus function AFAIK), make sure these are all unchecked boxes and blank (empty) fields.


Click on the "White" Tab. Since the control script can't White Balance the camera (it doesn't have any actual built-in White Balance function AFAIK), make sure these are all unchecked boxes and blank (empty) fields.


Click on the "Iris" Tab. Since the control script can't Focus the camera (it doesn't have any actual built-in Iris function AFAIK), make sure these are all unchecked boxes and blank (empty) fields.


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

  • Has Presets
    • <Check This>
  • Num Presets
    • 8
  • Has Home Preset
    • <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.

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

Since I wanted to make the camera play nice with Internet Explorer users, I programmed the Power, Wake, and Sleep like so:

Wake - This switches the camera into MJPEG streaming mode, since this is the format ZM can capture video from the camera.

Sleep - This switches the camera into MPEG streaming mode, so when there are no ZM users accessing the camera, IE users get better sound quality in MPEG mode.

Reset - Same as Sleep mode.

So, huge note:

You won't get any video in ZM unless you manually set the camera into "JPEG" mode using IE in Windows,

or you PRESS THE "WAKE" BUTTON IN ZM!!!

OLD

Please be patient - I'll get to this shortly.

The Control Script

How to set it up

How it works

Other nifty commands in the Control Script

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

Darn these serial ports!