Sending CURL command with an XML payload ? Hikvision Camera

The default HTTP port on the Hikvision cameras is 80 not 8080.

If you set it back to 80 in the camera settings then you won’t need to specify any port number in the command used on Vera.

Look at my command I posted above.

Just try it as a test if it then works, then you will know the problem was related to having to specify the port number.

If the command still doesn’t work, then you will know it wasn’t related to specifying the port number.

Bit of trial and error some times to narrow down where the problem might be.

I put it to 80, but that didn’t work either.

Checking the API guide, it says it’s due to a hardware error. Very strange, because it works when just using curl.

error

Do you have any other Hikvision cams or just this one?

You’re right…i’m currently trying another one. I have 3 types.

No, just tested 2 other cameras…and exactly the same fault :slightly_frowning_face:

Strange then. I am using a Vera Plus your on a Vera 3 right? Maybe some difference there, but you’d expect Curl commands to work the same.

Just double and triple check you have everything correct, Linux is case sensitive as well so a small typo could put a spanner in the works.

And your xml file has definitely been uploaded to the correct folder on the Vera? etc/cmh-ludl

Yes, i’m using a Vera3…maybe the thing is too old.
I know Linux is case sensitive, so i double checked it already. The strange things is that when I use curl on the command line, then it works…but in Putty it doesn’t.

On the command prompt I’m using the “-T” parameter while in Putty I use “-s -m 15 -X PUT -d” . Couldn’t that be the problem?

No that is correct. The “-s -m 15 -X PUT -d” command I posted earlier is the right one to use on the Vera.

And on which machine are you using when doing it on the command line with - T ? I was using my Windows 10 laptop initially for testing sending the commands to the IP cam

Yes, it’s a windows 10 machine.

Maybe @rigpapa might know why it’s working on my Vera Plus but not on your Vera 3?

How did you upload your xml file to Vera?
I used the Vera interface in the “Apps - develop Apps” section.

If I had to guess, the camera wants to do Digest authentication on the HTTP request, but the old libraries on the Vera3 won’t do it (in fact, I’m not sure the Plus/Secure current firmware will, either). A lot of cameras don’t do Basic authentication any more.

Thanks @rigpapa and @cw-kid for your help. This makes me think more on upgrading :slight_smile:

1 Like

I seem to recall having to change a security setting in the camera but can’t remember if it was for Vera or some other integration I setup.

Here are the settings in the Security section.

Network Advanced Settings - Integration Protocol.

Although it doesn’t look to be enabled and not related to the ISAPI

Maybe it was for Imperihome or TinyCam Pro I changed some security setting but can’t remember now.

I don’t have that many settings :slight_smile:
security

It’s the Web Authentication one thats important I think.

Is the firmware up to date on your camera?

No, i haven’t updated that. I’ll give it a try.

@rigpapa

Would it be possible to send out these http requests with xml data via an MSR rule? Rather than what we setup in Vera?

Wondering if I could migrate this functionality completely off the Vera hub etc.

Thanks.

I don’t see why not. Multi-system Reactor’s HTTP Request action supports Digest authentication and pretty much all HTTP methods (so it can PUT). An XML payload is just text; you just need to set the Content-Type header correctly (application/xml is the new hotness, but text/xml is the legacy type and may be needed by less compliant/modern devices).