kopiro / homebridge-tapo-camera

Homebridge plugin for TP-Link TAPO security cameras
ISC License
127 stars 11 forks source link

Not Resolved - ECONNRESET with Tapo C200 #105

Closed psycoticninja closed 1 month ago

psycoticninja commented 9 months ago

The original bug case was closed and had no response after mentioning it was still an issue - this is still an issue, even on the latest version of the plugin.

Describe The Bug:

I have two Tapo C200's: One is running Version 1.3.9 Build 231019 Rel.38052n(4555) - HW 2.0 The other is running Version 1.3.9 Build 231019 Rel.37378n(4555) - HW 1.0

Since upgrading both to 1.3.9 XXXX the one with HW 2.0 no longer connects to Homebridge, reporting the following error in the logs: [22/11/2023, 08:14:42] [homebridge-tapo-camera] Error during setup of camera Rat Cam read ECONNRESET

The camera appears to be working fine via RTSP - it is also streaming to Shinobi and have no issues there.

I have tried to remove the single camera accessory from Homebridge settings, renamed the camera in the plugin configuration as well but still same error.

To Reproduce:

Not sure how to reproduce this.

Expected behavior:

Camera should just work.

Logs:

[22/11/2023, 08:14:42] [homebridge-tapo-camera] Error during setup of camera Rat Cam read ECONNRESET

Environment:

Plugin Version: 2.3.4 Homebridge Version: 1.7.0 Node.js Version: 20.10.0 NPM Version: 10.2.3 Operating System: Debian GNU/Linux Bullseye (11) - Raspbian Lite

mynameisbrendan commented 9 months ago

I have two of these C200 HW v1.0 and both have 1.3.9a and both are displaying this behaviour.

[tapo-camera] Error during setup of camera Garage read ECONNRESET

x23piracy commented 9 months ago

I also have a C200 HW v3.0 i am still on 1.3.5 and glad i read this before i updated, i always disable auto updates so it didn't updated on its own, i also had the camera blocked from internet access which i removed (and then realized there is fw 1.3.9) because my alexa integration wasn't working until i allowed internet access to the camera (alexa and tapo doesn't seem to establish a direct lan connection).

I will wait with the fw update.

energiumOn commented 9 months ago

I did have the same issue when I upgraded to V3.0. My C200 is rendered unusable due to this update. I had to downgrade to 1.3.5 to use the plugin. @kopiro, adding support for newer devices should not be on behalf of the older ones 😌

mynameisbrendan commented 9 months ago

I did have the same issue when I upgraded to V3.0. My C200 is rendered unusable due to this update. I had to downgrade to 1.3.5 to use the plugin. @kopiro, adding support for newer devices should not be on behalf of the older ones 😌

How did you downgrade your camera firmware?

x23piracy commented 9 months ago

Hi,

i expect he used one found on the net or he contacted tapo, tapo has all it's old fw versions online also for the hw revision but you don't get the direct link without sniffing the packets.

https://github.com/DrmnSamoLiu/Tapo_Camera_Firmware/issues/10 Seems to be a repository where they collect the fw in issues :D

https://github.com/nervous-inhuman/tplink-tapo-c200-re/issues/4#issuecomment-1030056785

To grab specific fw watch in the list and add the url part:

http://download.tplinkcloud.com/[URLPART]

https://github.com/tapo-firmware/Directory/blob/main/all_keys.txt

grafik

Turn off auto updates, and forbit access to internet for the camera (no internet access forbids alexa functionality, hsv will still work) but you keep your cam away from accidentally fw updates.

Good luck

mynameisbrendan commented 9 months ago

Thanks, I might review some alternate HB plugins first to confirm this path is necessary

x23piracy commented 9 months ago

I have mine currently under Scrypted (which works really fine) but i like this plugin and watch for it's progress. I have a Qnap NAS where you can easily install Docker Container for tests.

kopiro commented 9 months ago

Hey folks, the plugin should still work with older firmware. What's the error you're getting specifically?

psycoticninja commented 9 months ago

@kopiro I’d prefer to not downgrade my cameras and hope that this can be resolved with an update to the Homebridge plugin.

I’m still getting the same error, similar to the below when restarting the plugin/child bridge for one of my cameras: [22/11/2023, 08:14:42] [homebridge-tapo-camera] Error during setup of camera Rat Cam read ECONNRESET

Any chance you could check this out?

psycoticninja commented 8 months ago

Any update to this one @kopiro ?

energiumOn commented 7 months ago

Hey man @kopiro, we are still suffering from the same issue long since now. Should we move on to another plugin? Our C200 is no longer working with the plugin. We know that you're busy and do not have spare time for the project, thus this is vital for users of C200. The plugin started first due to this camera C200. Thank you :)

kopiro commented 7 months ago

On January 3rd, I asked:

Hey folks, the plugin should still work with older firmware. What's the error you're getting specifically?

Without any more informations, I can't help. When working on the update to support for HW2, I made sure that old firmware was still compatible, but apparently it's not; but now I need all errors you can give me in order to debug the issue (because I have upgraded the firmware on mine).

Specifically, activate debugs logs and send me all the logs you can.

psycoticninja commented 7 months ago

On January 3rd, I asked:

Hey folks, the plugin should still work with older firmware. What's the error you're getting specifically?

Without any more informations, I can't help. When working on the update to support for HW2, I made sure that old firmware was still compatible, but apparently it's not; but now I need all errors you can give me in order to debug the issue (because I have upgraded the firmware on mine).

Specifically, activate debugs logs and send me all the logs you can.

@kopiro, On January 3 I responded as well (and followed up on January 15).

I have activated debug in the Homebridge plugin for the camera that is not displayed. All I can see in the logs is as below:

[19/02/2024, 06:57:09] [homebridge-tapo-camera] Error during setup of camera Cat Cam Living read ECONNRESET
kopiro commented 7 months ago

I'm not sure I can do much with these logs though, can you try to switch the branch locally and try this? https://github.com/kopiro/homebridge-tapo-camera/pull/121

Let me know if you need support on how to do this.

psycoticninja commented 7 months ago

I'm not sure I can do much with these logs though, can you try to switch the branch locally and try this? #121

Let me know if you need support on how to do this.

@kopiro , happy to test but I will need some help with installing this. Can I just replace the changed file on its own?

If not, could you please share the steps.

kopiro commented 7 months ago

Sure; go to the Homebridge terminal (or via SSH and login with homebridge user)

cd /var/lib/homebridge/node_modules
rm -rf homebridge-tapo-camera
git clone https://github.com/kopiro/homebridge-tapo-camera.git
cd homebridge-tapo-camera
git checkout beta
npm install
npm run build
psycoticninja commented 7 months ago

@kopiro I followed the steps but the child bridge will not start, it is boot looping with the below error:

Error: Cannot find module '/var/lib/homebridge/node_modules/homebridge-tapo-camera/dist/index.js'
Require stack:
- /var/lib/homebridge/node_modules/homebridge/lib/plugin.js
- /var/lib/homebridge/node_modules/homebridge/lib/pluginManager.js
- /var/lib/homebridge/node_modules/homebridge/lib/api.js
- /var/lib/homebridge/node_modules/homebridge/lib/childBridgeFork.js
    at Function.Module._resolveFilename (node:internal/modules/cjs/loader:1144:15)
    at Function.Module._load (node:internal/modules/cjs/loader:985:27)
    at Module.require (node:internal/modules/cjs/loader:1235:19)
    at require (node:internal/modules/helpers:176:18)
    at Plugin.load (/var/lib/homebridge/node_modules/homebridge/src/plugin.ts:227:93)
    at ChildBridgeFork.loadPlugin (/var/lib/homebridge/node_modules/homebridge/src/childBridgeFork.ts:105:23)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)

I've rolled back.

kopiro commented 6 months ago

You're right. Try npm run build

psycoticninja commented 6 months ago

@kopiro apologies, only got around to this now. I've tried this now as above, restarted the child bridge but still see the below:

[28/03/2024, 08:33:01] [homebridge-tapo-camera] Error during setup of camera Cat Cam Living read ECONNRESET

Anything else worth trying?

mynameisbrendan commented 4 months ago

Any update on this? I have two C200 cameras which are now dead in HB so I am keen to assist if I can. I could not find any method for FW downgrade, unfortunately.

psycoticninja commented 2 months ago

@kopiro Hi, any update with this? I have updated to 2.4.0 and the issue is still present.

[03/08/2024, 11:34:30] [Cat Cam Living] Error during setup of camera Cat Cam Living read ECONNRESET
psycoticninja commented 1 month ago

@kopiro I see that v2.4.4 of the plugin has added more debug, if this helps.

I worry that this bug report may become stale and I would rather not have to open a new one.

[12/08/2024, 13:57:56] [Cat Cam Living] Error during setup of camera Cat Cam Living Error: read ECONNRESET
    at TCP.onStreamRead (node:internal/stream_base_commons:218:20) {
  errno: -104,
  code: 'ECONNRESET',
  syscall: 'read'
}
kopiro commented 1 month ago

Hey, please update to https://github.com/kopiro/homebridge-tapo-camera/releases/tag/v2.4.5 where I added more debug logs and post your logs again.

psycoticninja commented 1 month ago

@kopiro I've updated to 2.4.5 now, this is what I see in the debugs (redacted username, passwords and IP addresses):

[27/08/2024, 19:49:37] [Cat Cam Living] Error during setup of camera {
  name: 'Cat Cam Living',
  ipAddress: 'XXX.XXX.XXX.XXX',
  password: 'XXXXXXX',
  streamUser: 'XXXXXX',
  streamPassword: 'XXXXXXX',
  debug: true
} Error: read ECONNRESET
    at TCP.onStreamRead (node:internal/stream_base_commons:218:20) {
  errno: -104,
  code: 'ECONNRESET',
  syscall: 'read'
}

Hope this helps!

kopiro commented 1 month ago

Hey @psycoticninja , do you have Discord or Telegram so we can debug this issue together? I have 1h free now I can help and maybe we'll find the root of the issues

kopiro commented 1 month ago

You can maybe find me on Discord as @kopiro

psycoticninja commented 1 month ago

Done - discord friend invite sent.

kopiro commented 1 month ago

I'm sorry, apparently is kopiro91

kopiro commented 1 month ago

Alright, we have identified @psycoticninja issue, but I think this may not cover other issues.

But, for now, this was the solution https://github.com/kopiro/homebridge-tapo-camera/pull/160 and I've released a new version https://github.com/kopiro/homebridge-tapo-camera/releases/tag/v2.4.7