homebridge-tapo-camera icon indicating copy to clipboard operation
homebridge-tapo-camera copied to clipboard

Not Resolved - ECONNRESET with Tapo C200

Open psycoticninja opened this issue 1 year ago ā€¢ 20 comments

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

psycoticninja avatar Dec 11 '23 06:12 psycoticninja

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

mynameisbrendan avatar Dec 12 '23 05:12 mynameisbrendan

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.

x23piracy avatar Dec 12 '23 09:12 x23piracy

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 šŸ˜Œ

energiumOn avatar Dec 12 '23 17:12 energiumOn

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?

mynameisbrendan avatar Dec 13 '23 00:12 mynameisbrendan

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

x23piracy avatar Dec 13 '23 13:12 x23piracy

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

mynameisbrendan avatar Dec 13 '23 20:12 mynameisbrendan

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.

x23piracy avatar Dec 20 '23 22:12 x23piracy

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

kopiro avatar Jan 03 '24 10:01 kopiro

@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 avatar Jan 03 '24 10:01 psycoticninja

Any update to this one @kopiro ?

psycoticninja avatar Jan 15 '24 06:01 psycoticninja

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 :)

energiumOn avatar Feb 18 '24 11:02 energiumOn

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 avatar Feb 18 '24 20:02 kopiro

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

psycoticninja avatar Feb 18 '24 21:02 psycoticninja

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.

kopiro avatar Feb 22 '24 18:02 kopiro

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.

psycoticninja avatar Feb 23 '24 21:02 psycoticninja

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

kopiro avatar Mar 05 '24 18:03 kopiro

@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.

psycoticninja avatar Mar 05 '24 22:03 psycoticninja

You're right. Try npm run build

kopiro avatar Mar 16 '24 17:03 kopiro

@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?

psycoticninja avatar Mar 27 '24 22:03 psycoticninja

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.

mynameisbrendan avatar May 24 '24 01:05 mynameisbrendan

@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 avatar Aug 03 '24 01:08 psycoticninja

@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'
}

psycoticninja avatar Aug 12 '24 04:08 psycoticninja

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.

kopiro avatar Aug 27 '24 09:08 kopiro

@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!

psycoticninja avatar Aug 27 '24 09:08 psycoticninja

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 avatar Aug 27 '24 09:08 kopiro

You can maybe find me on Discord as @kopiro

kopiro avatar Aug 27 '24 09:08 kopiro

Done - discord friend invite sent.

psycoticninja avatar Aug 27 '24 09:08 psycoticninja

I'm sorry, apparently is kopiro91

kopiro avatar Aug 27 '24 10:08 kopiro

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

kopiro avatar Aug 27 '24 12:08 kopiro