HTTP commands for Hikvision

sweet1

Young grasshopper
Joined
May 15, 2016
Messages
33
Reaction score
3
Does anyone know the HTTP commands for Hikvision camera's?

More specifically the HTTP command to enable and disable the inbuilt alarm on a DS-2CD2432F-I(W)?

Also send a custom wave file to the speakers? (Armed / disarmed sounds)

Your help is greatly appreciated!
 

sweet1

Young grasshopper
Joined
May 15, 2016
Messages
33
Reaction score
3
I found this PDF but I still cant figure it out. Can you point me in the right direction?
 

nayr

IPCT Contributor
Joined
Jul 16, 2014
Messages
9,329
Reaction score
5,325
Location
Denver, CO
first of all it wont take http GET requests; you have to POST XML to the path..

Screenshot 2016-12-13 16.11.08.png
 

sweet1

Young grasshopper
Joined
May 15, 2016
Messages
33
Reaction score
3
I think I figured it out:

Copy the XML from
http://username:Password@ipaddress/IO/outputs/1/

Paste all info to notepad, Edit default state to "High" and save as *.xml (also save another XML with Low to deactivate the alarm)

Then use CURL to POST to the Camera?

Is there a chance I could mess this up? and if I do, how can I fix this? reset button?
 

nayr

IPCT Contributor
Joined
Jul 16, 2014
Messages
9,329
Reaction score
5,325
Location
Denver, CO
wort case just reboot the camera; but it should not harm the camera even if you screw it all up
 

sweet1

Young grasshopper
Joined
May 15, 2016
Messages
33
Reaction score
3
Will give it a go tonight!

How can I send a audio file (Armed / Disarmed) to the camera? or maybe beep every second for 30 seconds on ARM and beep twice (?) on disarm
 

sweet1

Young grasshopper
Joined
May 15, 2016
Messages
33
Reaction score
3
I am getting this error message:

<?xml version="1.0" encoding="UTF-8"?>
<ResponseStatus version="1.0" xmlns="Oops:The page you are visiting may have been deleted,renamed or inaccessible.">
<requestURL>/IO/outputs/1/trigger</requestURL>
<statusCode>6</statusCode>
<statusString>Invalid XML Content</statusString>
</ResponseStatus>

when running:

curl -T AlarmON.xml http://X:X@xx.xx.xx.xx/IO/outputs/1/trigger

also tried:
curl -T AlarmON.xml http://X:X@xx.xx.xx.xx/IO/outputs/1/

Alarmon.xml contains:

<IOOutputPort xmlns="http://www.hikvision.com/ver10/XMLSchema" version="1.0">
<id>1</id>
<PowerOnState>
<defaultState>high</defaultState>
<outputState>pulse</outputState>
<pulseDuration>5000</pulseDuration>
</PowerOnState>
</IOOutputPort>


Any suggestions?
 

sweet1

Young grasshopper
Joined
May 15, 2016
Messages
33
Reaction score
3
ok, I got it working! Thank you nayr.

Is this trigger for an external speaker? As I know these camera's have an internal alarm. When I received my Hikvision's, it was set to sound alarm when hard disk was full. Took me a while to realise and deactivate.

Do you know how to enable the internal alarm?
 

Vasiliy

n3wb
Joined
Oct 6, 2017
Messages
3
Reaction score
0
I have a similar problem. At the entrance gate installed 2CD2642. To lay additional cable to the camera from home is not possible. There is a need to control the gate of the house (to run a cable from the camera to the drive gate not a problem). The natural solution - the command through the Ethernet network. However, in response to the request received the same error as Sweet1: invalid XML content. 1.XML contains:

<?xml version="1.0" encoding="UTF-8"?>
-<IOOutputPort xmlns="Oops:The page you are visiting may have been deleted,renamed or inaccessible." version="1.0">
<id>1</id>
-<PowerOnState>
<defaultState>high</defaultState>
<outputState>pulse</outputState>
<pulseDuration>5000</pulseDuration>
</PowerOnState>
</IOOutputPort>.

Please help a dumb user.
 

Vasiliy

n3wb
Joined
Oct 6, 2017
Messages
3
Reaction score
0
Thank you all. Understood. You have to be careful about the syntax.
 

sweet1

Young grasshopper
Joined
May 15, 2016
Messages
33
Reaction score
3
The XMLs are pretty basic, i ihave since upgraded but looking at my comments i believe:

Script to turn of motion detection:
<?xml version="1.0" encoding="UTF-8"?>
<MotionDetection version="1.0" xmlns="">
<id>1</id>
<enabled>false</enabled>
<regionType>grid</regionType>
<Grid>
<rowGranularity>18</rowGranularity>
<columnGranularity>22</columnGranularity>
</Grid>
<MotionDetectionRegionList>
<sensitivityLevel>0</sensitivityLevel>
</MotionDetectionRegionList>
</MotionDetection>
XML to turn off the alarm
<?xml version="1.0" encoding="UTF-8"?>
<PIRAlarm version="1.0" xmlns="">
<enabled>false</enabled>
</PIRAlarm>
Command to POST to cameras, for example:

C:\Path\to\curl -T "C:\Path\to\XML.xml"

Hope this helps!
 
Top