Page 1 of 1

Axis 2130R PTZ functions in ZM 1.2x.x

Posted: Fri Apr 08, 2005 3:42 am
by Eklectick
OK Phil, so here I go throwing myself into this without a parachute!

I am trying to setup an Axis 2130R camera with the latest ZM 1.21.0 to use it with the PTZ functions. Up to now I do see an image from it and I am capable or making it work like a non PTZ network camera.

Starting with the Control Capabilities I beleive this to be very straight forward an understandable so before venturing into all the possible functions of the camera I have selected the basic ones just as the KC-HCM10, just to move up, down, right and left as well as eight preset positions, home and set.

Under the Control Tab of the monitor settings Controllable is checked, Control Type has Axis2130R selected (created on the Control Capabilites window when Edit is clicked), Control Device is to be left blank (I think) and Control Address is yet not so clear to me. Here I am guessing this format is to be used:

Code: Select all

<user>:<pass>@<camera address>:<port>/axis-cgi/com/
I use <port> because the camera is not set to default port 80 but another. I dont know if these settings should be here or if they are carried out from the Source Tab on the Monitor settings and would appreciate some info about it.

Since getting it to move is my first priority I shall leave Track Motion and the rest alone for now and to be explored later.

On the appropiate directory I copied zmcontrol-kx-hcm10.pl and renamed it to: zmcontrol-axis-2130r.pl and of course made it clear on the Control Capabilites section to make it point into this file.

Looking for the common lines in zmcontrol-kx-hcm10.pl between the KC-HCM10 and the Axis 2130R I do know the following:

The format to send commands for the camera to move is:

Code: Select all

KC-HCM10:
http://cameraIPaddress/CGIcommand?Option1=Value&Option2=Value
Axis 2130R
http://cameraIPaddress/axis-cgi/com/ptz.cgi?<parameter>=<value>[&<parameter>=<value>... ]
Where the commands for the KC-HCM10 for it to move up, down, left and right are:

Code: Select all

nphControlCamera?Direction=TiltUp
nphControlCamera?Direction=TiltDown
nphControlCamera?Direction=PanLeft
nphControlCamera?Direction=PanRight

... and where the respective commands for the Axis 2130R are:

Code: Select all

ptz.cgi?camera=1&move=up
ptz.cgi?camera=1&move=down
ptz.cgi?camera=1&move=left
ptz.cgi?camera=1&move=right
Here "camera=1" I beleive could be omitted, but while moving the camera this is how it appears on the path so I guess we should leave it there for now and perhaps try to remove it later when we succeed :-)

Code: Select all

Focus auto:
nphControlCamera?Direction=FocusAuto
ptz.cgi?camera=1&autofocus=on

Preset Home is:
nphControlCamera?Direction=HomePosition
ptz.cgi?camera=1&move=home
I do have all of the available commands ready to be typed into "zmcontrol-axis-2130r.pl" and would appreciate it if you could give a few pointers and procedure to follow to try to get this going.

Regards!

Posted: Mon Apr 11, 2005 11:00 am
by zoneminder
This all looks pretty much exactly right to me. I'm not sure if you are saying there is a problem or just checking first before you try it, but if you have any specific issues just let me know and I'll check them out.

Phil

Posted: Wed Apr 13, 2005 5:34 am
by Eklectick
Phil

This is the way I have this configured right now and have not been able to PTZ de camera:

Under de Control Tab in Monitor:

Code: Select all

Controllable  : Checked
Control Type : Axis2130
Control Device  
Control Address : <camera address>:<port>/axis-cgi/com/
Track Motion  :
Track Delay  :
Return Location : Home
Return Delay  : 0
Questions:
1. Is "<ip address>:port/axis-cgi/com/" enough or should this include username and password as "<user>:<pass>@<camera address>:<port>/axis-cgi/com/"?
2. Am I missing something else on these fields?

The "Axis 2130" option created in Control Capabilities as:

Code: Select all

Type : Remote
Can Move : Yes
Can Zoom : No
Can Focus : No
Can Iris : No
Can White Bal. : No
Has Presets : H8
Copied and renamed zmcontrol-kx-hcm10.pl to zmcontrol-axis-2130r.pl and changed lines:

Code: Select all

sub moveUp
{
	print( "Move Up\n" );
	my $cmd = "nphControlCamera?Direction=TiltUp";
	sendCmd( $cmd );
}

sub moveDown
{
	print( "Move Down\n" );
	my $cmd = "nphControlCamera?Direction=TiltDown";
	sendCmd( $cmd );
}

sub moveLeft
{
	print( "Move Left\n" );
	my $cmd = "nphControlCamera?Direction=PanLeft";
	sendCmd( $cmd );
}

sub moveRight
{
	print( "Move Right\n" );
	my $cmd = "nphControlCamera?Direction=PanRight";
	sendCmd( $cmd );
}
to this:

Code: Select all

sub moveUp
{
	print( "Move Up\n" );
	my $cmd = "ptz.cgi?camera=1&move=up";
	sendCmd( $cmd );
}

sub moveDown
{
	print( "Move Down\n" );
	my $cmd = "ptz.cgi?camera=1&move=down";
	sendCmd( $cmd );
}

sub moveLeft
{
	print( "Move Left\n" );
	my $cmd = "ptz.cgi?camera=1&move=left";
	sendCmd( $cmd );
}

sub moveRight
{
	print( "Move Right\n" );
	my $cmd = "ptz.cgi?camera=1&move=right";
	sendCmd( $cmd );
}
Restarted ZM tried to move the camera and it doesnt move, what else am I missing?

Regards!

Posted: Thu Apr 14, 2005 11:13 am
by zoneminder
If you need a username and password to access the camera it should be added to the url. The first to try is probably just to issue commands directly with wget or curl so do something like

wget <ip address>:port/axis-cgi/com/ptz.cgi?camera=1&move=down

If that works then it's an issue with the ZM scripts. If it doesn't then it's an issue with access priveleges or the wrong command being sent.

Phil

Posted: Fri Apr 15, 2005 3:38 am
by Eklectick
Phil

Via de command line and while having a Watch window open of the camera I issued:

Code: Select all

wget http://user:pass@ipaddress:port/axis-cgi/com/ptz.cgi?move=left
and the camera did move left, so under Control Tab in Monitor I did this:

Code: Select all

Controllable  : Checked 
Control Type : Axis2130 
Control Device  
Control Address : user:pass@ipaddress:port/axis-cgi/com/
Track Motion  : 
Track Delay  : 
Return Location : Home 
Return Delay  : 0
... but the camera does not move, what else could I try?

Regards!

Posted: Mon Apr 18, 2005 4:06 pm
by zoneminder
I suspect it may be that the username and password are not being passed correctly. Are you able to remove them temporarily from your cam and see if that solves it. If so then I'll knock out a patch to address it.

Phil

Posted: Tue Apr 19, 2005 12:27 am
by Eklectick
Phil

I removed login from the camera. I can access the camera directly by accessing the IP no username and password required. Still no go.

The configuration of the Control Tab in Monitor is:

Code: Select all

Controllable  : Checked 
Control Type : Axis2130 
Control Device  
Control Address : ipaddress:port/axis-cgi/com/ 
Track Motion  : 
Track Delay  : 
Return Location : Home 
Return Delay  : 0
The zmcontrol-axis-2130r.pl has this changes on it:

Code: Select all

sub moveUp
{
	print( "Move Up\n" );
	my $cmd = "ptz.cgi?camera=1&move=up";
	sendCmd( $cmd );
}

sub moveDown
{
	print( "Move Down\n" );
	my $cmd = "ptz.cgi?camera=1&move=down";
	sendCmd( $cmd );
}

sub moveLeft
{
	print( "Move Left\n" );
	my $cmd = "ptz.cgi?camera=1&move=left";
	sendCmd( $cmd );
}

sub moveRight
{
	print( "Move Right\n" );
	my $cmd = "ptz.cgi?camera=1&move=right";
	sendCmd( $cmd );
}

sub zoomTele
{
	print( "Zoom Tele\n" );
	my $cmd = "ptz.cgi?camera=1&continuouszoommove=100";
	sendCmd( $cmd );
}

sub zoomWide
{
	print( "Zoom Wide\n" );
	my $cmd = "ptz.cgi?camera=1&continuouszoommove=-100";
	sendCmd( $cmd );
}

sub focusNear
{
	print( "Focus Near\n" );
	my $cmd = "ptz.cgi?camera=1&continuousfocusmove=100";
	sendCmd( $cmd );
}

sub focusFar
{
	print( "Focus Far\n" );
	my $cmd = "ptz.cgi?camera=1&continuousfocusmove=-100";
	sendCmd( $cmd );
}

sub focusAuto
{
	print( "Focus Auto\n" );
	my $cmd = "ptz.cgi?camera=1&autofocus=on";
	sendCmd( $cmd );
}
... the rest of the commands from the original zmcontrol-kx-hcm10.pl are still in the file and unchanged.

:roll:

Regards!

Posted: Thu Apr 21, 2005 9:19 pm
by zoneminder
I'll see if I can suggest some way of debugging this further. It ought to be quite simple!

Phil

Posted: Tue Oct 18, 2005 5:45 pm
by herve76
Any solution to this problem ?

Posted: Wed Oct 19, 2005 11:45 am
by zoneminder
I think the problem was resolved elsewhere. There is a different Axis control script now anyway.

Are you having similar problems?

Phil