HomeAssistant-Tapo-Control icon indicating copy to clipboard operation
HomeAssistant-Tapo-Control copied to clipboard

Unable to connect to Tapo: Cameras Control controller: Invalid authentication data

Open rikman122 opened this issue 1 year ago • 1 comments

Description

Hi,

I'm recently getting this error in logs:

Unable to connect to Tapo: Cameras Control controller: Invalid authentication data

My camera is a Tapo C200 that was working until a couple of days. Nothing has changed in my Tapo configuration (in HA and the official Tapo App).

I tried to reinstall the integration, downgrade to another version, reset the camera and fresh setup everything from the Tapo App but the error persists.

Something interesting is that the RTSP stream is working with the same credentials using VLC / WebRTC integration so I'm sure that the user/pass is correct. When I deleted the integration and reinstalled it I'm getting 'Unknown error' after setting credentials in the UI, then eventually I can pass to the next prompt with the final settings and there I get another 'Unknown error'. After several tries I can get the integration to connect to the camera and it works unitl I restart HA. Then the integration takes 180 seconds to start and finally fails connection giving this error:

` Logger: custom_components.tapo_control Source: custom_components/tapo_control/init.py:307 Integration: Tapo: Cameras Control (documentation, issues) First occurred: 11:54:03 (1 occurrences) Last logged: 11:54:03

Unable to connect to Tapo: Cameras Control controller: Invalid authentication data `

I can connect to the camera using the oficial App without any problem. Checked IP, ports, credentials ....

Reproduction Steps

  1. Add the integration using the UI
  2. Set the credentials
  3. Get 'Unknown error'
  4. Retry unitl it gets you to the final settings screen
  5. Configure with default settings and click 'Sent'
  6. Get another 'Unknown error' and retry again unitl configuration success
  7. Everything works until you need to reconnect to the camera (eg. HA restarts, camera restart, lost wifi...)

Expected behavior

Camera authentication works as expected even when reconnection happens

If applicable, add error logs.

Logger: custom_components.tapo_control Source: custom_components/tapo_control/init.py:307 Integration: Tapo: Cameras Control (documentation, issues) First occurred: 11:54:03 (1 occurrences) Last logged: 11:54:03

Unable to connect to Tapo: Cameras Control controller: Invalid authentication data

Device Firmware

1.1.16 Build 211209 Rel.37726n(4555)

Using stream component

Yes

Does camera work via official integrations?

Yes

Camera has all attributes filled out in developer tools

Yes

HASS Environment

HA OS in Raspberry Pi 4

Search for similar issues

Yes

Additional information

No response

rikman122 avatar Aug 05 '22 10:08 rikman122

If you get unknown error it logs an error in error log, please provide this.

JurajNyiri avatar Aug 12 '22 14:08 JurajNyiri

Hi,

The only error I get in the logs is the one I mentioned above:

Logger: custom_components.tapo_control Source: custom_components/tapo_control/init.py:307 Integration: Tapo: Cameras Control (documentation, issues) First occurred: 11:54:03 (1 occurrences) Last logged: 11:54:03

Unable to connect to Tapo: Cameras Control controller: Invalid authentication data

This error appears every time I restart Home Assistant. It takes 3 minitues loading the integration and then it fails with this error. After that, all the services from the camera doesn't work but I can get RTSP streaming with WebRTC integration. After 10 minutes or so (I guess, HA retrying in the background) it eventually connects to the camera and everything works as expected

rikman122 avatar Aug 16 '22 19:08 rikman122

Exactly same problem for me.

antstyl avatar Aug 17 '22 10:08 antstyl

Not a integration issue. Make sure you are not overloading the camera, make sure you have all ports opened and set up network properly and finally restart everything.

JurajNyiri avatar Aug 19 '22 08:08 JurajNyiri

Found the problem (at least to my case).

If I have enabled "Tapo Care" to the camera then it doesn't show live feed in home assistant (however camera is controlled i.e. turn on off).

Just disabled Tapo Care on this camera and enabled on another one and this worked and the other became unavailable.

Any idea why and how to be fixed?

antstyl avatar Aug 20 '22 06:08 antstyl

Screenshot_20220820-110345

JurajNyiri avatar Aug 20 '22 09:08 JurajNyiri

Many thanks. Had read it in the past but was not rembering same.

antstyl avatar Aug 20 '22 10:08 antstyl

Also that isn't related with the issue I posted.... I'm not running Tapo Care nor SD card recording. Just one camera connected to home assistant via this integration and RTSP via WebRTC integration so I think there isn't overloads but I'll try to figure it out myself then...

Edit: Also tried using only this integration (without WebRTC integration installed)

rikman122 avatar Aug 20 '22 14:08 rikman122

Figured it out. Turning off stream from HA solved the problem. Hope this can be helpful.

Thanks

rikman122 avatar Aug 20 '22 16:08 rikman122

Figured it out. Turning off stream from HA solved the problem. Hope this can be helpful.

Thanks

How to solve it?

z59492085 avatar Jul 10 '23 06:07 z59492085