Difference between revisions of "PicturetelControlScript"

From ZoneMinder Wiki
Jump to navigationJump to search
m
m
Line 8: Line 8:
Make it executable.  You might need to be root to do that:
Make it executable.  You might need to be root to do that:


shell> chmod +x /usr/local/bin/zmcontrol-SNC-M3W.pl.
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.
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.
Line 38: Line 38:
In the first Tab, "Main", enter the following values.
In the first Tab, "Main", enter the following values.
*Name '''
*Name '''
**'''SNC-M3W
**'''PictureTel-PTZ2N
*Type
*Type
**'''Pulldown <Remote>
**'''Pulldown <Local>
*Command
*Command
**'''zmcontrol-SNC-M3W.pl
**'''zmcontrol-ptel.pl
*Can Wake
*Can Wake
**'''<Check This - waking forces the camera into MJPEG mode for ZM>
**'''<Check This>
*Can Sleep
*Can Sleep
**'''<Check This - Sleeping sets the camera to MPEG mode>
**'''<Check This>
*Can Reset
*Can Reset
**'''<Check This - Sleeping sets the camera to MPEG mode also>
**'''<Check This>
----
----


Line 70: Line 70:
**'''<Check This>
**'''<Check This>
*Min Pan Range
*Min Pan Range
**'''-60
**'''700
*Max Pan Range
*Max Pan Range
**'''60
**'''2900
*Min Pan Step
*Min Pan Step
**'''0
**'''1
*Max Pan Step
*Max Pan Step
**'''60 ''<This makes clicking the tip of the arrow move the camera about 1/2 it's pan range>''
**'''999 ''<This is so the script can change modes seamlessly>''
*Has Pan Speed
*Has Pan Speed
**'''<Check This>
**'''<Don't Check This>
*Min Pan Speed
*Min Pan Speed
**'''0
**'''<Leave Blank>
*Max Pan Speed
*Max Pan Speed
**'''10
**'''<Leave Blank>
*Has Turbo Pan
*Has Turbo Pan
**'''<Do Not Check This>
**'''<Do Not Check This>
*Turbo Pan Speed
*Turbo Pan Speed
**'''Leave Blank
**'''<Leave Blank>
----
----


Line 93: Line 93:
**'''<Check This>
**'''<Check This>
*Min Tilt Range
*Min Tilt Range
**'''-60
**'''750
*Max Tilt Range
*Max Tilt Range
**'''10
**'''1200
*Min Tilt Step
*Min Tilt Step
**'''0
**'''1
*Max Tilt Step
*Max Tilt Step
**'''40 ''This makes clicking the tip of the arrow move the camera about 1/2 it's tilt range''
**'''999 ''<This is so the script can change modes seamlessly>''
*Has Tilt Speed
*Has Tilt Speed
**'''<Check This>
**'''<Don't Check This>
*Min Tilt Speed
*Min Tilt Speed
**'''0
**'''<Leave Blank>
*Max Tilt Speed
*Max Tilt Speed
**'''10
**'''<Leave Blank>
*Has Turbo Tilt
*Has Turbo Tilt
**'''<Do Not Check This>
**'''<Do Not Check This>
*Turbo Tilt Speed
*Turbo Tilt Speed
**'''Leave Blank
**'''<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 "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.  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 "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. 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 "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.  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 "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>
----
----


Line 128: Line 222:
**'''<Check This>
**'''<Check This>
*Num Presets
*Num Presets
**'''8
**'''11
*Has Home Preset
*Has Home Preset
**'''<Check This>
**'''<Don't Check This>
*Can Set Presets
*Can Set Presets
**'''<Check This>
**'''<Check This>
Line 140: Line 234:


== Using the control in ZM ==
== 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 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 RelativeYou 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.
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.
Line 148: Line 244:
== Other nifty commands implemented in the control ==
== 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 ==
== OLD ==



Revision as of 19:27, 2 December 2007

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

<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
    • 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

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!