onvif icon indicating copy to clipboard operation
onvif copied to clipboard

HikVision "Wrong ONVIF Soap Response" Error

Open kjlaw89 opened this issue 1 year ago • 17 comments

Hey all,

I have a client that installed a bunch of HikVision cameras. Normally these connect without any issues, but we ran into some issues this time with most of the cameras. We were getting the error "Wrong ONVIF Soap Response". It seems this is an issue with the newer firmware. We seem to be able to connect fine to cameras with the 18.12 firmware, but cameras with 19.12 are unable to connect:

image image

I added a bit of extra logging and was able to get some extra details that I hop could be useful.

First, I logged out the data that was being parsed when that error message was loaded up and got this: image

(for searchability, this message is returning "Access Error: 401 - Unauthorized")

In our code, the "Unable to reach camera" error is triggered when we get an error after calling Camera.connect(). I tracked that a bit further and was able to get a trace in place to the spot that is complaining:

Trace
    at Cam.<anonymous> (/.../node_modules/onvif/lib/cam.js:176:17)
    at Cam.<anonymous> (/.../node_modules/onvif/lib/media.js:989:15)
    at /.../node_modules/onvif/lib/utils.js:74:6
    at Parser.<anonymous> (/.../node_modules/xml2js/lib/parser.js:304:18)
    at Parser.emit (events.js:400:28)
    at Parser.emit (domain.js:475:12)
    at SAXParser.onclosetag (/.../node_modules/xml2js/lib/parser.js:262:26)
    at emit (/.../node_modules/sax/lib/sax.js:624:35)
    at emitNode (/.../node_modules/sax/lib/sax.js:629:5)
    at closeTag (/.../node_modules/sax/lib/sax.js:889:7)

From my tracking it seems that getProfiles or getVideoSources now requires authentication but something isn't working correctly with that for the newer firmware - but I'm not sure how to go about debugging further.

Unfortunately I don't have direct access to the cameras themselves, but I do have access to the code & device that are actively attempting to connect to the cameras, so if any changes are needed to get extra information or to test changes let me know and I can make them directly to try.

kjlaw89 avatar May 25 '23 13:05 kjlaw89