Undefined index: MoveRoot - /includes/control_functions.php

Forum for questions and support relating to the 1.24.x releases only.
Locked
daveharris
Posts: 25
Joined: Mon Oct 26, 2009 2:47 pm

Undefined index: MoveRoot - /includes/control_functions.php

Post by daveharris »

Hiya, ive just done a fresh install on ubuntu and am now running ZM V1.24.2

I have 3 foscam IP cameras and am currently putting a how to guide together.

I have the cameras working now but am getting an error when i load the controls page (to pan, tilt etc). I have the foscam.pm file (which needs tidying up, but the basics are there)




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




The reset button seems to still work but the directions etc do not.

any idea what that means please?

foscam.pm:
------------------------------




package ZoneMinder::Control::Foscam;

use 5.006;
use strict;
use warnings;

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

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

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

# ==========================================================================
#
# Foscam IP 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" );
}
our $stop_command;

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 reset
{
my $self = shift;
Debug( "Camera Reset" );
my $cmd = "reboot.cgi?user=admin&pwd=";
$self->sendCmd( $cmd );
}

sub moveConUp
{
my $self = shift;
$stop_command = "1";
Debug( "Move Up" );
my $cmd = "decoder_control.cgi?command=0&user=admin&pwd=";
$self->sendCmd( $cmd );
}

sub moveConDown
{
my $self = shift;
$stop_command = "3";
Debug( "Move Down" );
my $cmd = "decoder_control.cgi?command=2&user=admin&pwd=";
$self->sendCmd( $cmd );
}

sub moveConLeft
{
my $self = shift;
$stop_command = "5";
Debug( "Move Left" );
my $cmd = "decoder_control.cgi?command=4&user=admin&pwd=";
$self->sendCmd( $cmd );
}

sub moveConRight
{
my $self = shift;
$stop_command = "7";
Debug( "Move Right" );
my $cmd = "decoder_control.cgi?command=6&user=admin&pwd=";
$self->sendCmd( $cmd );
}


sub moveStop
{
my $self = shift;
Debug( "Move Stop" );
my $cmd = "decoder_control.cgi?user=admin&pwd=&command=$stop_command";
$self->sendCmd( $cmd );
}



sub whiteConIn
{
my $self = shift;
my $params = shift;
my $step = $self->getParam( $params, 'step' );
Debug( "White In $step" );
my $cmd = "/camera_control.cgi?2=$step";
$self->sendCmd( $cmd );
}

sub whiteConOut
{
my $self = shift;
my $params = shift;
my $step = $self->getParam( $params, 'step' );
Debug( "White Out $step" );
my $cmd = "/camera_control.cgi?2=-$step";
$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 = "decoder_control.cgi?command=25&user=admin&pwd=";
$self->sendCmd( $cmd );
}

1;


__END__







------------------------------

Cheers,

DAVE.
daveharris
Posts: 25
Joined: Mon Oct 26, 2009 2:47 pm

Post by daveharris »

I must be doing something wrong.

If I copy say the PanasonicIP.pm file (in usr/share/perl/5.10/ZoneMinder/Control) and save that as testcam.pm, then change the package line to testcam i still get the same errors. But if i select the PanasonicIP control option it loads ok (just obviously the buttons dont work)

I've checked permissions, what am i missing?

Tar!

DAVE :)
daveharris
Posts: 25
Joined: Mon Oct 26, 2009 2:47 pm

Post by daveharris »

Well i've kinda solved my own problem.

If i deleted the new control that i originally created and then edited the existing PanasonicIP camera entry and just changed the protocol to foscam (from 'PanasonicIP') it worked.

Just not sure why the control i added would not work?

Cheers,

DAVE.
Locked