RaresAil / homebridge-tp-link-tapo

A platform to implement the tp-link tapo device and Adaptive Lighting for light bulbs
https://www.npmjs.com/package/homebridge-tp-link-tapo
Apache License 2.0
64 stars 5 forks source link

RV10-lite robot vacuum creates error in Plugin on startup #35

Closed oilcan-productions closed 1 year ago

oilcan-productions commented 1 year ago

Describe The Bug

I just got a TAPO RV10-lite vacuum and after adding the plugin and configuring the IP address the following error is thrown in the homebridge log:

 Failed to get info about: xxx.xxx.xxx.xxx | The first argument must be of type string or an instance of Buffer, ArrayBuffer, or Array or an Array-like Object. Received undefined

Expected behavior

The plugin to connect to the device and retrieve the information

Logs

[3/30/2023, 11:09:07 AM] Loaded plugin: homebridge-tp-link-tapo@3.2.2
[3/30/2023, 11:09:07 AM] Registering platform 'homebridge-tp-link-tapo.HomebridgeTPLinkTapo'
[3/30/2023, 11:09:07 AM] ---
...
[3/30/2023, 11:09:07 AM] [Tapo] Initializing HomebridgeTPLinkTapo platform...
[3/30/2023, 11:09:07 AM] [Tapo] Initializing child bridge AA;AA:AA;AA
...
[3/30/2023, 11:09:08 AM] [Tapo] Error sending command: deviceInfo AxiosError: connect ECONNREFUSED xxx.xxx.xxx.xxx:80
    at Function.AxiosError.from (/usr/local/lib/node_modules/homebridge-tp-link-tapo/node_modules/axios/lib/core/AxiosError.js:89:14)
    at RedirectableRequest.handleRequestError (/usr/local/lib/node_modules/homebridge-tp-link-tapo/node_modules/axios/lib/adapters/http.js:577:25)
    at RedirectableRequest.emit (node:events:513:28)
    at ClientRequest.eventHandlers.<computed> (/usr/local/lib/node_modules/homebridge-tp-link-tapo/node_modules/follow-redirects/index.js:14:24)
    at ClientRequest.emit (node:events:513:28)
    at Socket.socketErrorListener (node:_http_client:502:9)
    at Socket.emit (node:events:513:28)
    at emitErrorNT (node:internal/streams/destroy:151:8)
    at emitErrorCloseNT (node:internal/streams/destroy:116:3)
    at processTicksAndRejections (node:internal/process/task_queues:82:21) {
  port: 80,
  address: 'xxx.xxx.xxx.xxx',
  syscall: 'connect',
  code: 'ECONNREFUSED',
  errno: -61,
  config: {
    transitional: {
      silentJSONParsing: true,
      forcedJSONParsing: true,
      clarifyTimeoutError: false
    },
    adapter: [ 'xhr', 'http' ],
    transformRequest: [ [Function: transformRequest] ],
    transformResponse: [ [Function: transformResponse] ],
    timeout: 0,
    xsrfCookieName: 'XSRF-TOKEN',
    xsrfHeaderName: 'X-XSRF-TOKEN',
    maxContentLength: -1,
    maxBodyLength: -1,
    env: { FormData: [Function], Blob: [class Blob] },
    validateStatus: [Function: validateStatus],
    headers: AxiosHeaders {
      Accept: 'application/json, text/plain, */*',
      'Content-Type': 'application/json',
      'User-Agent': 'axios/1.3.4',
      'Content-Length': '352',
      'Accept-Encoding': 'gzip, compress, deflate, br'
    },
    method: 'post',
    url: 'http://xxx.xxx.xxx.xxx/app',
    data: '{"method":"handshake","params":{"key":"-----BEGIN PUBLIC KEY-----\\nMIGfM.....\\n-----END PUBLIC KEY-----\\n"},"requestTimeMils":1680199748319}'
  },
  request: <ref *1> Writable {
    _writableState: WritableState {
      objectMode: false,
      highWaterMark: 16384,
      finalCalled: false,
      needDrain: false,
      ending: false,
      ended: false,
      finished: false,
      destroyed: false,
      decodeStrings: true,
      defaultEncoding: 'utf8',
      length: 0,
      writing: false,
      corked: 0,
      sync: true,
      bufferProcessing: false,
      onwrite: [Function: bound onwrite],
      writecb: null,
      writelen: 0,
      afterWriteTickInfo: null,
      buffered: [],
      bufferedIndex: 0,
      allBuffers: true,
      allNoop: true,
      pendingcb: 0,
      constructed: true,
      prefinished: false,
      errorEmitted: false,
      emitClose: true,
      autoDestroy: true,
      errored: null,
      closed: false,
      closeEmitted: false,
      [Symbol(kOnFinished)]: []
    },
    _events: [Object: null prototype] {
      response: [Function: handleResponse],
      error: [Function: handleRequestError],
      socket: [Function: handleRequestSocket]
    },
    _eventsCount: 3,
    _maxListeners: undefined,
    _options: {
      maxRedirects: 21,
      maxBodyLength: Infinity,
      protocol: 'http:',
      path: '/app',
      method: 'POST',
      headers: [Object: null prototype],
      agents: [Object],
      auth: undefined,
      beforeRedirect: [Function: dispatchBeforeRedirect],
      beforeRedirects: [Object],
      hostname: 'xxx.xxx.xxx.xxx',
      port: '',
      agent: undefined,
      nativeProtocols: [Object],
      pathname: '/app'
    },
    _ended: false,
    _ending: true,
    _redirectCount: 0,
    _redirects: [],
    _requestBodyLength: 352,
    _requestBodyBuffers: [ [Object] ],
    _onNativeResponse: [Function (anonymous)],
    _currentRequest: ClientRequest {
      _events: [Object: null prototype],
      _eventsCount: 7,
      _maxListeners: undefined,
      outputData: [],
      outputSize: 0,
      writable: true,
      destroyed: false,
      _last: true,
      chunkedEncoding: false,
      shouldKeepAlive: false,
      maxRequestsOnConnectionReached: false,
      _defaultKeepAlive: true,
      useChunkedEncodingByDefault: true,
      sendDate: false,
      _removedConnection: false,
      _removedContLen: false,
      _removedTE: false,
      strictContentLength: false,
      _contentLength: '352',
      _hasBody: true,
      _trailer: '',
      finished: false,
      _headerSent: true,
      _closed: false,
      socket: [Socket],
      _header: 'POST /app HTTP/1.1\r\n' +
        'Accept: application/json, text/plain, */*\r\n' +
        'Content-Type: application/json\r\n' +
        'User-Agent: axios/1.3.4\r\n' +
        'Content-Length: 352\r\n' +
        'Accept-Encoding: gzip, compress, deflate, br\r\n' +
        'Host: 192.168.0.3\r\n' +
        'Connection: close\r\n' +
        '\r\n',
      _keepAliveTimeout: 0,
      _onPendingData: [Function: nop],
      agent: [Agent],
      socketPath: undefined,
      method: 'POST',
      maxHeaderSize: undefined,
      insecureHTTPParser: undefined,
      joinDuplicateHeaders: undefined,
      path: '/app',
      _ended: false,
      res: null,
      aborted: false,
      timeoutCb: null,
      upgradeOrConnect: false,
      parser: null,
      maxHeadersCount: null,
      reusedSocket: false,
      host: 'xxx.xxx.xxx.xxx',
      protocol: 'http:',
      _redirectable: [Circular *1],
      [Symbol(kCapture)]: false,
      [Symbol(kBytesWritten)]: 0,
      [Symbol(kEndCalled)]: false,
      [Symbol(kNeedDrain)]: false,
      [Symbol(corked)]: 0,
      [Symbol(kOutHeaders)]: [Object: null prototype],
      [Symbol(errored)]: null,
      [Symbol(kUniqueHeaders)]: null
    },
    _currentUrl: 'http://xxx.xxx.xxx.xxx/app',
    [Symbol(kCapture)]: false
  },
  cause: Error: connect ECONNREFUSED xxx.xxx.xxx.xxx:80
      at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1494:16) {
    errno: -61,
    code: 'ECONNREFUSED',
    syscall: 'connect',
    address: 'xxx.xxx.xxx.xxx',
    port: 80
  }
}
[3/30/2023, 11:09:08 AM] [Tapo] Failed to get info about: xxx.xxx.xxx.xxx | The first argument must be of type string or an instance of Buffer, ArrayBuffer, or Array or an Array-like Object. Received undefined
[3/30/2023, 11:09:08 AM] [Tapo] Retry to connect in 10s : xxx.xxx.xxx.xxx

Plugin Config

 {
            "addresses": [
                "xxx.xxx.xxx.xxx"
            ],
            "name": "Tapo",
            "email": "mxxxxxxxxxx@xxxx.com",
            "password": "****************",
            "platform": "HomebridgeTPLinkTapo",
            "_bridge": {
                "username": "AA;AA;AA;AA",
                "port": 33747
            }
        }

Plugin Version

homebridge-tp-link-tapo v3.2.2

Homebridge Version

Homebridge v1.6.0

Node.js Version

Node v18.15.0

NPM Version

9.5.0

Operating System

MacOS Ventura

RaresAil commented 1 year ago

Only supported devices are Lights and Outlets

DaveGut commented 10 months ago

Some data. I have successfully integrated the robovac (RV10) into HUBITAT ENVIRONMENT. Does not help here except I developed protocol and command data as part of my errort. Location: https://github.com/DaveGut/TAPO-Robovac-Dev