Code Monkey home page Code Monkey logo

onvif-nvt's Issues

Unauthorized when trying to pull events

I have a Foscam R2. I'm able to connect to it, stream video, take snapshots, etc. However, when trying to pull events, I am getting unauthorized errors.

My code is essentially what you have in the README:

const OnvifManager = require('onvif-nvt')

OnvifManager.connect(
  '192.168.86.229',
  888,
  'user',
  'Password1234'
).then((camera) => {
  // Some basic other things to check camera information

  if (camera.events) {
    camera.events.on('messages', (messages) => {
      console.log('Messages Received:', messages);
    });

    camera.events.on('messages:error', (error) => {
      console.error('Messages Error:', error);
    });

    camera.events.startPull();
  }
});

The full error log is below. Any suggestions on how I can at least debug this?

Log
Messages Error: IncomingMessage {
  _readableState:
   ReadableState {
     objectMode: false,
     highWaterMark: 16384,
     buffer: BufferList { head: null, tail: null, length: 0 },
     length: 0,
     pipes: null,
     pipesCount: 0,
     flowing: true,
     ended: true,
     endEmitted: true,
     reading: false,
     sync: true,
     needReadable: false,
     emittedReadable: false,
     readableListening: false,
     resumeScheduled: false,
     destroyed: false,
     defaultEncoding: 'utf8',
     awaitDrain: 0,
     readingMore: false,
     decoder:
      StringDecoder {
        encoding: 'utf8',
        fillLast: [Function: utf8FillLast],
        lastNeed: 0,
        lastTotal: 0,
        lastChar: <Buffer 10 00 00 00> },
     encoding: 'utf8' },
  readable: false,
  domain: null,
  _events:
   { end: [ [Function: responseOnEnd], [Function] ],
     close: [ [Function], [Function] ],
     data: [Function],
     error: [Function] },
  _eventsCount: 4,
  _maxListeners: undefined,
  socket:
   Socket {
     connecting: false,
     _hadError: false,
     _handle:
      TCP {
        reading: true,
        owner: [Circular],
        onread: [Function: onread],
        onconnection: null,
        writeQueueSize: 0 },
     _parent: null,
     _host: null,
     _readableState:
      ReadableState {
        objectMode: false,
        highWaterMark: 16384,
        buffer: [Object],
        length: 0,
        pipes: null,
        pipesCount: 0,
        flowing: true,
        ended: false,
        endEmitted: false,
        reading: true,
        sync: false,
        needReadable: true,
        emittedReadable: false,
        readableListening: false,
        resumeScheduled: false,
        destroyed: false,
        defaultEncoding: 'utf8',
        awaitDrain: 0,
        readingMore: false,
        decoder: null,
        encoding: null },
     readable: true,
     domain: null,
     _events:
      { end: [Object],
        _socketEnd: [Function: onSocketEnd],
        free: [Function: onFree],
        close: [Array],
        agentRemove: [Function: onRemove],
        drain: [Function: ondrain],
        error: [Function: socketErrorListener],
        finish: [Object] },
     _eventsCount: 8,
     _maxListeners: undefined,
     _writableState:
      WritableState {
        objectMode: false,
        highWaterMark: 16384,
        finalCalled: true,
        needDrain: false,
        ending: true,
        ended: true,
        finished: false,
        destroyed: false,
        decodeStrings: false,
        defaultEncoding: 'utf8',
        length: 0,
        writing: false,
        corked: 0,
        sync: false,
        bufferProcessing: false,
        onwrite: [Function: bound onwrite],
        writecb: null,
        writelen: 0,
        bufferedRequest: null,
        lastBufferedRequest: null,
        pendingcb: 1,
        prefinished: false,
        errorEmitted: false,
        bufferedRequestCount: 0,
        corkedRequestsFree: [Object] },
     writable: false,
     allowHalfOpen: false,
     _bytesDispatched: 1745,
     _sockname: null,
     _pendingData: null,
     _pendingEncoding: '',
     server: null,
     _server: null,
     parser: null,
     _httpMessage:
      ClientRequest {
        domain: null,
        _events: [Object],
        _eventsCount: 5,
        _maxListeners: undefined,
        output: [],
        outputEncodings: [],
        outputCallbacks: [],
        outputSize: 0,
        writable: true,
        _last: true,
        upgrading: false,
        chunkedEncoding: false,
        shouldKeepAlive: false,
        useChunkedEncodingByDefault: true,
        sendDate: false,
        _removedConnection: false,
        _removedContLen: false,
        _removedTE: false,
        _contentLength: null,
        _hasBody: true,
        _trailer: '',
        finished: true,
        _headerSent: true,
        socket: [Circular],
        connection: [Circular],
        _header: 'POST / HTTP/1.1\r\nContent-Type: application/soap+xml; charset=utf-8;\r\nContent-Length: 1523\r\nAuthorization: Basic dXNlcjpQYXNzd29yZDEyMzQ=\r\nreferer: http://192.168.86.229:888/\r\nhost: 192.168.86.229:888\r\nConnection: close\r\n\r\n',
        _onPendingData: [Function: noopPendingOutput],
        agent: [Object],
        socketPath: undefined,
        timeout: undefined,
        method: 'POST',
        path: '/',
        _ended: true,
        res: [Circular],
        aborted: undefined,
        timeoutCb: null,
        upgradeOrConnect: false,
        parser: null,
        maxHeadersCount: null,
        [Symbol(outHeadersKey)]: [Object] },
     [Symbol(asyncId)]: 387,
     [Symbol(bytesRead)]: 0 },
  connection:
   Socket {
     connecting: false,
     _hadError: false,
     _handle:
      TCP {
        reading: true,
        owner: [Circular],
        onread: [Function: onread],
        onconnection: null,
        writeQueueSize: 0 },
     _parent: null,
     _host: null,
     _readableState:
      ReadableState {
        objectMode: false,
        highWaterMark: 16384,
        buffer: [Object],
        length: 0,
        pipes: null,
        pipesCount: 0,
        flowing: true,
        ended: false,
        endEmitted: false,
        reading: true,
        sync: false,
        needReadable: true,
        emittedReadable: false,
        readableListening: false,
        resumeScheduled: false,
        destroyed: false,
        defaultEncoding: 'utf8',
        awaitDrain: 0,
        readingMore: false,
        decoder: null,
        encoding: null },
     readable: true,
     domain: null,
     _events:
      { end: [Object],
        _socketEnd: [Function: onSocketEnd],
        free: [Function: onFree],
        close: [Array],
        agentRemove: [Function: onRemove],
        drain: [Function: ondrain],
        error: [Function: socketErrorListener],
        finish: [Object] },
     _eventsCount: 8,
     _maxListeners: undefined,
     _writableState:
      WritableState {
        objectMode: false,
        highWaterMark: 16384,
        finalCalled: true,
        needDrain: false,
        ending: true,
        ended: true,
        finished: false,
        destroyed: false,
        decodeStrings: false,
        defaultEncoding: 'utf8',
        length: 0,
        writing: false,
        corked: 0,
        sync: false,
        bufferProcessing: false,
        onwrite: [Function: bound onwrite],
        writecb: null,
        writelen: 0,
        bufferedRequest: null,
        lastBufferedRequest: null,
        pendingcb: 1,
        prefinished: false,
        errorEmitted: false,
        bufferedRequestCount: 0,
        corkedRequestsFree: [Object] },
     writable: false,
     allowHalfOpen: false,
     _bytesDispatched: 1745,
     _sockname: null,
     _pendingData: null,
     _pendingEncoding: '',
     server: null,
     _server: null,
     parser: null,
     _httpMessage:
      ClientRequest {
        domain: null,
        _events: [Object],
        _eventsCount: 5,
        _maxListeners: undefined,
        output: [],
        outputEncodings: [],
        outputCallbacks: [],
        outputSize: 0,
        writable: true,
        _last: true,
        upgrading: false,
        chunkedEncoding: false,
        shouldKeepAlive: false,
        useChunkedEncodingByDefault: true,
        sendDate: false,
        _removedConnection: false,
        _removedContLen: false,
        _removedTE: false,
        _contentLength: null,
        _hasBody: true,
        _trailer: '',
        finished: true,
        _headerSent: true,
        socket: [Circular],
        connection: [Circular],
        _header: 'POST / HTTP/1.1\r\nContent-Type: application/soap+xml; charset=utf-8;\r\nContent-Length: 1523\r\nAuthorization: Basic dXNlcjpQYXNzd29yZDEyMzQ=\r\nreferer: http://192.168.86.229:888/\r\nhost: 192.168.86.229:888\r\nConnection: close\r\n\r\n',
        _onPendingData: [Function: noopPendingOutput],
        agent: [Object],
        socketPath: undefined,
        timeout: undefined,
        method: 'POST',
        path: '/',
        _ended: true,
        res: [Circular],
        aborted: undefined,
        timeoutCb: null,
        upgradeOrConnect: false,
        parser: null,
        maxHeadersCount: null,
        [Symbol(outHeadersKey)]: [Object] },
     [Symbol(asyncId)]: 387,
     [Symbol(bytesRead)]: 0 },
  httpVersionMajor: 1,
  httpVersionMinor: 1,
  httpVersion: '1.1',
  complete: true,
  headers:
   { 'www-authenticate': 'Basic realm="gSOAP Web Service"',
     server: 'gSOAP',
     'content-type': 'application/soap+xml; charset=utf-8',
     'content-length': '1824',
     connection: 'close' },
  rawHeaders:
   [ 'WWW-Authenticate',
     'Basic realm="gSOAP Web Service"',
     'Server',
     'gSOAP',
     'Content-Type',
     'application/soap+xml; charset=utf-8',
     'Content-Length',
     '1824',
     'Connection',
     'close' ],
  trailers: {},
  rawTrailers: [],
  aborted: false,
  upgrade: false,
  url: '',
  method: null,
  statusCode: 401,
  statusMessage: 'Unauthorized',
  client:
   Socket {
     connecting: false,
     _hadError: false,
     _handle:
      TCP {
        reading: true,
        owner: [Circular],
        onread: [Function: onread],
        onconnection: null,
        writeQueueSize: 0 },
     _parent: null,
     _host: null,
     _readableState:
      ReadableState {
        objectMode: false,
        highWaterMark: 16384,
        buffer: [Object],
        length: 0,
        pipes: null,
        pipesCount: 0,
        flowing: true,
        ended: false,
        endEmitted: false,
        reading: true,
        sync: false,
        needReadable: true,
        emittedReadable: false,
        readableListening: false,
        resumeScheduled: false,
        destroyed: false,
        defaultEncoding: 'utf8',
        awaitDrain: 0,
        readingMore: false,
        decoder: null,
        encoding: null },
     readable: true,
     domain: null,
     _events:
      { end: [Object],
        _socketEnd: [Function: onSocketEnd],
        free: [Function: onFree],
        close: [Array],
        agentRemove: [Function: onRemove],
        drain: [Function: ondrain],
        error: [Function: socketErrorListener],
        finish: [Object] },
     _eventsCount: 8,
     _maxListeners: undefined,
     _writableState:
      WritableState {
        objectMode: false,
        highWaterMark: 16384,
        finalCalled: true,
        needDrain: false,
        ending: true,
        ended: true,
        finished: false,
        destroyed: false,
        decodeStrings: false,
        defaultEncoding: 'utf8',
        length: 0,
        writing: false,
        corked: 0,
        sync: false,
        bufferProcessing: false,
        onwrite: [Function: bound onwrite],
        writecb: null,
        writelen: 0,
        bufferedRequest: null,
        lastBufferedRequest: null,
        pendingcb: 1,
        prefinished: false,
        errorEmitted: false,
        bufferedRequestCount: 0,
        corkedRequestsFree: [Object] },
     writable: false,
     allowHalfOpen: false,
     _bytesDispatched: 1745,
     _sockname: null,
     _pendingData: null,
     _pendingEncoding: '',
     server: null,
     _server: null,
     parser: null,
     _httpMessage:
      ClientRequest {
        domain: null,
        _events: [Object],
        _eventsCount: 5,
        _maxListeners: undefined,
        output: [],
        outputEncodings: [],
        outputCallbacks: [],
        outputSize: 0,
        writable: true,
        _last: true,
        upgrading: false,
        chunkedEncoding: false,
        shouldKeepAlive: false,
        useChunkedEncodingByDefault: true,
        sendDate: false,
        _removedConnection: false,
        _removedContLen: false,
        _removedTE: false,
        _contentLength: null,
        _hasBody: true,
        _trailer: '',
        finished: true,
        _headerSent: true,
        socket: [Circular],
        connection: [Circular],
        _header: 'POST / HTTP/1.1\r\nContent-Type: application/soap+xml; charset=utf-8;\r\nContent-Length: 1523\r\nAuthorization: Basic dXNlcjpQYXNzd29yZDEyMzQ=\r\nreferer: http://192.168.86.229:888/\r\nhost: 192.168.86.229:888\r\nConnection: close\r\n\r\n',
        _onPendingData: [Function: noopPendingOutput],
        agent: [Object],
        socketPath: undefined,
        timeout: undefined,
        method: 'POST',
        path: '/',
        _ended: true,
        res: [Circular],
        aborted: undefined,
        timeoutCb: null,
        upgradeOrConnect: false,
        parser: null,
        maxHeadersCount: null,
        [Symbol(outHeadersKey)]: [Object] },
     [Symbol(asyncId)]: 387,
     [Symbol(bytesRead)]: 0 },
  _consuming: true,
  _dumped: false,
  req:
   ClientRequest {
     domain: null,
     _events:
      { socket: [Function],
        response: [Function: bound ],
        error: [Function: bound ],
        drain: [Function],
        prefinish: [Function: requestOnPrefinish] },
     _eventsCount: 5,
     _maxListeners: undefined,
     output: [],
     outputEncodings: [],
     outputCallbacks: [],
     outputSize: 0,
     writable: true,
     _last: true,
     upgrading: false,
     chunkedEncoding: false,
     shouldKeepAlive: false,
     useChunkedEncodingByDefault: true,
     sendDate: false,
     _removedConnection: false,
     _removedContLen: false,
     _removedTE: false,
     _contentLength: null,
     _hasBody: true,
     _trailer: '',
     finished: true,
     _headerSent: true,
     socket:
      Socket {
        connecting: false,
        _hadError: false,
        _handle: [Object],
        _parent: null,
        _host: null,
        _readableState: [Object],
        readable: true,
        domain: null,
        _events: [Object],
        _eventsCount: 8,
        _maxListeners: undefined,
        _writableState: [Object],
        writable: false,
        allowHalfOpen: false,
        _bytesDispatched: 1745,
        _sockname: null,
        _pendingData: null,
        _pendingEncoding: '',
        server: null,
        _server: null,
        parser: null,
        _httpMessage: [Circular],
        [Symbol(asyncId)]: 387,
        [Symbol(bytesRead)]: 0 },
     connection:
      Socket {
        connecting: false,
        _hadError: false,
        _handle: [Object],
        _parent: null,
        _host: null,
        _readableState: [Object],
        readable: true,
        domain: null,
        _events: [Object],
        _eventsCount: 8,
        _maxListeners: undefined,
        _writableState: [Object],
        writable: false,
        allowHalfOpen: false,
        _bytesDispatched: 1745,
        _sockname: null,
        _pendingData: null,
        _pendingEncoding: '',
        server: null,
        _server: null,
        parser: null,
        _httpMessage: [Circular],
        [Symbol(asyncId)]: 387,
        [Symbol(bytesRead)]: 0 },
     _header: 'POST / HTTP/1.1\r\nContent-Type: application/soap+xml; charset=utf-8;\r\nContent-Length: 1523\r\nAuthorization: Basic dXNlcjpQYXNzd29yZDEyMzQ=\r\nreferer: http://192.168.86.229:888/\r\nhost: 192.168.86.229:888\r\nConnection: close\r\n\r\n',
     _onPendingData: [Function: noopPendingOutput],
     agent:
      Agent {
        domain: null,
        _events: [Object],
        _eventsCount: 1,
        _maxListeners: undefined,
        defaultPort: 80,
        protocol: 'http:',
        options: [Object],
        requests: {},
        sockets: [Object],
        freeSockets: {},
        keepAliveMsecs: 1000,
        keepAlive: false,
        maxSockets: Infinity,
        maxFreeSockets: 256 },
     socketPath: undefined,
     timeout: undefined,
     method: 'POST',
     path: '/',
     _ended: true,
     res: [Circular],
     aborted: undefined,
     timeoutCb: null,
     upgradeOrConnect: false,
     parser: null,
     maxHeadersCount: null,
     [Symbol(outHeadersKey)]:
      { 'content-type': [Array],
        'content-length': [Array],
        authorization: [Array],
        referer: [Array],
        host: [Array] } },
  request:
   Request {
     domain: null,
     _events:
      { error: [Function: bound ],
        complete: [Function: bound ],
        pipe: [Array],
        data: [Function],
        end: [Function] },
     _eventsCount: 5,
     _maxListeners: undefined,
     method: 'POST',
     uri:
      Url {
        protocol: 'http:',
        slashes: true,
        auth: null,
        host: '192.168.86.229:888',
        port: '888',
        hostname: '192.168.86.229',
        hash: null,
        search: null,
        query: null,
        pathname: '/',
        path: '/',
        href: 'http://192.168.86.229:888/' },
     encoding: 'utf8',
     headers:
      { 'Content-Type': 'application/soap+xml; charset=utf-8;',
        'Content-Length': 1523,
        Authorization: 'Basic dXNlcjpQYXNzd29yZDEyMzQ=',
        referer: 'http://192.168.86.229:888/' },
     body: '<?xml version="1.0" encoding="UTF-8"?><s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:wsa5="http://www.w3.org/2005/08/addressing" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:tt="http://www.onvif.org/ver10/schema" xmlns:ter="http://www.onvif.org/ver10/error" xmlns:tev="http://www.onvif.org/ver10/events/wsdl"><s:Header><wsa5:ReplyTo><wsa5:Address>http://www.w3.org/2005/08/addressing/anonymous</wsa5:Address></wsa5:ReplyTo><wsse:Security s:mustUnderstand="1"><wsu:Timestamp wsu:Id="Time"><wsu:Created>2019-07-09T19:02:05.412Z</wsu:Created><wsu:Expires>2019-07-09T19:02:15.412Z</wsu:Expires></wsu:Timestamp><wsse:UsernameToken wsu:Id="User"><wsse:Username>user</wsse:Username><wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordDigest">rWc6m/M2o+KnWRtpQMxMpMiLgQw=</wsse:Password><wsse:Nonce EncodingType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary">ZWouVMWT++SulxnpqWX7nQ==</wsse:Nonce><wsu:Created xmlns="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">2019-07-09T19:02:05.412Z</wsu:Created></wsse:UsernameToken></wsse:Security></s:Header><s:Body><tev:CreatePullPointSubscription/></s:Body></s:Envelope>',
     callback: [Function],
     readable: true,
     writable: true,
     explicitMethod: true,
     _qs:
      Querystring {
        request: [Circular],
        lib: [Object],
        useQuerystring: undefined,
        parseOptions: {},
        stringifyOptions: {} },
     _auth:
      Auth {
        request: [Circular],
        hasAuth: true,
        sentAuth: true,
        bearerToken: null,
        user: 'user',
        pass: 'Password1234' },
     _oauth: OAuth { request: [Circular], params: null },
     _multipart:
      Multipart {
        request: [Circular],
        boundary: 'e2538b66-9462-4ae0-846a-d213833b2356',
        chunked: false,
        body: null },
     _redirect:
      Redirect {
        request: [Circular],
        followRedirect: true,
        followRedirects: true,
        followAllRedirects: false,
        followOriginalHttpMethod: false,
        allowRedirect: [Function],
        maxRedirects: 10,
        redirects: [Array],
        redirectsFollowed: 1,
        removeRefererHeader: false },
     _tunnel:
      Tunnel {
        request: [Circular],
        proxyHeaderWhiteList: [Array],
        proxyHeaderExclusiveList: [] },
     setHeader: [Function],
     hasHeader: [Function],
     getHeader: [Function],
     removeHeader: [Function],
     localAddress: undefined,
     pool: {},
     dests: [],
     __isRequestRequest: true,
     _callback: [Function],
     proxy: null,
     tunnel: false,
     setHost: true,
     originalCookieHeader: undefined,
     _disableCookies: true,
     _jar: undefined,
     port: '888',
     host: '192.168.86.229',
     path: '/',
     httpModule:
      { _connectionListener: [Function: connectionListener],
        METHODS: [Array],
        STATUS_CODES: [Object],
        Agent: [Object],
        ClientRequest: [Object],
        globalAgent: [Object],
        IncomingMessage: [Object],
        OutgoingMessage: [Object],
        Server: [Object],
        ServerResponse: [Object],
        createServer: [Function: createServer],
        get: [Function: get],
        request: [Function: request],
        maxHeaderSize: [Getter] },
     agentClass: { [Function: Agent] super_: [Object], defaultMaxSockets: Infinity },
     agent:
      Agent {
        domain: null,
        _events: [Object],
        _eventsCount: 1,
        _maxListeners: undefined,
        defaultPort: 80,
        protocol: 'http:',
        options: [Object],
        requests: {},
        sockets: [Object],
        freeSockets: {},
        keepAliveMsecs: 1000,
        keepAlive: false,
        maxSockets: Infinity,
        maxFreeSockets: 256 },
     href: 'http://192.168.86.229:888/',
     ntick: true,
     response: [Circular],
     originalHost: '192.168.86.229:888',
     originalHostHeaderName: 'host',
     _started: true,
     req:
      ClientRequest {
        domain: null,
        _events: [Object],
        _eventsCount: 5,
        _maxListeners: undefined,
        output: [],
        outputEncodings: [],
        outputCallbacks: [],
        outputSize: 0,
        writable: true,
        _last: true,
        upgrading: false,
        chunkedEncoding: false,
        shouldKeepAlive: false,
        useChunkedEncodingByDefault: true,
        sendDate: false,
        _removedConnection: false,
        _removedContLen: false,
        _removedTE: false,
        _contentLength: null,
        _hasBody: true,
        _trailer: '',
        finished: true,
        _headerSent: true,
        socket: [Object],
        connection: [Object],
        _header: 'POST / HTTP/1.1\r\nContent-Type: application/soap+xml; charset=utf-8;\r\nContent-Length: 1523\r\nAuthorization: Basic dXNlcjpQYXNzd29yZDEyMzQ=\r\nreferer: http://192.168.86.229:888/\r\nhost: 192.168.86.229:888\r\nConnection: close\r\n\r\n',
        _onPendingData: [Function: noopPendingOutput],
        agent: [Object],
        socketPath: undefined,
        timeout: undefined,
        method: 'POST',
        path: '/',
        _ended: true,
        res: [Circular],
        aborted: undefined,
        timeoutCb: null,
        upgradeOrConnect: false,
        parser: null,
        maxHeadersCount: null,
        [Symbol(outHeadersKey)]: [Object] },
     responseContent: [Circular],
     _destdata: true,
     _ended: true,
     _callbackCalled: true },
  toJSON: [Function: responseToJSON],
  caseless:
   Caseless {
     dict:
      { 'www-authenticate': 'Basic realm="gSOAP Web Service"',
        server: 'gSOAP',
        'content-type': 'application/soap+xml; charset=utf-8',
        'content-length': '1824',
        connection: 'close' } },
  read: [Function],
  body: '<?xml version="1.0" encoding="UTF-8"?>\n<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://www.w3.org/2003/05/soap-envelope" xmlns:SOAP-ENC="http://www.w3.org/2003/05/soap-encoding" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:wsdd="http://schemas.xmlsoap.org/ws/2005/04/discovery" xmlns:chan="http://schemas.microsoft.com/ws/2005/02/duplex" xmlns:wsa5="http://www.w3.org/2005/08/addressing" xmlns:c14n="http://www.w3.org/2001/10/xml-exc-c14n#" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:xenc="http://www.w3.org/2001/04/xmlenc#" xmlns:wsc="http://schemas.xmlsoap.org/ws/2005/02/sc" xmlns:ds="http://www.w3.org/2000/09/xmldsig#" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns:xmime="http://tempuri.org/xmime.xsd" xmlns:xop="http://www.w3.org/2004/08/xop/include" xmlns:tt="http://www.onvif.org/ver10/schema" xmlns:wsnt="http://docs.oasis-open.org/wsn/b-2" xmlns:wsrfbf="http://docs.oasis-open.org/wsrf/bf-2" xmlns:wstop="http://docs.oasis-open.org/wsn/t-1" xmlns:tdn="http://www.onvif.org/ver10/network/wsdl" xmlns:tds="http://www.onvif.org/ver10/device/wsdl" xmlns:tptz="http://www.onvif.org/ver20/ptz/wsdl" xmlns:trt="http://www.onvif.org/ver10/media/wsdl"><SOAP-ENV:Header><wsa5:ReplyTo SOAP-ENV:mustUnderstand="true"><wsa5:Address>http://www.w3.org/2005/08/addressing/anonymous</wsa5:Address></wsa5:ReplyTo></SOAP-ENV:Header><SOAP-ENV:Body><SOAP-ENV:Fault><SOAP-ENV:Code><SOAP-ENV:Value>SOAP-ENV:Sender</SOAP-ENV:Value></SOAP-ENV:Code><SOAP-ENV:Reason><SOAP-ENV:Text xml:lang="en">HTTP Error: 401 Unauthorized</SOAP-ENV:Text></SOAP-ENV:Reason></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>\r\n' }

Update hardware lookup.

Camera.js is erroring for me at coreGetScopes() function.

Need to add the underscore to the object path to make it pull correctly.
var s = scope.ScopeItem._;

Could be some weird environment specific thing but I've just put it in a try catch for now.

scopes.forEach(scope => {
          try {
            var s = scope.ScopeItem;
            s.indexOf('')
          } catch {
            var s = scope.ScopeItem._;
          }
          if (s.indexOf('onvif://www.onvif.org/hardware/') === 0) {
            const hardware = s.split('/').pop();
            this.deviceInformation.Hardware = hardware;

An in-range update of eslint-plugin-jsdoc is breaking the build 🚨

The devDependency eslint-plugin-jsdoc was updated from 4.6.0 to 4.7.0.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

eslint-plugin-jsdoc is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • ❌ ci/circleci: Your tests failed on CircleCI (Details).

Release Notes for v4.7.0

4.7.0 (2019-04-01)

Features

  • make check-returns ignore abstract methods (7505604)
Commits

The new version differs by 2 commits.

  • 7505604 feat: make check-returns ignore abstract methods
  • b1301d6 Makes "Check Returns" ignore abstract methods.

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

Can not filtering events

I am trying to create a subscription to events with filter as follows:

camera.events.createPullPointSubscription(
            '<wsnt:TopicExpression Dialect="http://www.onvif.org/ver10/tev/topicExpression/ConcreteSet">tns1:RuleEngine/CellMotionDetector//.</wsnt:TopicExpression>',
        ).then((response) => {
            console.log(response)
        }).catch(error => {
            console.error(error)
        })

But the validator of the createPullPointSubscription method in modules/events.js file does not allow XML in the string, because in the line number 176 it requires to be a "clean string" (without < and > characters). Getting error:

Error: The "filter" argument for createPullPointSubscription is invalid:  Invalid characters were found in the value ("<", ">")

It seems to me that it is not consistent with the ONVIF 16.12 standard and WS-BaseNotification. See here page 117/118: https://www.onvif.org/specs/core/ONVIF-Core-Specification-v1612.pdf

With my IP Camera using the below SOAP message I can create a subscription:

<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope
 xmlns:SOAP-ENV="http://www.w3.org/2003/05/soap-envelope"
 xmlns:wsa="http://www.w3.org/2005/08/addressing"
 xmlns:wsnt="http://docs.oasis-open.org/wsn/b-2"
 xmlns:tet="http://www.onvif.org/ver10/events/wsdl"
 xmlns:tns1="http://www.onvif.org/ver10/topics">
 <SOAP-ENV:Header>
 <wsa:Action>http://www.onvif.org/ver10/events/wsdl/EventPortType/CreatePullPointSubscriptionRequest</wsa:Action>
 </SOAP-ENV:Header>
 <SOAP-ENV:Body>
 <tet:CreatePullPointSubscription>
 	<tet:Filter>
 		<wsnt:TopicExpression Dialect="http://www.onvif.org/ver10/tev/topicExpression/ConcreteSet">tns1:RuleEngine/CellMotionDetector//.</wsnt:TopicExpression>
 	</tet:Filter>
 <tet:InitialTerminationTime>PT1H</tet:InitialTerminationTime>
 </tet:CreatePullPointSubscription>
 </SOAP-ENV:Body>
</SOAP-ENV:Envelope> 

Should it be changed to allow XML values?

An in-range update of eslint-plugin-jest is breaking the build 🚨

The devDependency eslint-plugin-jest was updated from 22.5.1 to 22.6.0.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

eslint-plugin-jest is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • ❌ ci/circleci: Your tests failed on CircleCI (Details).

Release Notes for v22.6.0

22.6.0 (2019-05-22)

Features

Commits

The new version differs by 9 commits.

  • 14d83ef feat(rules): add no-commented-out rule (#262)
  • 83ff198 chore: migrate no-jest-import to typescript (#259)
  • 718c08c chore: upgrade @typescript-eslint
  • ca2aa27 chore: port lowercase-name to TypeScript (#258)
  • 3df0058 chore(ci): run danger with lts version of node
  • 48e3a59 chore: precompile with babel (#257)
  • 8670804 chore: bump deps
  • 05eb11a chore: fix lint error
  • dff6446 docs: link to eslint-plugin-jest-formatting

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

An in-range update of eslint-plugin-jest is breaking the build 🚨

The devDependency eslint-plugin-jest was updated from 22.6.0 to 22.6.1.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

eslint-plugin-jest is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • ❌ ci/circleci: Your tests failed on CircleCI (Details).

Release Notes for v22.6.1

22.6.1 (2019-05-22)

Bug Fixes

Commits

The new version differs by 1 commits.

  • 9a7d7f0 fix(install): do not build during postinstall (#265)

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

An in-range update of eslint-plugin-node is breaking the build 🚨

The devDependency eslint-plugin-node was updated from 9.0.1 to 9.1.0.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

eslint-plugin-node is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • ❌ ci/circleci: Your tests failed on CircleCI (Details).

Commits

The new version differs by 3 commits.

  • 7ce77f9 πŸ”– 9.1.0
  • e5aee3c πŸ› support * in engines.node (fixes #155)
  • fd9d19d ✨ no-deprecated-api adheres to targeted node version (fixes #141) (#164)

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

npm install results in "Appears to be a git repo or submodule."

First of all, thank you for the great module. Has been working very well for me so far!

That said, I've run into an annoying issue. When I run npm install for the first time, it installs the module correctly (as per package.json). However, if I run npm install again, I get the following error:

npm ERR! path /home/user/app/node_modules/onvif-nvt
npm ERR! code EISGIT
npm ERR! git /home/user/app/node_modules/onvif-nvt: Appears to be a git repo or submodule.
npm ERR! git     /home/user/app/node_modules/onvif-nvt
npm ERR! git Refusing to remove it. Update manually,
npm ERR! git or move it out of the way first.

If I delete node_modules/onvif-nvt I can run npm install and it will install again correctly.

I've never seen this issue with any other npm modules on any projects (and I use many). Any ideas about this? I am guessing that the repository has a .git file checked in somewhere that shouldn't be there...

Thank you!

Something seems not right

While trying to create automated tests, which reset process state between tests, I found issues connecting to devices. I dug into this code and found this line inside node_modules/onvif-nvt/dist/onvif-nvt.js:

module.exports = new OnvifManager();

Inside the OnvifManager class is a field cameras, which gets a cache of every connected camera, by host name. So, if I want to kill a connection to a camera, there is no way to do it. I can overwrite the connection, but not delete it, reset it,etc.

Also, the .add() method to add discovery is also permanent for the process. No way to properly test code around this manager with and without discovery except by manually breaking the published interface and calling something like:

const OnvifManager = require( 'onvif-nvt' );
OnvifManager.add( 'discovery' );
delete OnvifManager.discovery;
Is that right? Is that the intended code pattern for this library? How would one properly write tests on their code if it is dependent on onvif-nvt since onvif-nvt only supports immutable global state?

Any advice on how to properly interface with onvif-nvt when doing test-driven-development would be awesome!

One other thing, the code is riddled with console.log and console.error lines all over. Its polluting stdout/err. Any plans to make a proper logging facility, or at least be able to disable straight to console logs?

Thank you!

npm install onvif-nvt gives error message

npm install onvif-nvt

npm ERR! registry error parsing json
npm ERR! Linux 5.0.0-35-generic
npm ERR! argv "/usr/bin/node" "/usr/bin/npm" "install" "onvif-nvt"
npm ERR! node v8.10.0
npm ERR! npm  v3.5.2
npm ERR! Unexpected token < in JSON at position 0
npm ERR! <?xml version="1.0" encoding="UTF-8"?>
npm ERR! <Error><Code>NoSuchBucket</Code><Message>The specified bucket does not exist</Message><BucketName>npm-registry-packages</BucketName><RequestId>52CD2CEAF5732FFA</RequestId><HostId>iQIA8jykw28pad4qFw5FkY5Hr/m6nzZMPh3YG0MlTwrs17gXJ2y2ZIGPvAOJ24Vx2tcZujSPQf0=</HostId></Error>
npm ERR! 
npm ERR! If you need help, you may report this error at:
npm ERR!     <https://github.com/npm/npm/issues>
npm ERR! Please include the following file with any support request:
npm ERR!     /home/stiv/IdeaProjects/onviftest/npm-debug.log

how can I fix it?

Profile G - Add "recording" features

Hi,

I've been using onvif-nvt very nicely inside my PTZ webapp.
Now I'm trying to implement the recording functionality. However when i do a Cam.add("recording"): and I'll call for a getRecordings, I get an 'not implemented' message.

I'm not sure though now. I'm wondering if I'm doing something wrong, or that recording is just not implemented yet?

Thanks for your feedback

Bram

Hardcoded parameter values in pullMessages events implementation

It seems to me that there are hardcoded values in modules/events.js

pullMessages(subscriptionId, timeout, messageLimit, callback)

and parameters like timeout and messageLimit are not included in the SOAP message.
Lines: 256 and 254 - values of <tev:Timeout>PT1M</tev:Timeout> and <tev:MessageLimit>99</tev:MessageLimit> are hardcoded. Suppose not to be that way :)

The security token could not be authenticated or authorized

Hello. Im using onvif-nvt.

Client Server: 192.168.1.13 / pm2 background / use only first device variable
ONVIF-NVT Server: 192.168.0.160

It works fine at first, but after some time I get that error.

I do not create and use a new device every time,
Control using the device created first.

I'm having the following problem with internal soap communication:
What could be wrong?

image

Failed to connect to camera

I'm getting the following error while connecting to a camera:

ERROR : onvif: TypeError: profiles.forEach is not a function
ERROR : onvif: at Camera.parseProfiles (/home/pi/.mozilla-iot/addons/onvif-adapter/node_modules/onvif-nvt/lib/camera.js:645:14)
ERROR : onvif: at media.getProfiles.then.results (/home/pi/.mozilla-iot/addons/onvif-adapter/node_modules/onvif-nvt/lib/camera.js:631:34)
ERROR : onvif: at
ERROR : onvif: at process._tickCallback (internal/process/next_tick.js:189:7)
ERROR : onvif: TypeError: profiles.forEach is not a function
ERROR : onvif: at Camera.parseProfiles (/home/pi/.mozilla-iot/addons/onvif-adapter/node_modules/onvif-nvt/lib/camera.js:645:14)
ERROR : onvif: at media.getProfiles.then.results (/home/pi/.mozilla-iot/addons/onvif-adapter/node_modules/onvif-nvt/lib/camera.js:631:34)
ERROR : onvif: at
ERROR : onvif: at process._tickCallback (internal/process/next_tick.js:189:7)

As sou can see from the log I'm using the Mozilla IoT Gateway and the camera I'm using is a Raspberry Pi camera made ONVIF compatible using https://github.com/BreeeZe/rpos.

An in-range update of eslint-plugin-jest is breaking the build 🚨

The devDependency eslint-plugin-jest was updated from 22.9.0 to 22.10.0.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

eslint-plugin-jest is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • ❌ ci/circleci: Your tests failed on CircleCI (Details).

Release Notes for v22.10.0

22.10.0 (2019-07-17)

Features

Commits

The new version differs by 7 commits.

  • 28bd1dc feat(rules): adds no-if rule (#293)
  • 7ebdc0e chore: enforce import destructure order
  • 31c7cef chore: convert to import/export (#302)
  • 9f858cb chore: delete tests instead of ignoring them with babel
  • c595ba0 chore: do not include tests in published tarball
  • 4b4eb78 chore: fix lint error in md file
  • d3ea720 chore(docs): fix typo (#304)

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

Event messages:error: SubscribeCreationFailedFault

After PTZ GoTo finished a message should be received by the nodejs script.
A message is received, but an error message:

<?xml version="1.0" encoding="UTF-8"?>
<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope" xmlns:soapenc="http://www.w3.org/2003/05/soap-encoding" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:tt="http://www.onvif.org/ver10/schema" xmlns:tds="http://www.onvif.org/ver10/device/wsdl" xmlns:trt="http://www.onvif.org/ver10/media/wsdl" xmlns:timg="http://www.onvif.org/ver20/imaging/wsdl" xmlns:tev="http://www.onvif.org/ver10/events/wsdl" xmlns:tptz="http://www.onvif.org/ver20/ptz/wsdl" xmlns:tan="http://www.onvif.org/ver20/analytics/wsdl" xmlns:tst="http://www.onvif.org/ver10/storage/wsdl" xmlns:ter="http://www.onvif.org/ver10/error" xmlns:dn="http://www.onvif.org/ver10/network/wsdl" xmlns:tns1="http://www.onvif.org/ver10/topics" xmlns:tmd="http://www.onvif.org/ver10/deviceIO/wsdl" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl" xmlns:wsoap12="http://schemas.xmlsoap.org/wsdl/soap12" xmlns:http="http://schemas.xmlsoap.org/wsdl/http" xmlns:d="http://schemas.xmlsoap.org/ws/2005/04/discovery" xmlns:wsadis="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:wsnt="http://docs.oasis-open.org/wsn/b-2" xmlns:wsa="http://www.w3.org/2005/08/addressing" xmlns:wstop="http://docs.oasis-open.org/wsn/t-1" xmlns:wsrf-bf="http://docs.oasis-open.org/wsrf/bf-2" xmlns:wsntw="http://docs.oasis-open.org/wsn/bw-2" xmlns:wsrf-rw="http://docs.oasis-open.org/wsrf/rw-2" xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl" xmlns:wsrf-r="http://docs.oasis-open.org/wsrf/r-2" xmlns:trc="http://www.onvif.org/ver10/recording/wsdl" xmlns:tse="http://www.onvif.org/ver10/search/wsdl" xmlns:trp="http://www.onvif.org/ver10/replay/wsdl" xmlns:tnshik="http://www.hikvision.com/2011/event/topics" xmlns:hikwsd="http://www.onvifext.com/onvif/ext/ver10/wsdl" xmlns:hikxsd="http://www.onvifext.com/onvif/ext/ver10/schema" xmlns:tas="http://www.onvif.org/ver10/advancedsecurity/wsdl" xmlns:tr2="http://www.onvif.org/ver20/media/wsdl" xmlns:axt="http://www.onvif.org/ver20/analytics"><env:Header><wsa:Action> http://www.w3.org/2005/08/addressing/soap/fault</wsa:Action>
</env:Header>
<env:Body><env:Fault><env:Code><env:Value>env:Receiver</env:Value>
</env:Code>
<env:Reason><env:Text xml:lang="en">wsnt:SubscribeCreationFailedFault</env:Text>
</env:Reason>
<env:Detail><wsnt:SubscribeCreationFailedFault><wsrf-bf:Timestamp>2019-09-20T16:58:52Z</wsrf-bf:Timestamp>
</wsnt:SubscribeCreationFailedFault>
</env:Detail>
</env:Fault>
</env:Body>
</env:Envelope>

Also messages are received, but only of one type:

CreatePullPointSubscription

Does the nodejs script have to pull from a particular URL to retrieve the actual event data?

circle-ci error: node version needs to upgraded from 9.4.0 since jest need minimum node v10.13.0

https://app.circleci.com/pipelines/github/hawkeye64/onvif-nvt/326/workflows/609fc4c4-5e7d-4a26-9a73-1ed2ba4ea6c1/jobs/1070

[email protected] test
jest

/home/circleci/onvif-nvt/node_modules/jest-cli/build/cli/index.js:227
    } catch {
            ^

SyntaxError: Unexpected token {
    at new Script (vm.js:51:7)
    at createScript (vm.js:138:10)
    at Object.runInThisContext (vm.js:199:10)
    at Module._compile (module.js:624:28)
    at Object.Module._extensions..js (module.js:671:10)
    at Module.load (module.js:573:32)
    at tryModuleLoad (module.js:513:12)
    at Function.Module._load (module.js:505:3)
    at Module.require (module.js:604:17)
    at require (internal/module.js:11:18)

Exited with code exit status 1

CircleCI received exit code 1

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.