Vilar mini domo cam (ip camera)

Forum for questions and support relating to the 1.25.x releases only.
Post Reply
User avatar
aodiaz
Posts: 26
Joined: Thu Apr 25, 2013 3:38 am
Location: Argentina

Vilar mini domo cam (ip camera)

Post by aodiaz » Sun Aug 18, 2013 6:17 pm

Hello, wanted to know if someone could give me a help with PTZ control of a camera mini dome Vilar (ip camera), the add on my ZM 1.25 display correctly but I can NOT Its precise PTZ controls, no movement!.
Someone could help me!

Thanks
Antonio

User avatar
aodiaz
Posts: 26
Joined: Thu Apr 25, 2013 3:38 am
Location: Argentina

Re: Vilar mini domo cam (ip camera)

Post by aodiaz » Wed Aug 21, 2013 11:41 pm

anyone had this problem??????

User avatar
knight-of-ni
Posts: 2231
Joined: Thu Oct 18, 2007 1:55 pm
Location: Shiloh, IL

Re: Vilar mini domo cam (ip camera)

Post by knight-of-ni » Fri Aug 23, 2013 3:34 pm

You have not posted enough technical information to even allow someone to guess.

Does this camera have a model number?

Go the manufacturer's website and look for a CGI script programmer's handbook.

Do the camera's ptz controls work from a browser other than Internet Explorer? If so then you could likely get them to work in zoneminder with some effort.

From the camera's own webpage, look at the html source to determine what the ptz control commands are. You can do the same thing using Wireshark to monitor the tcp data being sent to the camera.

Are there any cameras out there that are clones of this camera? If the another camera's webpage looks nearly identical to your camera, then you can assume the other camera's documentation will also apply to yours.
Visit my blog for ZoneMinder related projects using the Raspberry Pi, Orange Pi, Odroid, and the ESP8266
All of these can be found at https://zoneminder.blogspot.com/

User avatar
aodiaz
Posts: 26
Joined: Thu Apr 25, 2013 3:38 am
Location: Argentina

Re: Vilar mini domo cam (ip camera)

Post by aodiaz » Fri Aug 23, 2013 4:04 pm

Hi, ok, I'll try to get you more technical information, but, I have already seen the website of the camera and PTZ controls are sent through all links to images and separately, so do not know what to do and resort to the forum.!.

Regards!
Antonio

User avatar
aodiaz
Posts: 26
Joined: Thu Apr 25, 2013 3:38 am
Location: Argentina

Re: Vilar mini domo cam (ip camera)

Post by aodiaz » Fri Aug 23, 2013 10:14 pm

Hello friend!, This is the information I could find my ptz dome, tell me what else could possibly need to facilitate the resolution of my problem ..

Status page:
domito2.jpg
domito2.jpg (110.34 KiB) Viewed 6085 times
Camera control page:
domito1.jpg
domito1.jpg (97.17 KiB) Viewed 6085 times
PTZ separate control:
domito3.jpg
domito3.jpg (24.41 KiB) Viewed 6085 times
HTML code PTZ control:

<TABLE cellSpacing=0 cellPadding=0 border=0>
<TBODY>
<TR>
<TD align=middle bgColor=#99CCFF><TABLE cellSpacing=0 cellPadding=0 width=120 border=0>
<TBODY>
<TR>
<TD bgcolor="#0066CC"><div align="left"><FONT style="FONT-SIZE: 12px" face=Arial color=#FFFFFF>Pan/Tilt</FONT></div></TD>
</TR>
<TR>
<TD height=1></TD>
</TR>
<TR>
<TD align=middle bgColor=#99CCFF><div align="center"><IMG height=98
src="/images/pad.gif" width=90 useMap=#pad border=0>
<MAP name=pad>
<AREA title="Pan Scan" shape=CIRCLE target="msgFrame" alt="Pan Scan" coords=13,13,12
href="/cgi-bin/action?action=pan_scan&lang=eng">

<AREA title="Tilt Scan" shape=CIRCLE target="msgFrame" alt="Tilt Scan" coords=78,13,12
href="/cgi-bin/action?action=tilt_scan&lang=eng">

<AREA title="Tilt Up" shape=rect target="msgFrame" alt="Tilt Up" coords=33,20,57,43
href="/cgi-bin/action?action=cam_mv&diretion=cam_up&lang=eng">

<AREA title="Pan Left" shape=rect target="msgFrame" alt="Pan Left" coords=5,45,30,69
href="/cgi-bin/action?action=cam_mv&diretion=cam_left&lang=eng">

<AREA title="Home Position" shape=CIRCLE target="msgFrame" alt="Home Position" coords=45,57,12
href="/cgi-bin/action?action=cam_mv&diretion=cam_home&lang=eng">

<AREA title="Pan Right" shape=rect target="msgFrame" alt="Pan Right" coords=60,45,85,69 ,20
href="/cgi-bin/action?action=cam_mv&diretion=cam_right&lang=eng">

<AREA title="Tilt Down" shape=rect target="msgFrame" alt="Tilt Down" coords=33,71,58,96
href="/cgi-bin/action?action=cam_mv&diretion=cam_down&lang=eng">
</MAP>
</div></TD>
</TR>
</TBODY>
</TABLE>



In the code above it is clear that for each action uses an image and different variable, but nose how to implement it in the zoneminder ...
Also you step team page, but do not give much information, and less of the .cgi ..!!

Oficial page:
http://www.vimicro.com/english/product/d_vs-ip1002.htm#

Maybe help serve this commentary, "Ipcam Viewer Lite" software for android phones that use, this camera model is set SWANN and PTZ controls work properly!.


What do you think, you can do something??

Regards!
Antonio

User avatar
knight-of-ni
Posts: 2231
Joined: Thu Oct 18, 2007 1:55 pm
Location: Shiloh, IL

Re: Vilar mini domo cam (ip camera)

Post by knight-of-ni » Fri Aug 23, 2013 11:44 pm

What you need to do next is write down the url for each function you want zoneminder to use.

For example, it looks like the "tilt up" function should look like this:

Code: Select all

http://username:password@192.168.1.82/cgi-bin/action?action=cam_mv&diretion=cam_up&lang=eng
Test this by pasting it into your browser. Once you get it working, move on to the next function.

Here are some additional references which should help you:
http://forums.ispyconnect.com/forum.aspx?g=posts&t=481
http://www.networkcamerareviews.com/for ... t3697.html
http://wiki.linuxmce.org/index.php/IPC-1002

All of these websites have sample commands for your camera.

Once you have all the functions written down, then you need to create a PTZ control script (written in Perl) that zoneminder can understand. The best way to do that is to make a copy of an existing control script and edit that one. Try finding the file "PanasonicIP.pm" on your system and use that as your starting point.

On my system, that file is located here: /usr/share/perl5/vendor_perl/ZoneMinder/Control/PanasonicIP.pm
Visit my blog for ZoneMinder related projects using the Raspberry Pi, Orange Pi, Odroid, and the ESP8266
All of these can be found at https://zoneminder.blogspot.com/

User avatar
aodiaz
Posts: 26
Joined: Thu Apr 25, 2013 3:38 am
Location: Argentina

Re: Vilar mini domo cam (ip camera)

Post by aodiaz » Sun Aug 25, 2013 2:07 am

Hello friend, I located and modified the file but nothing happens PanasonicIP.pm (my path /usr/share/perl5/ZoneMinder/Control/PanasonicIP.pm), edit it several times and nothing, as I can know zone minder uses that file??
I have read in other forums the same possible solution to my problem, but I do the modification and nothing!. After updating that file I should do? as for testing?
I also read that if you believe from inside the control zm is xxxxxxx.pm should create a file in /usr/share/perl5/ZoneMinder/Control/PanasonicIP.pm and nothing is created, if the file was created it could edit and change the code!

Regards!
Antonio

User avatar
knight-of-ni
Posts: 2231
Joined: Thu Oct 18, 2007 1:55 pm
Location: Shiloh, IL

Re: Vilar mini domo cam (ip camera)

Post by knight-of-ni » Sun Aug 25, 2013 2:27 am

Once you made changes to PanasonicIP.pm, save it under a different name.
Let's call it VilarIPC1002.pm

Then change this line in VilarIPC1002.pm:

Code: Select all

package ZoneMinder::Control::PanasonicIP;
to this:

Code: Select all

package ZoneMinder::Control::VilarIPC1002;
Test you new control script by calling it directly from the command line:

Code: Select all

perl /usr/share/perl5/ZoneMinder/Control/VilarIPC1002.pm
Verify the path is right. If there are no errors in the control script, then it should output nothing at all.

Now tell zoneminder about your new script. You do that by editing a monitor source and then click the "Control" tab. Now click "Edit" and then "Add New Control". You need to go through all the tabs and select the features appropriate to your camera. IMPORTANT: The protocol field must match the name in your control script (i.e. VilarIPC1002).

When done, restart zoneminder before testing.
Visit my blog for ZoneMinder related projects using the Raspberry Pi, Orange Pi, Odroid, and the ESP8266
All of these can be found at https://zoneminder.blogspot.com/

User avatar
aodiaz
Posts: 26
Joined: Thu Apr 25, 2013 3:38 am
Location: Argentina

Re: Vilar mini domo cam (ip camera)

Post by aodiaz » Sun Aug 25, 2013 8:17 pm

Hello, friend, my device has the port configured ipcam 2007, and I'm seeing the log, trying to open port 80 on zm, this port can be configured to point to which I have since used this camera on many devices, cellular , tablets, etc., for that reason do not want to change the port of the camera.
Also you pass an image to see silo am configuring correctly.
domito4.jpg
domito4.jpg (35.42 KiB) Viewed 6058 times


There are many such messages in the zm log , the username and password are correctly spelled!!

2013-08-25 17:09:59.816220 zmcontrol 2637 ERR Error check failed: '401 Unauthorized' zmcontrol.pl


Regards!
Antonio

User avatar
knight-of-ni
Posts: 2231
Joined: Thu Oct 18, 2007 1:55 pm
Location: Shiloh, IL

Re: Vilar mini domo cam (ip camera)

Post by knight-of-ni » Mon Aug 26, 2013 1:05 am

Looks like you are getting close.
Please post your ptz control script. The only thing I can offer at this point are guesses...

Verify the method you are sending credentials to the control script.
For exmample, are you certain that you should place "user=admin&pwd=admin" into the Control Device field?
Instead, try deleting that and changing the Contrl Address field to "admin:admin@192.168.1.82:2007"
Visit my blog for ZoneMinder related projects using the Raspberry Pi, Orange Pi, Odroid, and the ESP8266
All of these can be found at https://zoneminder.blogspot.com/

User avatar
aodiaz
Posts: 26
Joined: Thu Apr 25, 2013 3:38 am
Location: Argentina

Re: Vilar mini domo cam (ip camera)

Post by aodiaz » Mon Aug 26, 2013 3:02 am

Friend!, And found the solution!, I worked, you're a genius!!, Thanks! :lol: :lol: :lol: :D :D !!
Much has my hardware, is slow and certainly did not give him enough time to take the system changes!, I have to be more patient!


I also found information for my problem in the following link ..!,this is for Rovios cameras, but also use the information to my camera!
http://www.zoneminder.com/wiki/index.php/Rovio

Then the window control my camera PTZ dome remained as follows
domito5.jpg
domito5.jpg (41.23 KiB) Viewed 6053 times
The path of my zmcontrol.pl is: /usr/bin/zmcontrol.pl
The path of my VilarIPC1002.pm is: /usr/share/perl5/ZoneMinder/Control/VilarIPC1002.pm

My VilarIPC1002.pm code:

# ==========================================================================
#
# ZoneMinder Panasonic IP Control Protocol Module, $Date: 2011-06-21 10:19:10 +0100 (Tue, 21 Jun 2011) $, $Revision: 3459 $
# Copyright (C) 2001-2008 Philip Coombes
#
# 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 Panasonic IP camera control
# protocol
#

package ZoneMinder::Control::VilarIPC1002;

use 5.006;
use strict;
use warnings;

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

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

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

# ==========================================================================
#
# VilarIPC1002 Control Protocol
#
# ==========================================================================

use ZoneMinder::Logger 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" );

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 = "nphRestart?PAGE=Restart&Restart=OK";
$self->sendCmd( $cmd );
}

#Comandos CGI de la camara domo china Vilar con ip
#Para VilarIP Cam MiniDomo - China- Modelo Vilar ipc1002
#tilt up="/cgi-bin/action?action=cam_mv&diretion=cam_up&lang=eng"
#tilt down="/cgi-bin/action?action=cam_mv&diretion=cam_down&lang=eng"
#pan left="/cgi-bin/action?action=cam_mv&diretion=cam_left&lang=eng"
#pan right="/cgi-bin/action?action=cam_mv&diretion=cam_right&lang=eng"
#home pos="/cgi-bin/action?action=cam_mv&diretion=cam_home&lang=eng"

sub moveConUp
{
my $self = shift;
Debug( "Move Up" );
my $cmd = "/cgi-bin/action?action=cam_mv&diretion=cam_up&lang=eng";
$self->sendCmd( $cmd );
}

sub moveConDown
{
my $self = shift;
Debug( "Move Down" );
my $cmd = "/cgi-bin/action?action=cam_mv&diretion=cam_down&lang=eng";
$self->sendCmd( $cmd );
}

sub moveConLeft
{
my $self = shift;
Debug( "Move Left" );
my $cmd = "/cgi-bin/action?action=cam_mv&diretion=cam_left&lang=eng";
$self->sendCmd( $cmd );
}

sub moveConRight
{
my $self = shift;
Debug( "Move Right" );
my $cmd = "/cgi-bin/action?action=cam_mv&diretion=cam_right&lang=eng";
$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};
$self->sendCmd( $cmd );
}

sub zoomConTele
{
my $self = shift;
my $params = shift;
my $step = $self->getParam( $params, 'step' );
Debug( "Zoom Tele" );
my $cmd = "nphControlCamera?Direction=ZoomTele";
$self->sendCmd( $cmd );
}

sub zoomConWide
{
my $self = shift;
my $params = shift;
my $step = $self->getParam( $params, 'step' );
Debug( "Zoom Wide" );
my $cmd = "nphControlCamera?Direction=ZoomWide";
$self->sendCmd( $cmd );
}

sub focusConNear
{
my $self = shift;
my $params = shift;
my $step = $self->getParam( $params, 'step' );
Debug( "Focus Near" );
my $cmd = "nphControlCamera?Direction=FocusNear";
$self->sendCmd( $cmd );
}

sub focusConFar
{
my $self = shift;
my $params = shift;
my $step = $self->getParam( $params, 'step' );
Debug( "Focus Far" );
my $cmd = "nphControlCamera?Direction=FocusFar";
$self->sendCmd( $cmd );
}

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

sub focusMan
{
my $self = shift;
Debug( "Focus Manual" );
my $cmd = "/axis-cgi/com/ptz.cgi?autofocus=off";
$self->sendCmd( $cmd );
}

sub presetClear
{
my $self = shift;
my $params = shift;
my $preset = $self->getParam( $params, 'preset' );
Debug( "Clear Preset $preset" );
my $cmd = "nphPresetNameCheck?Data=$preset";
$self->sendCmd( $cmd );
}

sub presetSet
{
my $self = shift;
my $params = shift;
my $preset = $self->getParam( $params, 'preset' );
Debug( "Set Preset $preset" );
my $cmd = "nphPresetNameCheck?PresetName=$preset&Data=$preset";
$self->sendCmd( $cmd );
}

sub presetGoto
{
my $self = shift;
my $params = shift;
my $preset = $self->getParam( $params, 'preset' );
Debug( "Goto Preset $preset" );
my $cmd = "nphControlCamera?Direction=Preset&PresetOperation=Move&Data=$preset";
$self->sendCmd( $cmd );
}

sub presetHome
{
my $self = shift;
Debug( "Home Preset" );
my $cmd = "/cgi-bin/action?action=cam_mv&diretion=cam_home&lang=eng";
$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>

=head1 COPYRIGHT AND LICENSE

Copyright (C) 2001-2008 Philip Coombes

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
# ==========================================================================

User avatar
aodiaz
Posts: 26
Joined: Thu Apr 25, 2013 3:38 am
Location: Argentina

Re: Vilar mini domo cam (ip camera)

Post by aodiaz » Mon Jan 26, 2015 3:48 pm

A correction of code to ZoneMinder versions higher than 1.26
At line 85 approximately reads:
#$self->{ua}->agent( "ZoneMinder Control Agent/".ZM_VERSION );

and replaced by the following:
$self->{ua}->agent( "ZoneMinder Control Agent" );

ZM reboot to take changes!!

FIX VilarCam IPC1002 , version 1.28 ZoneMinder, January 2015, by aodiaz

User avatar
knight-of-ni
Posts: 2231
Joined: Thu Oct 18, 2007 1:55 pm
Location: Shiloh, IL

Re: Vilar mini domo cam (ip camera)

Post by knight-of-ni » Mon Jan 26, 2015 6:15 pm

aodiaz wrote:A correction of code to ZoneMinder versions higher than 1.26
At line 85 approximately reads:
#$self->{ua}->agent( "ZoneMinder Control Agent/".ZM_VERSION );

and replaced by the following:
$self->{ua}->agent( "ZoneMinder Control Agent" );

ZM reboot to take changes!!

FIX VilarCam IPC1002 , version 1.28 ZoneMinder, January 2015, by aodiaz
Rather than delete ZM_VERSION from the agent, a better solution is to follow what we did with the control scripts packaged with zoneminder:
https://github.com/ZoneMinder/ZoneMinde ... cIP.pm#L80

The example references the full package name "ZoneMinder::Base::ZM_VERSION" instead of just the bareword ZM_VERSION, which was depreciated.
Visit my blog for ZoneMinder related projects using the Raspberry Pi, Orange Pi, Odroid, and the ESP8266
All of these can be found at https://zoneminder.blogspot.com/

User avatar
aodiaz
Posts: 26
Joined: Thu Apr 25, 2013 3:38 am
Location: Argentina

Re: Vilar mini domo cam (ip camera)

Post by aodiaz » Mon Jan 26, 2015 11:35 pm

Hello !, what would be the problem modify the line of script, which makes the .zm_version ??? Thank You !!

Antonio

Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests