Zoneminder 1.24 + Ethernet camera Sony SNC-RZ30P

Forum for questions and support relating to the 1.24.x releases only.
Locked
User avatar
caladeira
Posts: 64
Joined: Wed Dec 05, 2007 10:57 am
Location: Lisbon

Zoneminder 1.24 + Ethernet camera Sony SNC-RZ30P

Post by caladeira »

Hello!

I have a network camera Sony SNC-RZ30P and I'd like to be able to control it with ZoneMinder.

I've been following this post http://www.zoneminder.com/forums/viewtopic.php?t=10995 but it's not for the current ZoneMinder version.

Unfotunately the wiki wasn't much helpfull, so I'd like some help seting it up with ZoneMinder 1.24.

Since I have one camera, I can build the script from scratch, but for that I need some guidelines how it's supposed to work.

Appreciate any help.
christophe_y2k
Posts: 102
Joined: Mon Oct 12, 2009 8:47 am
Location: EUROPE-FRANCE-MANDELIEU

SNC-RZ30P with zonemind v1.23.3 under linux gentoo 64

Post by christophe_y2k »

Hello
i search to use ptz function on this sony ip cam SNC-RZ30P

i try to use sony visca with
Remote Host Path: /image?speed=5
with no success, i have image but no ptz working....

any idea?

i found doc about sony visca function on this modele

http://www.cs.unc.edu/Research/stc/FAQs ... 2.00EN.pdf
User avatar
caladeira
Posts: 64
Joined: Wed Dec 05, 2007 10:57 am
Location: Lisbon

Post by caladeira »

Hello!

I've seen that document already.

Unfortunately I don't have enough skills to develop a script and the information on how to do it isn't very helpful if you don't know already the steps involved.

As soon as I have some time, I'll try something and post the results on this thread.

Thanks.
christophe_y2k
Posts: 102
Joined: Mon Oct 12, 2009 8:47 am
Location: EUROPE-FRANCE-MANDELIEU

SONY PTZ LAN

Post by christophe_y2k »

Ok i try to adapt the PanasonicIP.pm script for sony ptz cam

Scripts are in this folder on my Gentoo 64 server :

/usr/lib64/perl5/site_perl/5.8.8/ZoneMinder/Control
AxisV2.pm
Ncs370.pm
PanasonicIP.pm
PelcoD.pm
Visca.pm

ok that work now my sony cams move !!!!
i need to adapt the script ...
after i send script for this ip cam
Storm
Posts: 4
Joined: Fri Oct 30, 2009 9:58 pm

Post by Storm »

I have several SNC-RZ50N cameras. Did somebody manage to make any of the sony cameras to have PTZ?
At the moment I'm using the cameras on ubuntu 9.10 and they work with no problems but I can't make them to be controllable.
christophe_y2k
Posts: 102
Joined: Mon Oct 12, 2009 8:47 am
Location: EUROPE-FRANCE-MANDELIEU

Hello, script for sony lan ptz cam RZ30

Post by christophe_y2k »

Hello i send my script is not 100% workable, i need to add preset function
but i think you're probably happy to use it
move with control icon ok
move with click on image seem to work but need some adjust ( that work with 640 or 720 large pixel image)
zoom ok
...
in my linux gentoo64 server the script is here :

/usr/lib64/perl5/site_perl/5.8.8/ZoneMinder/Control/SONY_SNC_RZ30.pm
...

Code: Select all

# ==========================================================================
#
# ZoneMinder SONY_SNC_RZ30 API Control Protocol Module, $Date: 2009-10-29 08:55:00 +0100 (Tue, 04 Oct 2009) $, $Revision: 2229bis $
# Copyright (C) 2003, 2004, 2005, 2006  Philip Coombes
# Copyright (C) 2009 Christophe DAPREMONT 
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
#
# ==========================================================================
#
# This module contains the implementation of the SONY_SNC_RZ30 API camera control
# protocol
#
package ZoneMinder::Control::SONY_SNC_RZ30;

use 5.006;
use strict;
use warnings;

require ZoneMinder::Base;
require ZoneMinder::Control;

our @ISA = qw(ZoneMinder::Control);

our $VERSION = $ZoneMinder::Base::VERSION;

# ==========================================================================
#
# SONY_SNC_RZ30 Control Protocol
#
# ==========================================================================

use ZoneMinder::Debug qw(:all);
use ZoneMinder::Config qw(:all);

use Time::HiRes qw( usleep );

sub new
{
    my $class = shift;
    my $id = shift;
    my $self = ZoneMinder::Control->new( $id );
    bless( $self, $class );
    srand( time() );
    return $self;
}

our $AUTOLOAD;

sub AUTOLOAD
{
    my $self = shift;
    my $class = ref($self) || croak( "$self not object" );
    my $name = $AUTOLOAD;
    $name =~ s/.*://;
    if ( exists($self->{$name}) )
    {
        return( $self->{$name} );
    }
    Fatal( "Can't access $name member of object of class $class" );
}

sub open
{
    my $self = shift;

    $self->loadMonitor();

    use LWP::UserAgent;
    $self->{ua} = LWP::UserAgent->new;
    $self->{ua}->agent( "ZoneMinder Control Agent/".ZM_VERSION );

    $self->{state} = 'open';
}

sub close
{
    my $self = shift;
    $self->{state} = 'closed';
}

sub printMsg
{
    my $self = shift;
    my $msg = shift;
    my $msg_len = length($msg);

    Debug( $msg."[".$msg_len."]" );
}

sub sendCmd
{
    my $self = shift;
    my $cmd = shift;

    my $result = undef;

    printMsg( $cmd, "Tx" );

    #print( "http://$address/$cmd\n" );
    my $req = HTTP::Request->new( GET=>"http://".$self->{Monitor}->{ControlAddress}."/$cmd" );
    my $res = $self->{ua}->request($req);

    if ( $res->is_success )
    {
        $result = !undef;
    }
    else
    {
        Error( "Error check failed: '".$res->status_line()."'" );
    }

    return( $result );
}

sub cameraReset
{
    my $self = shift;
    Debug( "Camera Reset" );
    my $cmd = "/";
    $self->sendCmd( $cmd );
}

sub moveMap
{
    my $self = shift;
    my $params = shift;
    my $xcoord = $self->getParam( $params, 'xcoord' );
    my $ycoord = $self->getParam( $params, 'ycoord' );
    Debug( "Move Map to $xcoord,$ycoord" );
#   my $cmd = "nphControlCamera?Direction=Direct&NewPosition.x=$xcoord&NewPosition.y=$ycoord&Width=".$self->{Monitor}->{Width}."&Height=".$self->{Monitor}->{Height};
    my $cmd = "command/ptzf.cgi?directPT=$xcoord,$ycoord";

    $self->sendCmd( $cmd );
}

sub moveConUp
{
    my $self = shift;
    Debug( "Move Up" );
    my $cmd = "command/ptzf.cgi?relative=0803";
#    my $cmd = "command/ptzf.cgi?visca=8101060109070302FF";
    $self->sendCmd( $cmd );
}

sub moveConDown
{
    my $self = shift;
    Debug( "Move Down" );
    my $cmd = "command/ptzf.cgi?relative=0203";
    $self->sendCmd( $cmd );
}

sub moveConLeft
{
    my $self = shift;
    Debug( "Move Left" );
    my $cmd = "command/ptzf.cgi?relative=0403";
    $self->sendCmd( $cmd );
}

sub moveConRight
{
    my $self = shift;
    Debug( "Move Right" );
    my $cmd = "command/ptzf.cgi?relative=0603";
    $self->sendCmd( $cmd );
}

sub moveConUpRight
{
    my $self = shift;
    Debug( "Move Up/Right" );
    my $cmd = "command/ptzf.cgi?relative=0903";
    $self->sendCmd( $cmd );
}

sub moveConUpLeft
{
    my $self = shift;
    Debug( "Move Up/Left" );
    my $cmd = "command/ptzf.cgi?relative=0703";
    $self->sendCmd( $cmd );
}

sub moveConDownRight
{
    my $self = shift;
    Debug( "Move Down/Right" );
    my $cmd = "command/ptzf.cgi?relative=0303";
    $self->sendCmd( $cmd );
}

sub moveConDownLeft
{
    my $self = shift;
    Debug( "Move Down/Left" );
    my $cmd = "command/ptzf.cgi?relative=0103";
    $self->sendCmd( $cmd );
}
sub zoomConTele
{
    my $self = shift;
    Debug( "Zoom Tele" );
    my $cmd = "command/ptzf.cgi?relative=1103";
    $self->sendCmd( $cmd );
}

sub zoomConWide
{
    my $self = shift;
    Debug( "Zoom Wide" );
    my $cmd = "command/ptzf.cgi?relative=1003";
    $self->sendCmd( $cmd );
}

sub zoomRelTele
{
    my $self = shift;
    my $params = shift;
    my $step = $self->getParam( $params, 'step' );
    Debug( "Zoom Tele" );
    my $cmd = "command/ptzf.cgi?relative=11$step";
    $self->sendCmd( $cmd );
}

sub zoomRelWide
{
    my $self = shift;
    my $params = shift;
    my $step = $self->getParam( $params, 'step' );
    Debug( "Zoom Wide" );
    my $cmd = "command/ptzf.cgi?relative=10$step";
    $self->sendCmd( $cmd );
}

sub focusConNear
{
    my $self = shift;
    Debug( "Focus Near" );
    my $cmd = "command/ptzf.cgi?relative=1203";
    $self->sendCmd( $cmd );
}

sub focusConFar
{
    my $self = shift;
    Debug( "Focus Far" );
    my $cmd = "command/ptzf.cgi?relative=1303";
    $self->sendCmd( $cmd );
}

sub focusAuto
{
    my $self = shift;
    Debug( "Focus Auto" );
    my $cmd = "/";
    $self->sendCmd( $cmd );
}

sub focusMan
{
    my $self = shift;
    Debug( "Focus Manual" );
    my $cmd = "/";
    $self->sendCmd( $cmd );
}

sub irisRelOpen
{
    my $self = shift;
    my $params = shift;
    my $step = $self->getParam( $params, 'step' );
    Debug( "Iris Open" );
#    my $cmd = "/axis-cgi/com/ptz.cgi?riris=$step";
    my $cmd = "/";
    $self->sendCmd( $cmd );
}

sub irisRelClose
{
    my $self = shift;
    my $params = shift;
    my $step = $self->getParam( $params, 'step' );
    Debug( "Iris Close" );
#    my $cmd = "/axis-cgi/com/ptz.cgi?riris=-$step";
    my $cmd = "/";
    $self->sendCmd( $cmd );
}

sub irisAuto
{
    my $self = shift;
    Debug( "Iris Auto" );
#    my $cmd = "/axis-cgi/com/ptz.cgi?autoiris=on";
    my $cmd = "/";
    $self->sendCmd( $cmd );
}

sub irisMan
{
    my $self = shift;
    Debug( "Iris Manual" );
#    my $cmd = "/axis-cgi/com/ptz.cgi?autoiris=off";
     my $cmd = "/";
    $self->sendCmd( $cmd );
}

sub presetClear
{
    my $self = shift;
    my $params = shift;
    my $preset = $self->getParam( $params, 'preset' );
    Debug( "Clear Preset $preset" );
#    my $cmd = "/axis-cgi/com/ptz.cgi?removeserverpresetno=$preset";
    my $cmd = "/";
    $self->sendCmd( $cmd );
}

sub presetSet
{
    my $self = shift;
    my $params = shift;
    my $preset = $self->getParam( $params, 'preset' );
    Debug( "Set Preset $preset" );
#    my $cmd = "/axis-cgi/com/ptz.cgi?setserverpresetno=$preset";
    my $cmd = "/";
    $self->sendCmd( $cmd );
}

sub presetGoto
{
    my $self = shift;
    my $params = shift;
    my $preset = $self->getParam( $params, 'preset' );
    Debug( "Goto Preset $preset" );
#    my $cmd = "/axis-cgi/com/ptz.cgi?gotoserverpresetno=$preset";
    my $cmd = "command/presetposition.cgi?PresetSet=$preset,zmPresetNumber$preset";
    $self->sendCmd( $cmd );
}

sub presetHome
{
    my $self = shift;
    Debug( "Home Preset" );
    my $cmd = "command/ptzf.cgi?directPT=320,240";
    $self->sendCmd( $cmd );
    my $cmd = "command/ptzf.cgi?relative=1010";
    $self->sendCmd( $cmd );
}

1;
__END__
# Below is stub documentation for your module. You'd better edit it!

=head1 NAME

ZoneMinder::Database - Perl extension for blah blah blah

=head1 SYNOPSIS

  use ZoneMinder::Database;
  blah blah blah

=head1 DESCRIPTION

Stub documentation for ZoneMinder, created by h2xs. It looks like the
author of the extension was negligent enough to leave the stub
unedited.

Blah blah blah.

=head2 EXPORT

None by default.



=head1 SEE ALSO

Mention other useful documentation such as the documentation of
related modules or operating system documentation (such as man pages
in UNIX), or any relevant external documentation such as RFCs or
standards.

If you have a mailing list set up for your module, mention it here.

If you have a web site set up for your module, mention it here.

=head1 AUTHOR

Philip Coombes, E<lt>philip.coombes@zoneminder.comE<gt>
Christophe DAPREMONT, E<lt>christophe@gh-pc.comE<gt>
=head1 COPYRIGHT AND LICENSE

Copyright (C) 2005 by Philip Coombes
Copyright (C) 2009 by Christophe DAPREMONT

This library is free software; you can redistribute it and/or modify
it under the same terms as Perl itself, either Perl version 5.8.3 or,
at your option, any later version of Perl 5 you may have available.


=cut
yackerena
Posts: 1
Joined: Fri Dec 11, 2009 9:04 am

Post by yackerena »

How can i split one Ethernet cable off a router connected to a modem? How can i do this to have 2 active connections off that one cable at once. Can i attach another router to the cable off the previous router?
bcromwell
Posts: 1
Joined: Thu Dec 17, 2009 4:03 am

Post by bcromwell »

You can buy adapters or DIY if you know what you are doing. Firefold.com is where I bought mine. This one is designed for a wall plate, if you want to split just the cable (male ends) then you will need two adapters and two rj45 couplers.

Image

You can see the pinout on the side of the adapter if you diy it.
User avatar
kingofkya
Posts: 1110
Joined: Mon Mar 26, 2007 6:07 am
Location: Las Vegas, Nevada

Post by kingofkya »

Just a FYI Also note when using these adapters you reduce you network speed if you go past 10 ft because you are now allowing outside interfernace because you removed the ground wires.
Locked