Subscriber Discussion

Script To Reboot Hikvision Cameras

UI
Undisclosed Integrator #1
Nov 30, 2015

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!

TC
Trisha (Chris' wife) Dearing
Nov 30, 2015
IPVMU Certified

What's the error?

UI
Undisclosed Integrator #1
Nov 30, 2015

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>
TC
Trisha (Chris' wife) Dearing
Nov 30, 2015
IPVMU Certified

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.

(2)
UI
Undisclosed Integrator #1
Nov 30, 2015

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?

TC
Trisha (Chris' wife) Dearing
Nov 30, 2015
IPVMU Certified

Try -X PUT

(3)
UI
Undisclosed Integrator #1
Dec 01, 2015

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!

JH
John Honovich
Dec 01, 2015
IPVM

Chris Dearing, IPVM commenter of the day! :)

Thanks, Chris!

(1)
BG
Bob Germain
Dec 01, 2015

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)

UE
Undisclosed End User #2
Dec 01, 2015

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.

New discussion

Ask questions and get answers to your physical security questions from IPVM team members and fellow subscribers.

Newest discussions