Difference between revisions of "Sony"

From ZoneMinder Wiki
Jump to navigationJump to search
Line 6: Line 6:
== How to get the Control Script Ready ==
== How to get the Control Script Ready ==


Unzip and untar the files somewhere.  Copy the zmcontrol-SNC-M3W.pl file to /usr/local/bin.  Chmod +x /usr/local/bin/zmcontrol-SNC-M3W.pl.
Unzip and untar the files somewhere.  Copy the zmcontrol-SNC-M3W.pl file to /usr/local/bin.   
 
Make it executable.  You might need to be root to do that:
 
Chmod +x /usr/local/bin/zmcontrol-SNC-M3W.pl.


With your favorite editor, go into the zmcontrol-SNC-M3W.pl file and edit the camera information - the IP Address, the port, the user name, and the password.
With your favorite editor, go into the zmcontrol-SNC-M3W.pl file and edit the camera information - the IP Address, the port, the user name, and the password.


The line looks something like:
The default line looks something like:


my $address = "user:password\@192.168.1.192:9000
my $address = "user:password\@192.168.1.192:9000


Replace user, password, the IP (192.168.1.192), and if you didn't change the default port of the camera using IE, then leave it as 9000.
Replace user, password, the IP (192.168.1.192), and if you didn't change the default port of the camera using IE, then leave it as 9000.  Otherwise, set it identically to the way it's set in IE - if it's 9002, then change 9000 to 9002 here, too.


Remember to save the file.
Remember to save the file.

Revision as of 06:15, 30 November 2007

Where to get the patches

Sony SNC patches for 1.22.1 and 1.22.3. The 1.22.1 version does not support capture in PCRE Remote camera mode.

How to get the Control Script Ready

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

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

Chmod +x /usr/local/bin/zmcontrol-SNC-M3W.pl.

With your favorite editor, go into the zmcontrol-SNC-M3W.pl file and edit the camera information - the IP Address, the port, the user name, and the password.

The default line looks something like:

my $address = "user:password\@192.168.1.192:9000

Replace user, password, the IP (192.168.1.192), and if you didn't change the default port of the camera using IE, then leave it as 9000. Otherwise, set it identically to the way it's set in IE - if it's 9002, then change 9000 to 9002 here, too.

Remember to save the file.

How to apply the patches

If you don't have ZM installed from source, this is where you figure out how to do that. Use the WIki. Use the Forum. Use the Docs. It's easy. Go ahead. I'll wait.

Go to the src/ directory in your installation:

cd /home/myhome/mysources/Zoneminder-1.22.3/src

Patch the first file:

patch zm_remote_camera.cpp < /home/somewhere/you/extracted/the/patches/zm_remote_camera-1.22.3.cpp.patch

And the second:

patch zm_remote_camera.h < /home/somewhere/you/extracted/the/patches/zm_remote_camera-1.22.3.h.patch

Hopefully, there were no errors. If chunks fail, you might have a version mismatch, or your sources may already have been patched? If it worked, you should now be able to recompile and reinstall ZM:

make && make install

Voila! Hopefully, that's done.

Configuring the camera

First, you need to set up the camera using Internet Explorer. Go to the camera's IP address like so:

http://[ip address]/image1

Click on the "Setting" button near the top of the page. A new Explorer window opens. In this window, on the left, click on the "Camera" link.

On the "Common" Tab, set the camera into JPEG mode by clicking on the "Video mode" JPEG radio button. Select the resolution you want to use from the "Image size" pulldown menu. I use "320x240". Press the "Ok" button.

Now click on the "JPEG" Tab, and pick your desired frame rate. I use 5 fps. Press the "Ok" button.

Now you're done using Internet Explorer. Whew!

Setting up the monitor in ZM

Now you need to add a monitor for this camera to ZM. In the Console page, click on the "New Monitor" button. In the first Tab, "General", enter the following values.

  • Name
    • <Type in an appropriate name for this monitor>
  • Source Type
    • Pulldown <Remote>
  • Function
    • Pulldown <Monitor>
  • Enabled
    • <Check This>
  • Linked Monitors
    • <Leave alone>
  • Maximum FPS
    • <The frame rate you set using Internet Explorer, above. I used 5.>
  • Alarm Maximum FPS
    • <Leave alone>
  • Reference Image Blend
    • <Leave alone>
  • Triggers
    • <Leave alone>

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

  • Remote Host Name
    • [username]:[password]@[camera IP address]
  • Remote Host Port
    • 80 (unless you changed this in the Internet Explorer camera setup page "Network")
  • Remote Host Path
    • /mjpeg?speed=5
  • Remote Image Colors
    • Pulldown <24 bit color>
  • Linked Monitors
    • <Leave alone>
  • Capture Width (pixels)
    • <The image width you set using Internet Explorer, above. I used 320>
  • Capture Height (pixels)
    • <The image height you set using Internet Explorer, above. I used 240>
  • Orientation
    • Pulldown <Normal>



Now you MUST click on the "Save" button, and after a few moments, the new monitor will appear in the ZM Console window.



If you click on the monitor name, assuming you did everything right, a window should open and you should see the video from the camera.

Where to get the Control module

Here!

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

More in the morning...

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.

And some other stuff goes here.

Other nifty commands implemented in the control