Open damodaran opened 5 years ago
I'm getting the same error. Any ideas?
I was getting the same error. But after I realized that node-hikvision-api uses digest/basic authentication method. Then as you can see below, I changed the authentication method from digest to digest/basic.
If your error still persists you can use given below code for tracking alarms as I do. This code is taken from node-hikvision-api and I changed it slightly.
any patches? I have seen this api being used for node-red and it just crashes the entire service once this happens? Ideas how to fix it? my camera is set to digest/basic, onvif and cgi enabled
11 Jul 13:24:53 - [red] Uncaught Exception:
11 Jul 13:24:53 - TypeError: Cannot read property 'eventType' of undefined
at /home/pi/.node-red/node_modules/node-hikvision-api/hikvision.js:184:47
at Parser.<anonymous> (/home/pi/.node-red/node_modules/xml2js/lib/parser.js:303:18)
at emitOne (events.js:116:13)
at Parser.emit (events.js:211:7)
at SAXParser.onclosetag (/home/pi/.node-red/node_modules/xml2js/lib/parser.js:261:26)
at emit (/home/pi/.node-red/node_modules/sax/lib/sax.js:624:35)
at emitNode (/home/pi/.node-red/node_modules/sax/lib/sax.js:629:5)
at closeTag (/home/pi/.node-red/node_modules/sax/lib/sax.js:889:7)
at SAXParser.write (/home/pi/.node-red/node_modules/sax/lib/sax.js:1436:13)
at Parser.exports.Parser.Parser.parseString (/home/pi/.node-red/node_modules/xml2js/lib/parser.js:322:31)
at Parser.parseString (/home/pi/.node-red/node_modules/xml2js/lib/parser.js:5:59)
at handleData (/home/pi/.node-red/node_modules/node-hikvision-api/hikvision.js:182:9)
at Socket.<anonymous> (/home/pi/.node-red/node_modules/node-hikvision-api/hikvision.js:47:10)
at emitOne (events.js:116:13)
at Socket.emit (events.js:211:7)
at addChunk (_stream_readable.js:263:12)
Iam getting same error on node i use node 12.13.0
node cam.js Connected to 46.252.x.x:81 events.js:187 throw er; // Unhandled 'error' event ^
ReferenceError: self is not defined
at /var/www/html/zoolandie/node_modules/node-hikvision-api/hikvision.js:70:6
at Parser.
Iam getting same error on node i use node 12.13.0
node cam.js Connected to 46.252.x.x:81 events.js:187 throw er; // Unhandled 'error' event ^
ReferenceError: self is not defined at /var/www/html/zoolandie/node_modules/node-hikvision-api/hikvision.js:70:6 at Parser. (/var/www/html/zoolandie/node_modules/xml2js/lib/parser.js:306:18) at Parser.emit (events.js:210:5) at SAXParser.onclosetag (/var/www/html/zoolandie/node_modules/xml2js/lib/parser.js:264:26) at emit (/var/www/html/zoolandie/node_modules/sax/lib/sax.js:624:35) at emitNode (/var/www/html/zoolandie/node_modules/sax/lib/sax.js:629:5) at closeTag (/var/www/html/zoolandie/node_modules/sax/lib/sax.js:889:7) at SAXParser.write (/var/www/html/zoolandie/node_modules/sax/lib/sax.js:1436:13) at Parser.exports.Parser.Parser.parseString (/var/www/html/zoolandie/node_modules/xml2js/lib/parser.js:325:31) at Parser.parseString (/var/www/html/zoolandie/node_modules/xml2js/lib/parser.js:5:59) Emitted 'error' event on Parser instance at: at Parser.exports.Parser.Parser.parseString (/var/www/html/zoolandie/node_modules/xml2js/lib/parser.js:329:16) at Parser.parseString (/var/www/html/zoolandie/node_modules/xml2js/lib/parser.js:5:59) at Socket. (/var/www/html/zoolandie/node_modules/node-hikvision-api/hikvision.js:46:10) at Socket.emit (events.js:210:5) at addChunk (_stream_readable.js:308:12) at readableAddChunk (_stream_readable.js:289:11) at Socket.Readable.push (_stream_readable.js:223:10) at TCP.onStreamRead (internal/stream_base_commons.js:182:23)
I get the same error, could you solve that problem?
Hello,
This issue was related to xml2js library as far as I remember. I did some adjustments to previously shared code but at this moment I could not remember. However, I can make a detailed explanation next week.
I am getting the following error when I tried to run the example code given in the github. Please find the details given below:
The code:
Please let me know what went wrong?