Script To Reboot Hikvision Cameras

Hi Guys,

I find that I am needing to reboot some Hikvision cameras from time to time on certain jobs and I would like to automate the process. Unfortunately, the UPS's do not have Ethernet to schedule reboots and logging into the switches is cumbersome (very slow internet).

I have been looking through the Hikvison API's and found that I should be able to do the following (via HTTP I was hoping):

http://login:password@192.xxx.xxx.xxx/ISAPI/System/reboot

Unfortunately, that does not seem to work (neither does .xxx/System/reboot or many other variations).

Has anyone had success in rebooting a Hikvision camera via http or custom application?

Thanks very much!


What's the error?

Hi Chris, this is the error I receive:

<ResponseStatus xmlns="http://www.hikvision.com/ver20/XMLSchema" version="2.0">
<requestURL>/ISAPI/System/reboot</requestURL>
<statusCode>4</statusCode>
<statusString>Invalid Operation</statusString>
<subStatusCode>methodNotAllowed</subStatusCode>
</ResponseStatus>

Are you doing a POST or a GET?

A normal browser request that you type in is a GET.

To do a POST you need something like curl.

OK, I got curl and tried a few commands - same result:

c:\Temp\CameraSchedule>curl -X POST --user admin:12345 "http://192.168.0.24/ISAP
I/System/reboot"
<?xml version="1.0" encoding="UTF-8"?>
<ResponseStatus version="2.0" xmlns="http://www.hikvision.com/ver20/XMLSchema">
<requestURL>/ISAPI/System/reboot</requestURL>
<statusCode>4</statusCode>
<statusString>Invalid Operation</statusString>
<subStatusCode>methodNotAllowed</subStatusCode>
</ResponseStatus>

Any idea on how to write the script?

Try -X PUT

For any one who is wondering, this is how to reboot a Hik camera:

1) Install cURL (http://www.confusedbycode.com/curl/)

2) In command prompt (or a .bat file), use this command:

curl -X PUT -d reboot http://login:password@xxx.xxx.xxx.xxx/System/reboot

Thanks very much to Mr. Chris Dearing, you are awesome!

Chris Dearing, IPVM commenter of the day! :)

Thanks, Chris!

From Hik R&D:

We do NOT support HTTP method, but we support PUT /ISAPI/System/reboot that requires the customer to create the socket by themselves.

Bob (Hikvision)

I've used a script to ssh into AXIS cameras and reboot them. I imagine you could do something like that with a Hikvision camera, but I don't have any on hand to test.

I do know telnet is enabled on Hik Encoders and that would allow you to do it through native Windows shell and a bat file that way.