eBay IP Camera. Now which settings to use...

Post here to ask any questions about hardware suitability, configuration in ZoneMinder, or experiences. If you just want to know if something works with ZoneMinder or not, please check the Hardware Compatibility sections in the forum, and the Wiki first. Also search this topic as well.
Post Reply
daveharris
Posts: 25
Joined: Mon Oct 26, 2009 2:47 pm

eBay IP Camera. Now which settings to use...

Post by daveharris »

Firstly, Hi everyone!

I installed the ZM software on a box at home a couple of weeks ago and it all worked nicely (after the SATA CD install issue), except it didnt support any of the usb cameras i had to hand. I also had a 4 port capture card but no cameras so I then found some nice IP cameras on ebay. I ended up buying 3, wireless ip cameras, with pan and tilt and infra red, pretty good deal.

So, ive had a little play with the cameras in the office and they are working nicely, the next stage is to get ZoneMinder to recognise them.

I had a quick search on the forum/wiki to find details of the parameters i need to enter but the problem i have is that i dont really know what brand they are, and thats making it all a little tricky.

This is the ebay link:

http://cgi.ebay.co.uk/Wireless-Colour-I ... 27ab91d14a

Has anybody else used these, or does anyone know the settings, or can anyone please point me in the right direction?

Im planning on getting the 3 cameras setup, mostly to spy on the hedgehogs in the garden at night, but maybe down the line ill find something more useful to do with them!

Many thanks :)

DAVE

EDIT:

I've just come across this:

http://www.gadgetvictims.com/2009/07/fo ... t-two.html

Which seems to match the interface and box i have so its looking good (ish)

I'll keep you posted...

EDIT2:

Ok, so it seems this is the camera:

http://www.zoneminder.com/forums/viewtopic.php?p=56613

But im yet to get any images to actaully display using these settings, i'll keep working on it :)

PS - My device info:

Device Info
Device ID 00606E79863A
Device Firmware Version 11.14.1.34
Device Embeded Web UI Version 2.4.8.9

Do i need to upgrade the firmware to get this to work do you think? (id rather not upgrade it unless i really have to!)

EDIT3:

So i ran this through VLC and it worked perfectly:

http://10.11.100.143/video.cgi?user=admin&pwd=admin

However, in ZM i added a Simple HTTP camera @ 10.11.100.143 on port 80 with the remote host path:

/video.cgi?user=admin&pwd=admin

24 bit video color, 640 x 480 size

...and it doesnt work, grrr.

I can't be that far off getting it working I dont think? HELP! (please)

EDIT4:

So, I flashed the firmare, and after a slight panic thinking "it probably should have replied to a ping by now" it all came back online and all was good.

I can now also access the video stream in VLC via:

http://10.11.100.143/videostream.asf?us ... &pwd=admin

But still cant get ZM to recognise it.

So close yet...

EDIT5:

Still no joy, beginning to think my server install may have become corrupt somewhat, i did fiddle around with it a little tying to get it working last time round with the capture card and my digia camera plugged into one of the video ports. Does anyone know of an internet ip camera that should work with my setup that i can use to test to norrow down where the issue is. - thank you in advance!
timcraig
Posts: 195
Joined: Mon Dec 10, 2007 5:53 pm
Location: San Jose, CA

Post by timcraig »

It looks like you're camera has a url to get a snapshot at http://ipcam_url/snapshot.cgi. That might work for Zoneminder with a frame rate around 3-4 fps.


You'd want to check if you can get ffmpeg to successfully capture the video stream.

Here link to a post of someone able to getting ffmpeg to capture a stream from a mjpeg camera that Zoneminder didn't under stand. Then the author links to an article of how to get ffserver to redirect stream to a local port.
daveharris
Posts: 25
Joined: Mon Oct 26, 2009 2:47 pm

Post by daveharris »

Thank yo for that reply tim, i did some more investigation and pm'd a few peeps. finally got it working (thanks to grndamgt4) after rebuilding the box ZM was running on the problem seemed to be the shared memory:

http://www.zoneminder.com/wiki/index.ph ... esolutions.

once changed and ZM restarted the cameras all started working at 13.3 fps (all running wirelessly, new access point arriving once postal strike stos so will see if that improves it at all)

For the record:

I updated to latest firmware on cameras
then settings:
- remote
- monitor
- 30fps
- 24bit color
- 640 x 480
- path: /videostream.cgi?user=visitor&pwd=
- uped the shared memory, restarted zm and bobs ur uncle!

Cheers,

DAVE.
User avatar
kingofkya
Posts: 1110
Joined: Mon Mar 26, 2007 6:07 am
Location: Las Vegas, Nevada

Post by kingofkya »

Thanks for the report I might be a good idea to go post the stuff that worked for you to the wiki (use your forum logon) and anything else specific to the cam.

http://www.zoneminder.com/wiki/index.ph ... d_hardware

I would say it fits under full compatibility
daveharris
Posts: 25
Joined: Mon Oct 26, 2009 2:47 pm

Post by daveharris »

Next step is getting the PTZ working. I have no idea where to start looking for this just yet. Ive enabled ZM to give me the control options in the camera window, but now i guess i must somewhere tell ZM which codes to use for my cameras, thats as far as ive got with that just yet.

If anyone can send any pointers (files/codes), that would be great!

Cheers :)
User avatar
kingofkya
Posts: 1110
Joined: Mon Mar 26, 2007 6:07 am
Location: Las Vegas, Nevada

Post by kingofkya »

google wireshark

is a great program for this it alowes you to see html traffic in real time

so you could see if the cameras doing something like /move.cgi?pos=right etc
daveharris
Posts: 25
Joined: Mon Oct 26, 2009 2:47 pm

Post by daveharris »

I have manged to find a list of the codes that the camera takes and tried these out by passing them in to a broswer and the camera seems to move as expeced.

I spent the weekend getting the wireless network optimized, but failed (Bought an EnGenium ECB3500 but not having much luck with it). Im in a rented house atm so dont want to run cables, but have now decided a cabled poe solution will be going in to the new house!

I could now do with a template file that i can put these codes into. (And some sort of guidance where to put that file) I'm sure i found something similar to this before on here, but can't seem to find it now.

For reference, i found this:

var PTZ_STOP = 1;
var TILT_UP = 0;
var TILT_DOWN = 2;
var PAN_LEFT = 4;
var PAN_RIGHT = 6;
var PTZ_LEFT_UP = 90;
var PTZ_RIGHT_UP = 91;
var PTZ_LEFT_DOWN = 92;
var PTZ_RIGHT_DOWN = 93;
var PTZ_CENTER = 25;
var PTZ_VPATROL = 26;
var PTZ_VPATROL_STOP = 27;
var PTZ_HPATROL = 28;
var PTZ_HPATROL_STOP = 29;
var IO_ON = 94;
var IO_OFF = 95;

here: http://www.zoneminder.com/forums/viewto ... ght=foscam

And there is a file on there thats seems like it should work, but ive not had much joy so far. I don't know perl at all and need to look into that.

Cheers,

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

Post by daveharris »

I still havent quite figured out the PTZ just yet, but whilst searching i came a cross a few interesting things.

Firstly:

set_misc.cgi
Description: Set the camera miscellaneous parameters
Permissions: manager
Syntax:
/set_misc.cgi? [led_mode = & ptz_center_onstart = & ptz_auto_patrol_interval = & ptz_auto_patrol
_type = & ptz_patrol_h_rounds = & ptz_patrol_v_rounds = & next_url =]
Parameters:
led_mode: 0: Mode 1; 1: Mode 2; 2: Turn off lights
ptz_center_onstart: = 1, starts the middle
ptz_auto_patrol_interval: automatic inspection interval, = 0: No auto-tour
ptz_auto_patrol_type: 0: None; 1: horizontal; 2: vertical; 3: Horizontal + Vertical
ptz_patrol_h_rounds: the level of inspection laps, 0: infinity
ptz_patrol_v_rounds: Vertical tour laps, 0: infinity
ptz_patrol_rate: cruising speed benchmark 0-100, 0: the fastest
ptz_patrol_up_rate: up cruising speed :0-100, 0: The most slowly
ptz_patrol_down_rate: down to cruising speed :0-100, 0: The most slowly
ptz_patrol_left_rate: Left cruising speed :0-100, 0: The most slowly
ptz_patrol_right_rate: the right cruising speed :0-100, 0: The most slowly

It appears you cannot turn off the external IR bulbs (short of taking them out) but you can turn off the flashing green led with the above command.

secondly, it appears a few people have replaces the 2.1mm lens with a 160 degree wide angle version, which i might give a try - anybody else tried this?

Cheers,

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

Post by daveharris »

I will get all this in the wiki once its complete :)

This allows you to set it so that the camera does not move when you reboot it:

http://IPCamURL/set_misc.cgi?ptz_center_onstart=0
daveharris
Posts: 25
Joined: Mon Oct 26, 2009 2:47 pm

Post by daveharris »

Still struggling on the control part of this.

have placed the following file (copied from above):








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__












in:

/usr/share/perl5/ZoneMinder/Control

and set permissions via chmod to 755

and saved as foscam.pm

(i've seen mentioned .pl files - whats the difference?)

then in ZM i add the control, and refer to the protocol as "foscam"

in the logs i see this

21:57:29 ZoneMinder zmcontrol[4617]: INF [Starting control server 1/foscam]
Nov 2 21:57:29 ZoneMinder zmcontrol[4620]: INF [Control server 1/foscam starting at 09/11/02 21:57:29]
Nov 2 21:57:39 ZoneMinder zmcontrol[4617]: FAT [Can't connect: No such file or directory]

i assume that is related? the camera does not move still though.

is there anyway of debugging this, or any obvious pointers im missing please?

any help much appreciated! :)
User avatar
kingofkya
Posts: 1110
Joined: Mon Mar 26, 2007 6:07 am
Location: Las Vegas, Nevada

Post by kingofkya »

i would go turn on debug for zmcontrole see the debug tab in options

also pl perl libary pm perl module


also whats this for the thing in bold

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

sub open
Post Reply