agsh / onvif

ONVIF node.js implementation
http://agsh.github.io/onvif/
MIT License
681 stars 231 forks source link

Error: ONVIF SOAP Fault: The data in element 'Security' must be understood but cannot be handled #240

Open stivyw opened 1 year ago

stivyw commented 1 year ago

Any idea?

Error: ONVIF SOAP Fault: The data in element 'Security' must be understood but cannot be handled
    at /sw/dev/study/cam/onvif/node_modules/onvif/lib/utils.js:101:13
    at Parser.<anonymous> (/sw/dev/study/cam/onvif/node_modules/xml2js/lib/parser.js:304:18)
    at Parser.emit (node:events:527:28)
    at SAXParser.onclosetag (/sw/dev/study/cam/onvif/node_modules/xml2js/lib/parser.js:262:26)
    at emit (/sw/dev/study/cam/onvif/node_modules/sax/lib/sax.js:624:35)
    at emitNode (/sw/dev/study/cam/onvif/node_modules/sax/lib/sax.js:629:5)
    at closeTag (/sw/dev/study/cam/onvif/node_modules/sax/lib/sax.js:889:7)
    at SAXParser.write (/sw/dev/study/cam/onvif/node_modules/sax/lib/sax.js:1436:13)
    at Parser.exports.Parser.Parser.parseString (/sw/dev/study/cam/onvif/node_modules/xml2js/lib/parser.js:323:31)
    at Parser.parseString (/sw/dev/study/cam/onvif/node_modules/xml2js/lib/parser.js:5:59)
var
  onvif = require('onvif'),
  http = require('http');

var Cam = onvif.Cam;
new Cam({
  hostname: '192.168.0.80',
  username: 'user',
  password: 'xxx',
  port: 8899
}, function (err) {
console.log(err)
});
agsh commented 1 year ago

@stivyw Hi! My first point is to set https via useSecure: true property in the constructor which is described here: http://agsh.github.io/onvif/Cam_.html