hikvision http command for ptz

Joined
Mar 6, 2021
Messages
5
Reaction score
0
Location
Germany, Cologne
Hi together,

a couple days ago we received and installed the DS-2DE4A225IW-DE poe ptz camera.
Since them I am struggeling to find the correct http-commands for pan/tilt and zoom.

I like to include the controlling into our home automation.
So far I tired this one:

in different combinations (w/o port, w/o pw and admin) with this result:

JSON:
This XML file does not appear to have any style information associated with it. The document tree is shown below.
<ResponseStatus xmlns="http://www.hikvision.com/ver20/XMLSchema" version="2.0">
<requestURL>/ISAPI/PTZCtrl/channels/101/presets/1/goto</requestURL>
<statusCode>6</statusCode>
<statusString>Invalid Content</statusString>
<subStatusCode>badXmlContent</subStatusCode>
</ResponseStatus>
CGI and ONVIF are activated with user admin.
What else can I try to operate the cam per http command? Is there a different way to get it run?

Thanks in advance
and greetings,
Thomas

edit: forgot to mention that I studied the "Hikvision ISAPI Core Protocol.pdf" already, without success
 
Joined
Mar 6, 2021
Messages
5
Reaction score
0
Location
Germany, Cologne
Hi all,

has nobody an idea what I can try as next?
Or does someone know if this method with "ISAPI" is the correct way, in general?

Thanks,
Thomas
 

watchful_ip

Pulling my weight
Joined
Nov 24, 2019
Messages
251
Reaction score
226
Location
london
I usually use something like wireshark and then capture the commands/XML your web browser uses to perform the actions you want.
 
Joined
Mar 6, 2021
Messages
5
Reaction score
0
Location
Germany, Cologne
Hi watchful,

thx for the hint!

The first wireshark I did with "/ISAPI/Security/capabilities" and got a response in the chrome browser.
The second wireshark with "/ISAPI/PTZCtrl/channels/1/presets/1/goto" gives an error as output.
IP ending .65 is my laptop, ending with .130 is the HikVision.

But to be honest, in the provided information by wireshark I can`t find anything for the next steps :(

Do you have an idea?
Or is there another/different way to send commands to the cam for pan/tilt and zoom?

Thank you very much
and greetings,
 

Attachments

watchful_ip

Pulling my weight
Joined
Nov 24, 2019
Messages
251
Reaction score
226
Location
london
To be honest I haven't looked at the wireshark capture, but what are you using to talk to the camera?

I use curl on linux to post the correct .xml in the requests (you need to do more than simply go to a url).

Code:
curl -s -X PUT --data "$REPLY_XML" http://$IPCAM_IP:80/ISAPI/System/Video/inputs/channels/1/motionDetectionExt --user $IPCAM_USER:$IPCAM_PW -q
That would change some motion detection params depending on what $REPLY_XML contains (I turn on and off some defined regions of some of my cams from a script). You might want to check the contents of similar packets in the capture to see what's in them. Should be plain text.

Or you could probably use dev tools within chrome to see what get's POSTed to the camera when doing what you want to replicate.

Or you could check out the ONVIF protocol.

I have a PTZ, but I don't script it's movements. Maybe one day.
 
Joined
Mar 6, 2021
Messages
5
Reaction score
0
Location
Germany, Cologne
So far I figured out that I need to create, upload or whatever a xml file like in this thread:
https://ipcamtalk.com/threads/http-command-for-ptz.8615/
Http command for PTZ

And that the command will be "/ISAPI/PTZCtrl/channels/1/continuous".
Next Problem: I don´t know how to create this xml-file. I tried ab bit in the last days, but unfortunately without success.

But I will ask in the above mentioned thread again. Maybe/hopefully someone can explain it very short.

How is it possible to read out the ONVIF-protocol?
 
Top