apexad / homebridge-eufy-robovac

Homebridge plugin for Eufy RoboVac
MIT License
49 stars 18 forks source link

UnhandledPromiseRejectionWarning / No Response #3

Closed raulfunkie closed 4 years ago

raulfunkie commented 4 years ago

Getting this error while running homebridge in debug mode to see what's making it not recognize the Robovac as a device. The "devices" show on Home App (Switch to Find and Fan for Vacuum) but they're always on a "No Response" status.

Error

TuyAPI Connecting to 192.168.6.248... +2ms
[8/10/2019, 7:38:40 AM] [LGtv] webOS - TV state: On
(node:1988) UnhandledPromiseRejectionWarning: Error: connection timed out
    at Socket.<anonymous> (/usr/lib/node_modules/homebridge-eufy-robovac/dist/index.js:1:23283)
    at Object.onceWrapper (events.js:291:20)
    at Socket.emit (events.js:203:13)
    at Socket._onTimeout (net.js:434:8)
    at listOnTimeout (internal/timers.js:531:17)
    at processTimers (internal/timers.js:475:7)
(node:1988) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 2)
  TuyAPI Socket closed: 192.168.6.248 +5s
Disconnected!
(node:1988) UnhandledPromiseRejectionWarning: Error: connection timed out
    at Socket.<anonymous> (/usr/lib/node_modules/homebridge-eufy-robovac/dist/index.js:1:23283)
    at Object.onceWrapper (events.js:291:20)
    at Socket.emit (events.js:203:13)
    at Socket._onTimeout (net.js:434:8)
    at listOnTimeout (internal/timers.js:531:17)
    at processTimers (internal/timers.js:475:7)
(node:1988) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 3)

Config File

    {
      "accessory": "Eufy RoboVac",
      "name": "Robotina",
      "ip": "192.168.6.248",
      "deviceId": "60608308ecfabc982fba",
      "localKey": "b32c7a55c9f1f301"
    }

I've set a reservation for the vacuum on my router to have this specific IP and I got the keys using the guide provided by mitchellrj using adb and logcat.

Any ideas on what could be happening?

raulfunkie commented 4 years ago

Update 1

I found that I made a mistake using the wrong IP address (it should've been 192.168.7.248 not '6').

I updated that on my config.json:

    {
      "accessory": "Eufy RoboVac",
      "name": "Robotina",
      "ip": "192.168.7.248",
      "deviceId": "60608308ecfabc982fba",
      "localKey": "b32c7a55c9f1f301"
    }

and I'm now getting this error:

  TuyAPI Socket connected. +84ms
Connected!
  TuyAPI GET Payload: +1ms
  TuyAPI { gwId: '60608308ecfabc982fba', devId: '60608308ecfabc982fba' } +1ms
  TuyAPI Error event from socket. 192.168.7.248 Error: read ECONNRESET
    at TCP.onStreamRead (internal/stream_base_commons.js:183:27) {
  errno: 'ECONNRESET',
  code: 'ECONNRESET',
  syscall: 'read'
} +3ms
{}
  TuyAPI Socket closed: 192.168.7.248 +2ms
Disconnected!
  TuyAPI Socket closed: 192.168.7.248 +0ms
Disconnected!
  TuyAPI Socket connected. +1s
Connected!
  TuyAPI GET Payload: +1ms
  TuyAPI { gwId: '60608308ecfabc982fba', devId: '60608308ecfabc982fba' } +0ms
  TuyAPI Error event from socket. 192.168.7.248 Error: read ECONNRESET
    at TCP.onStreamRead (internal/stream_base_commons.js:183:27) {
  errno: 'ECONNRESET',
  code: 'ECONNRESET',
  syscall: 'read'
} +4ms
{}
  TuyAPI Socket closed: 192.168.7.248 +2ms
Disconnected!
jeromeof commented 4 years ago

I am also getting this exception:

homebridge_1 | (node:408) UnhandledPromiseRejectionWarning: Error: find() timed out. Is the device powered on and the ID or IP correct? homebridge_1 | at s (/homebridge/node_modules/homebridge-eufy-robovac/dist/index.js:1:25846) homebridge_1 | at Timeout.setTimeout [as _onTimeout] (/homebridge/node_modules/homebridge-eufy-robovac/dist/index.js:1:26478) homebridge_1 | at ontimeout (timers.js:436:11) homebridge_1 | at tryOnTimeout (timers.js:300:5) homebridge_1 | at listOnTimeout (timers.js:263:5) homebridge_1 | at Timer.processTimers (timers.js:223:10) homebridge_1 | (node:408) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1) homebridge_1 | (node:408) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

But I have both the correct IP address and the localKey values (from the JSON captured payload). My RoboVac is 30c and I believe I have the latest firmware. 1.1.3 Wifi and 1.1.4 MCU according to the RoboVac app.

I also tried eufy-robovac project demo and unfortunately it does not work. So is this code still working for people with the latest Eufy firmware updates?

jeromeof commented 4 years ago

OK, it looks like there was a update which broken this code but the python based eufy_robovac project seems to have fix it in this branch

https://github.com/mitchellrj/eufy_robovac/tree/tuya_3_3

There demo code here works with my Robovac 30c

crazywako commented 4 years ago

@jeromeof

OK, it looks like there was a update which broken this code but the python based eufy_robovac project seems to have fix it in this branch

https://github.com/mitchellrj/eufy_robovac/tree/tuya_3_3

There demo code here works with my Robovac 30c

Did you get this working on Homebridge? Cause I couldn't get it working and I have the same exact error ( Error: find() timed out. Is the device powered on and the ID or IP correct?)

EDIT: found a solution. I did build eufy-robovac myself and moved it to _homebridge-eufy-robovac/nodemodules/eufy-robovac.

If someone has the same problem you can replace homebridge-eufy-robovac/dist/index.js with this: https://pastebin.com/evYiCzqb

raulfunkie commented 4 years ago

@crazywako would you mind sharing your whole homebridge-eufy-robovac folder? I can't get it to work. I replaced the file mentioned above but still no dice on the Home app. :(

apexad commented 4 years ago

@crazywako Mind doing a pull request or sharing your changes to either https://github.com/joshstrange/homebridge-eufy-robovac or https://github.com/joshstrange/eufy-robovac so that we can get this working without having to use a transpired index.js?