ABS MegaCam 4220 capture and TCP trigger working
ABS MegaCam 4220 capture and TCP trigger working
I have this working in 1.24.1
Debian 5.0 unstable
Source>General
set alarm and maximum FPS to match camera settings
Source>Source
Remote Protocol = HTTP
Remote Method = Simple
Remote Host Path = /mjpg/video.cgi?resolution=640x480
You can enable and use the camera's onboard motion detection and utilize TCP notification as with the axis 207 as shown here:
http://www.zoneminder.com/wiki/index.ph ... nDetection
The camera settings are straightforward. Set up the object detection, event server, and be sure to enable and configure the event schedule to allow notification.
I have looked into getting the PT control working.
This post has some promise, I need a little assistance with writing a new protocol and getting it to load properly.
http://www.zoneminder.com/forums/viewto ... hlight=abs
If anyone has some insight on writing a new ABS.pm and getting it to load up, I'd be grateful. I copied and edited AxisV2.pm and saved it as ABS.pm, but I don't know how to get it loaded properly. I created a new control and specified ABS as the protocol but I get these errors on the control interface:
Notice: Undefined index: MoveRoot in /usr/share/zoneminder/skins/classic/includes/control_functions.php on line 124
Notice: Undefined index: MoveRoot in /usr/share/zoneminder/skins/classic/includes/control_functions.php on line 125
Notice: Undefined index: MoveRoot in /usr/share/zoneminder/skins/classic/includes/control_functions.php on line 126
Notice: Undefined index: MoveRoot in /usr/share/zoneminder/skins/classic/includes/control_functions.php on line 127
Notice: Undefined index: MoveRoot in /usr/share/zoneminder/skins/classic/includes/control_functions.php on line 128
Notice: Undefined index: MoveRoot in /usr/share/zoneminder/skins/classic/includes/control_functions.php on line 129
Notice: Undefined index: MoveRoot in /usr/share/zoneminder/skins/classic/includes/control_functions.php on line 130
Notice: Undefined index: MoveRoot in /usr/share/zoneminder/skins/classic/includes/control_functions.php on line 131
Those lines are:
$cmds['MoveUp'] = $cmds['MoveRoot']."Up";
$cmds['MoveDown'] = $cmds['MoveRoot']."Down";
$cmds['MoveLeft'] = $cmds['MoveRoot']."Left";
$cmds['MoveRight'] = $cmds['MoveRoot']."Right";
$cmds['MoveUpLeft'] = $cmds['MoveRoot']."UpLeft";
$cmds['MoveUpRight'] = $cmds['MoveRoot']."UpRight";
$cmds['MoveDownLeft'] = $cmds['MoveRoot']."DownLeft";
$cmds['MoveDownRight'] = $cmds['MoveRoot']."DownRight";
}
I figure the .pm protocol file is not loading at all.
Debian 5.0 unstable
Source>General
set alarm and maximum FPS to match camera settings
Source>Source
Remote Protocol = HTTP
Remote Method = Simple
Remote Host Path = /mjpg/video.cgi?resolution=640x480
You can enable and use the camera's onboard motion detection and utilize TCP notification as with the axis 207 as shown here:
http://www.zoneminder.com/wiki/index.ph ... nDetection
The camera settings are straightforward. Set up the object detection, event server, and be sure to enable and configure the event schedule to allow notification.
I have looked into getting the PT control working.
This post has some promise, I need a little assistance with writing a new protocol and getting it to load properly.
http://www.zoneminder.com/forums/viewto ... hlight=abs
If anyone has some insight on writing a new ABS.pm and getting it to load up, I'd be grateful. I copied and edited AxisV2.pm and saved it as ABS.pm, but I don't know how to get it loaded properly. I created a new control and specified ABS as the protocol but I get these errors on the control interface:
Notice: Undefined index: MoveRoot in /usr/share/zoneminder/skins/classic/includes/control_functions.php on line 124
Notice: Undefined index: MoveRoot in /usr/share/zoneminder/skins/classic/includes/control_functions.php on line 125
Notice: Undefined index: MoveRoot in /usr/share/zoneminder/skins/classic/includes/control_functions.php on line 126
Notice: Undefined index: MoveRoot in /usr/share/zoneminder/skins/classic/includes/control_functions.php on line 127
Notice: Undefined index: MoveRoot in /usr/share/zoneminder/skins/classic/includes/control_functions.php on line 128
Notice: Undefined index: MoveRoot in /usr/share/zoneminder/skins/classic/includes/control_functions.php on line 129
Notice: Undefined index: MoveRoot in /usr/share/zoneminder/skins/classic/includes/control_functions.php on line 130
Notice: Undefined index: MoveRoot in /usr/share/zoneminder/skins/classic/includes/control_functions.php on line 131
Those lines are:
$cmds['MoveUp'] = $cmds['MoveRoot']."Up";
$cmds['MoveDown'] = $cmds['MoveRoot']."Down";
$cmds['MoveLeft'] = $cmds['MoveRoot']."Left";
$cmds['MoveRight'] = $cmds['MoveRoot']."Right";
$cmds['MoveUpLeft'] = $cmds['MoveRoot']."UpLeft";
$cmds['MoveUpRight'] = $cmds['MoveRoot']."UpRight";
$cmds['MoveDownLeft'] = $cmds['MoveRoot']."DownLeft";
$cmds['MoveDownRight'] = $cmds['MoveRoot']."DownRight";
}
I figure the .pm protocol file is not loading at all.
post you pm file so we can find the problem
Code: Select all
remember to put it in a code tag so forum dosent mess it up
The camera will respond to commands formatted like this:
I started with the AxisV2.pm file and trimmed out all the features this camera does not support.
I tried using admin:@192.168.0.101 for the Control Address.
I'd get the aforementioned PHP errors when I opened the control tab for the camera. If I click on the right control arrow, this is what I get in the log.
Code: Select all
wget --http-user=admin --http-password= "http://192.168.0.101/ptz.cgi?move=downleft&speed=10"
I started with the AxisV2.pm file and trimmed out all the features this camera does not support.
Code: Select all
package ZoneMinder::Control::ABS;
use 5.006;
use strict;
use warnings;
require ZoneMinder::Base;
require ZoneMinder::Control;
our @ISA = qw(ZoneMinder::Control);
our $VERSION = $ZoneMinder::Base::VERSION;
# ==========================================================================
#
# Axis V2 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 moveConUp
{
my $self = shift;
Debug( "Move Up" );
my $cmd = "/ptz.cgi?move=up&speed=2";
$self->sendCmd( $cmd );
}
sub moveConDown
{
my $self = shift;
Debug( "Move Down" );
my $cmd = "/ptz.cgi?move=down&speed=2";
$self->sendCmd( $cmd );
}
sub moveConLeft
{
my $self = shift;
Debug( "Move Left" );
my $cmd = "/axis-cgi/com/ptz.cgi?move=left";
$self->sendCmd( $cmd );
}
sub moveConRight
{
my $self = shift;
Debug( "Move Right" );
my $cmd = "/ptz.cgi?move=right&speed=2";
$self->sendCmd( $cmd );
}
sub moveConUpRight
{
my $self = shift;
Debug( "Move Up/Right" );
my $cmd = "/ptz.cgi?move=upright&speed=2";
$self->sendCmd( $cmd );
}
sub moveConUpLeft
{
my $self = shift;
Debug( "Move Up/Left" );
my $cmd = "/ptz.cgi?move=upleft&speed=2";
$self->sendCmd( $cmd );
}
sub moveConDownRight
{
my $self = shift;
Debug( "Move Down/Right" );
my $cmd = "/ptz.cgi?move=downright&speed=2";
$self->sendCmd( $cmd );
}
sub moveConDownLeft
{
my $self = shift;
Debug( "Move Down/Left" );
my $cmd = "/ptz.cgi?move=downleft&speed=2";
$self->sendCmd( $cmd );
}
1;
__END__
I tried using admin:@192.168.0.101 for the Control Address.
I'd get the aforementioned PHP errors when I opened the control tab for the camera. If I click on the right control arrow, this is what I get in the log.
Code: Select all
FAT [Can't access Right member of object of class ZoneMinder::Control::ABS]
Skyking,skyking wrote:The camera will respond to commands formatted like this:
Code: Select all
wget --http-user=admin --http-password= "http://192.168.0.101/ptz.cgi?move=downleft&speed=10"
I started with the AxisV2.pm file and trimmed out all the features this camera does not support.
Code: Select all
package ZoneMinder::Control::ABS; use 5.006; use strict; use warnings; require ZoneMinder::Base; require ZoneMinder::Control; our @ISA = qw(ZoneMinder::Control); our $VERSION = $ZoneMinder::Base::VERSION; # ========================================================================== # # Axis V2 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 moveConUp { my $self = shift; Debug( "Move Up" ); my $cmd = "/ptz.cgi?move=up&speed=2"; $self->sendCmd( $cmd ); } sub moveConDown { my $self = shift; Debug( "Move Down" ); my $cmd = "/ptz.cgi?move=down&speed=2"; $self->sendCmd( $cmd ); } sub moveConLeft { my $self = shift; Debug( "Move Left" ); my $cmd = "/axis-cgi/com/ptz.cgi?move=left"; $self->sendCmd( $cmd ); } sub moveConRight { my $self = shift; Debug( "Move Right" ); my $cmd = "/ptz.cgi?move=right&speed=2"; $self->sendCmd( $cmd ); } sub moveConUpRight { my $self = shift; Debug( "Move Up/Right" ); my $cmd = "/ptz.cgi?move=upright&speed=2"; $self->sendCmd( $cmd ); } sub moveConUpLeft { my $self = shift; Debug( "Move Up/Left" ); my $cmd = "/ptz.cgi?move=upleft&speed=2"; $self->sendCmd( $cmd ); } sub moveConDownRight { my $self = shift; Debug( "Move Down/Right" ); my $cmd = "/ptz.cgi?move=downright&speed=2"; $self->sendCmd( $cmd ); } sub moveConDownLeft { my $self = shift; Debug( "Move Down/Left" ); my $cmd = "/ptz.cgi?move=downleft&speed=2"; $self->sendCmd( $cmd ); } 1; __END__
I tried using admin:@192.168.0.101 for the Control Address.
I'd get the aforementioned PHP errors when I opened the control tab for the camera. If I click on the right control arrow, this is what I get in the log.
Code: Select all
FAT [Can't access Right member of object of class ZoneMinder::Control::ABS]
This code works fine for me, the only problem was this line:
Code: Select all
my $req = HTTP::Request->new( GET=>" http://".$self->{Monitor}->{ControlAddress}."/$cmd" );
Code: Select all
my $req = HTTP::Request->new( GET=>" http://".$self->{Monitor}->{ControlAddress}."$cmd" );
edit:
need to change this (funny how it still moved the camera left ):
Code: Select all
sub moveConLeft
{
my $self = shift;
Debug( "Move Left" );
my $cmd = "/axis-cgi/com/ptz.cgi?move=left";
$self->sendCmd( $cmd );
}
Code: Select all
sub moveConLeft
{
my $self = shift;
Debug( "Move Left" );
my $cmd = "/ptz.cgi?move=left&speed=2";
$self->sendCmd( $cmd );
}
Last edited by greckpk on Fri Jun 25, 2010 2:18 am, edited 1 time in total.
What directory do I put this in, I have one of these cameras, but when I did a list of directories, I see a large number of places on the directory tree where this thing could
go.
I believe this is the place but I am not sure:
./usr/share/perl5/site_perl/5.10.0/ZoneMinder/Control/abs.pm
But when I try to run it I get this in zmcontrol:
06/24/10 20:56:18.920280 zmcontrol[12216].INF [Control server 6/ starting at 10/06/24 20:56:18]
06/24/10 20:56:28.930486 zmcontrol[12213].FAT [Can't connect: No such file or directory]
The permissions are all the same as the other control files in the /Control directory, also
the owner and group (root root) for all files.
go.
I believe this is the place but I am not sure:
./usr/share/perl5/site_perl/5.10.0/ZoneMinder/Control/abs.pm
But when I try to run it I get this in zmcontrol:
06/24/10 20:56:18.920280 zmcontrol[12216].INF [Control server 6/ starting at 10/06/24 20:56:18]
06/24/10 20:56:28.930486 zmcontrol[12213].FAT [Can't connect: No such file or directory]
The permissions are all the same as the other control files in the /Control directory, also
the owner and group (root root) for all files.
Hi,
This location is correct location for me:
/usr/local/share/perl/5.10.1/ZoneMinder/Control/ABS.pm
I think that your location should be correct for your version of OS. I'am running Ubuntu 10.4
make sure when you set the camera up in "Control Capability" under "Move" tab check "Can Move", "Can Move Diagonally", and most important "Can Move Continuous"
This location is correct location for me:
/usr/local/share/perl/5.10.1/ZoneMinder/Control/ABS.pm
I think that your location should be correct for your version of OS. I'am running Ubuntu 10.4
make sure when you set the camera up in "Control Capability" under "Move" tab check "Can Move", "Can Move Diagonally", and most important "Can Move Continuous"
Last edited by greckpk on Fri Jun 25, 2010 1:17 am, edited 1 time in total.
I think I have the wrong directory, as I have tried to see if I can get it to see the ABS.pm
file and it does not appear to do so, but it does see the Axis file, I went into that same
directory and renamed the Axis file, but is it getting from one of several other directories
I think.
Which directory (full tree) is the real one in. I find the Axis file in about 4 directories on
my machine, and I am not sure which is the real thing.
file and it does not appear to do so, but it does see the Axis file, I went into that same
directory and renamed the Axis file, but is it getting from one of several other directories
I think.
Which directory (full tree) is the real one in. I find the Axis file in about 4 directories on
my machine, and I am not sure which is the real thing.