CGI restful API problems with IP4M-1056E

Have some questions or having issues with your IP Camera(s), Post them here for the mods and other users to assist you with.
Post Reply
jpelayo
Posts: 2
Joined: Sun Jun 07, 2020 5:08 am

CGI restful API problems with IP4M-1056E

Post by jpelayo »

Hi everyone

I know I can make this work, but there is a small detail that prevents me from doing it. Please, if anyone see the problem here, let me know, guys.

I'm using a testbed IP4M-1056E with default settings. It has no pan tilt motor but it has zoom focus motor. I can make them work from within the web interface at the IP address port 80.

Adrian C. from the commercial department told me that all the cameras have the cgi API access, and I can make some commands work, like

192.168.xx.xx/cgi-bin/configManager.cgi?action=getConfig&name=General

So the authentication works well and the http commands get through.

But when I send any of these http requests (with username and password, of course):

192.168.xx.xx/cgi-bin/ptz.cgi?action=start&code=ZoomWide&channel=1&arg1=0&arg2=0&arg3=0

192.168.xx.xx/cgi-bin/ptz.cgi?action=start&code=ZoomTele&channel=1&arg1=0&arg2=1&arg3=0

192.168.xx.xx/cgi-bin/ptz.cgi?action=start&code=ZoomWide&channel=0&arg1=0&arg2=0&arg3=0

192.168.xx.xx/cgi-bin/ptz.cgi?action=start&code=ZoomTele&channel=0&arg1=0&arg2=1&arg3=0

The http status code response is 200 and "OK". But the camera does nothing, the zoom does not change. I know it works, but there is something missing, like enabling some setting.

Any clue why the Zoom does not move, please? I tried changing channels, zoom word variations, ... always the "error" response. And the "OK" response does not bring a zoom change.

Thanks everyone.
Cheers,
Jose
(Madrid-Spain)
jpelayo
Posts: 2
Joined: Sun Jun 07, 2020 5:08 am

Re: CGI restful API problems with IP4M-1056E

Post by jpelayo »

This is the current specification; some commands have changed.

https://s3.amazonaws.com/amcrest-files/ ... 3.2017.pdf
jack7
Posts: 904
Joined: Tue May 29, 2018 7:46 pm

Re: CGI restful API problems with IP4M-1056E

Post by jack7 »

Have you tried this to check for your camera ptz support?

Code: Select all

http://192.168.xx.xx/cgi-bin/ptz.cgi?action=getCurrentProtocolCaps&channel=0
Here's what I get for an Amcrest high function PTZ camera, IP2M-858. You may want to reformat it.

caps.AlarmLen=0 caps.AutoFocus=false caps.AutoPan=true caps.AutoScan=true caps.AutoScanMax=5 caps.AutoScanMin=1 caps.AutoScanSpeed=true caps.AuxMax=255 caps.AuxMin=1 caps.BFFunction.Support=false caps.CamAddrMax=255 caps.CamAddrMin=1 caps.CameraSerialNo=true caps.DirectionDisplay=true caps.Focus=true caps.HighAuxMask=0 caps.IdleMotion.Support=true caps.Internal=400 caps.Iris=true caps.LowAuxMask=0 caps.Menu=false caps.MonAddrMax=255 caps.MonAddrMin=0 caps.Move[0]=Absolutely caps.Move[1]=Directly caps.Move[2]=Relatively caps.MoveAbsolutely.PTZ[0]=Pan caps.MoveAbsolutely.PTZ[1]=Tile caps.MoveAbsolutely.PTZ[2]=Zoom caps.Name=DH-SD3 caps.Pan=true caps.PanSpeedMax=255 caps.PanSpeedMin=1 caps.Pattern=true caps.PatternMax=5 caps.PatternMin=1 caps.PowerUp.Support=true caps.Preset=true caps.PresetMax=300 caps.PresetMin=1 caps.PrivacyMasking.SetColorSupport=true caps.PrivacyMasking.Support=true caps.PtzAdaptiveFlip.Support=false caps.PtzAutoMovement.Action[0]=Preset caps.PtzAutoMovement.Action[1]=Tour caps.PtzAutoMovement.Action[2]=Pattern caps.PtzAutoMovement.Action[3]=AutoScan caps.PtzAutoMovement.Support=true caps.PtzAutoMovement.SupportSnapShot=false caps.PtzAutoMovement.TaskNum=4 caps.PtzCrane.Support=false caps.PtzDevice=false caps.PtzDirectionCalibration=false caps.PtzElevation.AngleRange[0]=0 caps.PtzElevation.AngleRange[1]=-150 caps.PtzElevation.Support=false caps.PtzFan.ClearFog.Support=false caps.PtzFan.Support=false caps.PtzFunctionMenu.Support=true caps.PtzFunctionMenu.SupportOSDMenu=true caps.PtzHeater.HeaterTempRange.HighRange[0]=1 caps.PtzHeater.HeaterTempRange.HighRange[1]=66597272 caps.PtzHeater.HeaterTempRange.LowRange[0]=0 caps.PtzHeater.HeaterTempRange.LowRange[1]=66597248 caps.PtzHeater.Support=false caps.PtzLimit.DownSupport=true caps.PtzLimit.Support=false caps.PtzLimit.UpSupport=true caps.PtzMotionRange.HorizontalAngle[0]=0 caps.PtzMotionRange.HorizontalAngle[1]=360 caps.PtzMotionRange.VerticalAngle[0]=-15 caps.PtzMotionRange.VerticalAngle[1]=90 caps.PtzOperationStatus.Support=true caps.PtzPowerLevel.Support=false caps.PtzRoadInfo.Support=false caps.PtzSpeed.Support=true caps.SDMeasureDistance.DisplayDurationRange[0]=1 caps.SDMeasureDistance.DisplayDurationRange[1]=30 caps.SDMeasureDistance.OsdEnable=false caps.SDMeasureDistance.Support=false caps.SupportFocusMode[0]=Car caps.SupportHardwarePtzDevice=false caps.SupportLensInit=true caps.SupportPTZCoordinates=true caps.SupportPTZZoom=true caps.SupportPtzPatternOSD=false caps.SupportPtzRS485DetectOSD=false caps.SupportRegionFocus=true caps.SupportRestartCam=false caps.SupportViewRangeType[0]=ElectronicCompass caps.Tile=true caps.TileSpeedMax=255 caps.TileSpeedMin=1 caps.Tour=true caps.TourMax=8 caps.TourMin=1 caps.TourSpeed=true caps.Type=1 caps.VoltageStatus.Support=false caps.Wiper=false caps.Zoom=true caps.lowMask=2147483599

If Amcrest API doesn't work, you might try ONVIF api. onvif.org
alabamatoy
Posts: 18
Joined: Thu Jul 07, 2016 5:10 pm

Re: CGI restful API problems with IP4M-1056E

Post by alabamatoy »

Code: Select all

https://whatever/cgi-bin/ptz.cgi?action=start&code=ZoomTele&channel=0&arg1=0&arg2=0&arg3=0&arg4=0
--and--

Code: Select all

https://whatever/cgi-bin/ptz.cgi?action=start&code=ZoomWide&channel=0&arg1=0&arg2=0&arg3=0&arg4=0
--and--

Code: Select all

https://whatever/cgi-bin/ptz.cgi?action=stop&code=Zoom[whichever, Tele or Wide]&channel=0&arg1=0&arg2=0&arg3=0&arg4=0
Works on all of mine....
Post Reply