Foscam FI8908W IP Camera with PT (no Z) Working in ZM 1.24.2

Post here to indicate any hardware you have used and which is known to work with ZoneMinder. Not for questions.
sraasch
Posts: 3
Joined: Fri Jul 09, 2010 3:35 pm

Post by sraasch »

@Eggplant

Thanks, that got me started.

I have the 320x240 feeds working now, though the 640x480 doesn't work with the resolution parameter you specified.

Following the instructions at the beginning of this thread, I've installed your perl module, and created the control type.

I then went into the monitor (under the control tab) and clicked controllable, and set the control type to "Hootoo IP Cam". Lastly, I set the control address to the IP of the camera (I don't see a place for the port, which is 80).

When I fire up the monitor, the feed is fine (timestamp is ticking and there seems to be motion -- it's hard to say in this scene). I can pull u the controls and as long as I don't click them too fast, there is no error.

However, there is also no movement from the camera.

I experimented by putting the following URL into my web browser:

Code: Select all

http://192.168.1.30/decoder_control.cgi?user=parent&pwd=&command=5
and the camera returned "ok."

but again, no movement, even with repeatedly sending the URL.

So, I could use help on the resolution and with the motion.

BTW: I'm pretty good with Perl, so if you need something, let me know.

-S
eggplant37
Posts: 3
Joined: Tue Jun 15, 2010 12:07 am
Location: Warren, MI

Post by eggplant37 »

sraasch wrote:@Eggplant

Thanks, that got me started.

I have the 320x240 feeds working now, though the 640x480 doesn't work with the resolution parameter you specified.

Following the instructions at the beginning of this thread, I've installed your perl module, and created the control type.

I then went into the monitor (under the control tab) and clicked controllable, and set the control type to "Hootoo IP Cam". Lastly, I set the control address to the IP of the camera (I don't see a place for the port, which is 80).

When I fire up the monitor, the feed is fine (timestamp is ticking and there seems to be motion -- it's hard to say in this scene). I can pull u the controls and as long as I don't click them too fast, there is no error.

However, there is also no movement from the camera.

I experimented by putting the following URL into my web browser:

Code: Select all

http://192.168.1.30/decoder_control.cgi?user=parent&pwd=&command=5
and the camera returned "ok."

but again, no movement, even with repeatedly sending the URL.

So, I could use help on the resolution and with the motion.

BTW: I'm pretty good with Perl, so if you need something, let me know.

-S
Does bring back my memory that I had to redo the logic table for the command parameters since Steve had originally given me this script modeled off the Foscam scripts and with that original logic table. I likely got real happy and just pasted his original here instead of my properly modded copy. Here's something to replace that HooTooIPCam.pl module with the correct logic table:

Code: Select all

# vim: set cindent shiftwidth=2 softtabstop=2 :
# ==========================================================================
#
# ZoneMinder HooToo IP Camera Control Protocol Module
# Copyright (C) 2010  Steven M Campbell
#
# 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 HooToo IP camera control
# protocol.  It was adapted from control protocol's written by Phillip Combes.
#

package ZoneMinder::Control::HooTooIPCam;

use 5.006;
use strict;
use warnings;

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

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

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

# ==========================================================================
#
# HooTooIPCam Control Protocol
#
# ==========================================================================

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



sub new {
  my $class = shift;
  my $id = shift;
  my $self = ZoneMinder::Control->new( $id );

  Debug( "Camera New" );
  bless( $self, $class );
  return $self;
}



our $AUTOLOAD;

sub AUTOLOAD {
  my $self = shift;
  my $class = ref($self) || croak( "$self not object" );
  my $name = $AUTOLOAD;
  Debug( "Camera AUTOLOAD" );

  $name =~ s/.*://;
  if ( exists($self->{$name}) ) {
    return( $self->{$name} );
  }

#  You can change the user and password here for all control commands

  my $user = "admin";
  my $pwd = "";

#  The basic decoder_control url just to make the below commands table easy 
#  to read 

  my $decoder = "decoder_control.cgi?user=$user&pwd=$pwd";

#  Instead of writing a bunch of individual routines lets make real
#  autoloader,  we'll just look up the requested command in this table 
#  and send the corresponding url string

  my %commands = (
      'Up'           	=> "$decoder&command=0",
      'Down'         	=> "$decoder&command=2",
      'Left'         	=> "$decoder&command=4",
      'Right'        	=> "$decoder&command=6",
      'moveConUp'    	=> "$decoder&command=0",
      'moveConDown'  	=> "$decoder&command=2",
      'moveConLeft'  	=> "$decoder&command=4",
      'moveConRight' 	=> "$decoder&command=6",
      'moveConUpLeft'  	=> "$decoder&command=90",
      'moveConUpRight'	=> "$decoder&command=91",
      'moveConDownLeft'	=> "$decoder&command=92",
      'moveConDownRight'=> "$decoder&command=93",
      'moveStop'     	=> "$decoder&command=1",
      'presetHome'   	=> "$decoder&command=25",
      'reset'        	=> "reboot.cgi?user=$user&pwd=$pwd",
      'cameraReset'  	=> "reboot.cgi?user=$user&pwd=$pwd"
      );

#  If the command exists in the table then we send it's url string

  if (exists($commands{$name})) {
    return($self->sendCmd($commands{$name}));
  }

#  Otherwise we fail

  Fatal( "Can't access $name member of object of class $class" );
}



sub open {
  my $self = shift;

  $self->loadMonitor();
  Debug( "Camera open" );
  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 );
}



1;
__END__


=head1 NAME

ZoneMinder::Control::HooTooIPCam - Perl extension to zoneminder to implement
the control protocol for the HooToo IP Camera

=head1 SYNOPSIS

use ZoneMinder::Control::HooTooIPCam;

=head1 DESCRIPTION

An implementation of the control protocol for the HooToo IP Camera for 
zoneminder.  

=head1 EXPORT

None by default.



=head1 SEE ALSO

ZoneMinder
ZoneMinder::Control

=head1 AUTHOR

Steven M Campbell

=head1 COPYRIGHT AND LICENSE

Copyright (C) 2010 by Steven M Campbell

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
Note, too that I had put in the commands for diagonal movements and a couple additional functions. Holler if you can help add more functionality to it.
Rev Eggplant
sraasch
Posts: 3
Joined: Fri Jul 09, 2010 3:35 pm

Post by sraasch »

Replying to my own post...

Instead of looking helpless, I decided to take a look at the page source for the camera-generated control pages.

I see that the command numbers on my page are different from those in @eggplant's driver module.

I'll post my command codes shortly.

I expect I'll find the solution to the resolution issue in there too, though I haven't looked into that... I did notice the set of "resolution" codes for
160x120 (2), 320x240 (8), and 640x480 (32)...

Maybe the resolution thing has something to do with how it's involked...

-S
puflet
Posts: 1
Joined: Fri Sep 10, 2010 6:14 pm
Location: Bulgaria
Contact:

Post by puflet »

Hi there,
i recently got noFoscam from DX, but it works fine with zm, and firefox/chrome (without any firmware changes).
I did Dave's configuration, and had some problems with:

Code: Select all

Sep 10 21:09:25 glupy zmcontrol[5289]: ERR [Error check failed:'500 No Host option provided']
Well after reading here I found out that in (Monitor properties) > Control > Control Address should be the IP of your camera.
mbrinkho wrote: Image
mata230
Posts: 3
Joined: Mon Sep 20, 2010 7:27 pm

Post by mata230 »

Hey Guys,
I've been twinkering with my Foscam and trying to figure this out and after all the time spent trying to figure it out I come to you!! ;). When ever I try to probe I get a "Unable to probe network cameras, status is '127'" error.


Foscam webui: 2.4.8.12
Device Firmware: 11.14.1.46
ZoneMinder Ver: v1.24.2

I've been using the web interface of the foscam for a while now and would like do be able to further manipulate the camera without the proprietary activex plugin.



I'm running Ubuntu 10.04, and I've installed zoneminder through synaptics (apt-get install zoneminder)


Below are the processes running:
www-data 7906 0.0 0.1 67660 9628 pts/1 S 23:12 0:00 /usr/bin/perl -wT /usr/bin/zmdc.pl startup
www-data 7934 0.0 0.2 77524 19024 pts/1 S 23:12 0:00 /usr/bin/perl -wT /usr/bin/zmfilter.pl
www-data 7936 0.0 0.1 68536 12148 pts/1 S 23:12 0:00 /usr/bin/perl -wT /usr/bin/zmaudit.pl -c
www-data 7938 0.0 0.1 67416 10988 pts/1 S 23:12 0:00 /usr/bin/perl -wT /usr/bin/zmwatch.pl

====================================



Below are the screenshots of my configuration:

Image

Image

Image

Image

Image

Image

Error I get when I try to probe:
Image

Any help will be greatly appreciated!!
HootooZone
Posts: 3
Joined: Sun Sep 26, 2010 4:01 pm

Hootoo IP cam and 640x480

Post by HootooZone »

Anyone got 640x480 to work with Hootoo IP cam? I've tried setting resolution to 32 but it's not working.
HootooZone
Posts: 3
Joined: Sun Sep 26, 2010 4:01 pm

Re: Revision for HooToo IPCam

Post by HootooZone »

Eggplant. Where do I insert or edit this code for hootoo cam?
eggplant37 wrote:OK, so I didn't do my research terribly well and got stuck with a couple of these Foscam clones sold by an outfit known as HooToo.com. I had some trouble figuring out how to get the PT(no Z) controls to work with this camera. I initially used the scripts that Phillip Combes had posted without too much luck. I then invited some help from a programmer friend of mine, Steve Campbell. Here's what he came up with:

Code: Select all

# ==========================================================================
#
# ZoneMinder HooToo IP Camera Control Protocol Module
# Copyright (C) 2010  Steven M Campbell
#
# 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 HooToo IP camera control
# protocol.  It was adapted from control protocol's written by Phillip Combes.
#

package ZoneMinder::Control::HooTooIPCam;

use 5.006;
use strict;
use warnings;

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

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

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

# ==========================================================================
#
# HooTooIPCam Control Protocol
#
# ==========================================================================

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



sub new {
  my $class = shift;
  my $id = shift;
  my $self = ZoneMinder::Control->new( $id );

  Debug( "Camera New" );
  bless( $self, $class );
  return $self;
}



our $AUTOLOAD;

sub AUTOLOAD {
  my $self = shift;
  my $class = ref($self) || croak( "$self not object" );
  my $name = $AUTOLOAD;
  Debug( "Camera AUTOLOAD" );

  $name =~ s/.*://;
  if ( exists($self->{$name}) ) {
    return( $self->{$name} );
  }

#  You can change the user and password here for all control commands

  my $user = "admin";
  my $pwd = "";

#  The basic decoder_control url just to make the below commands table easy 
#  to read 

  my $decoder = "decoder_control.cgi?user=$user&pwd=$pwd";

#  Instead of writing a bunch of individual routines lets make real
#  autoloader,  we'll just look up the requested command in this table 
#  and send the corresponding url string

  my %commands = (
      'Up'           => "$decoder&command=1",
      'Down'         => "$decoder&command=3",
      'Left'         => "$decoder&command=5",
      'Right'        => "$decoder&command=7",
      'moveConUp'    => "$decoder&command=1",
      'moveConDown'  => "$decoder&command=3",
      'moveConLeft'  => "$decoder&command=5",
      'moveConRight' => "$decoder&command=7",
      'moveStop'     => "$decoder&command=2",
      'presetHome'   => "$decoder&command=25",
      'reset'        => "reboot.cgi?user=$user&pwd=$pwd",
      'cameraReset'  => "reboot.cgi?user=$user&pwd=$pwd"
      );

#  If the command exists in the table then we send it's url string

  if (exists($commands{$name})) {
    return($self->sendCmd($commands{$name}));
  }

#  Otherwise we fail

  Fatal( "Can't access $name member of object of class $class" );
}



sub open {
  my $self = shift;

  $self->loadMonitor();
  Debug( "Camera open" );
  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 );
}



1;
__END__


=head1 NAME

ZoneMinder::Control::HooTooIPCam - Perl extension to zoneminder to implement
the control protocol for the HooToo IP Camera

=head1 SYNOPSIS

use ZoneMinder::Control::HooTooIPCam;

=head1 DESCRIPTION

An implementation of the control protocol for the HooToo IP Camera for 
zoneminder.  

=head1 EXPORT

None by default.



=head1 SEE ALSO

ZoneMinder
ZoneMinder::Control

=head1 AUTHOR

Steven M Campbell

=head1 COPYRIGHT AND LICENSE

Copyright (C) 2010 by Steven M Campbell

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
Enjoy and Use the Source!
HootooZone
Posts: 3
Joined: Sun Sep 26, 2010 4:01 pm

Re: Newb questions about configuring a HooToo camera

Post by HootooZone »

eggplant37 wrote:
sraasch wrote:I managed to buy two of these Hootoo cameras myself... I was hoping that someone here could help me get ZM configured to use them.

I've put the module provided above in place, but I can't even get video/images from them, so I'll let the control aspect wait on that.

My monitor settings are:
General
----------
source type: remote
function: monitor
enabled: checked
max fps: 10 or blank (no difference)
alarm max fps: 10 or blank (no difference)
ref image blend: 7

Source
---------
protocol: http
method: simple
host name: 192.168.1.30
host port: 80 (this is correct)
host path: /videostream.cgi (tried this with user/pass also)
host subpath: <blank>
colours: 24 bit
width: 640
height: 480

Everything else left with defaults

I appreciate any help you can give!
Happy to help!

Change your settings to as follows:

host path: /videostream.cgi?user=admin&pwd=&resolution=8

This assumes that your admin username hasn't been changed nor a password added.

Change your width/height to 320/240 (change to resolution=32 for 640 x 480).

Holler with what results you end up with, and then we can tackle controls further.
Changed to resolution=32 for 640x480 but not working. Any suggestions?
User avatar
pete_c
Posts: 88
Joined: Thu Jan 24, 2008 3:21 am
Location: USA

Foscam FW 11.14.2.26 and ZM 1.23.3

Post by pete_c »

Hello folks,

Just purchased a new Foscam and configured it yesterday per Dave's control file. From what I can see its not a clone but a real Foscam.

I've only configured a static address and running it at 640/480. Everything appears fine until it locks up. I cannot ping the address once it locks up.

All is working well with the control file. I am having a strange lockup of the camera after a few hours of connectivity to ZM. Today will test without connecting to Zm. I noticed two lock ups in the last 12 hours or so. I've been unplugging/plugging in cam to restart it. I am not using it in wireless mode but rather just a direct connect to network.

My status page shows the following:

Device Firmware Version 11.14.2.26
Device Embeded Web UI Version 2.4.8.14

Anyone else noticing this with same FW?
User avatar
pete_c
Posts: 88
Joined: Thu Jan 24, 2008 3:21 am
Location: USA

Foscam autonomous testing

Post by pete_c »

This morning "disconnected" Foscam from ZM and let it run by itself. Worked all day. I am not sure what it is in ZM causing it to lock up.
User avatar
pete_c
Posts: 88
Joined: Thu Jan 24, 2008 3:21 am
Location: USA

Another test

Post by pete_c »

Last night did another test. One computer I left with FF/IE streaming video from Foscam and it worked fine over a couple of hours. While watching connected ZM back to Foscam. The camera locked up in less than 10 minutes of streaming. Odd because it takes the camera entirely off line (can't even ping it).

Another test this morning was to change the frame rate. IE:

[code]/videostream.cgi?user=user&pwd=password&rate=11[/code]
User avatar
pete_c
Posts: 88
Joined: Thu Jan 24, 2008 3:21 am
Location: USA

Post by pete_c »

Lowering the frame rate on the ZM/Foscam link appears to have worked. No lock ups after a couple of hours.

No lock ups after about 14 hours or so.
User avatar
pete_c
Posts: 88
Joined: Thu Jan 24, 2008 3:21 am
Location: USA

Post by pete_c »

This time it locked up on day 2. Nothing in the logs are indicatory of any anything. Very simple setup. I am not using wireless. I have it set up with a static IP. Its becoming a PITA to disconnect/reconnect the camera at the power source with every lockup.

I wonder if downgrading the firmware will help me some?
wollo
Posts: 9
Joined: Wed Sep 29, 2010 8:05 pm

Post by wollo »

pete, I'm having the same problems as you. on unlimited framerate I lose all 3 of my camera's in a couple of hours (They seem to lock after the same amount of time i.e I can even guess wich one is next and roughly when). with rate=11 (5 fps) the cameras last about 12 hours. Faster frame rates cause more lfrequent lockups. I've upgraded to firmware 11.14.2.17 WUI 2.4.8.14. I'm now using completely default settings for the cameras.

I'm not sure about earlier firmwares as this is the first firmware that allows framerate control I believe from my experiments
This problem is noticable on at least the last two firmwares and zoneminder 1.24 & 1.22.3

I'm thinking there must be something specific to our setups. It looks like a lot of people are using these cameras without issues.

P.S other software (blue iris) doesn't cause problems even after weeks of use. (Blue Iris, Webcam XP)

I'm using xubuntu 8.xx live cd.and zoneminder 1.24.0.

edited for further detail
User avatar
pete_c
Posts: 88
Joined: Thu Jan 24, 2008 3:21 am
Location: USA

Another Test

Post by pete_c »

Last night opened a session to the Foscam with Firefox and left it running all night with no issues.

Dave has suggested to bring down the resolution to 320X240. Only thing is that I have 9 other cameras running at 640X480. One of those is a Panasonic IP cam which has run now for "years".

It appears that mostly everyone is utilizing the cam in the 320X240 mode.

It wouldn't be too bad if the camera would bounce back but its kind of a pain to have to disconnect and reconnect it. It is saving its setting upon reboot.

I've also enabled the frame rate / resolution on the setup in ZM with the same results.

[quote]/videostream.cgi?user=admin&pwd=&resolution=32&rate=13[/quote]

The control file works fine but I current disabled it to test the streaming.[/quote]

BTW - I'm using ZM 1.23.3 on a PCLinux (2008). I have another box with 1.24.2 on it sitting to the side. Its similiar with same type 8 chip/878A card in it. Think I'll give that one a try in the next few days.
Post Reply