Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgraded Firmware 1.3.9 on Tapo C200 and get Check tapo tag failed when trying to connect #456

Closed
grunkands opened this issue Nov 13, 2023 · 30 comments
Labels
Fixed Bug has been fixed.

Comments

@grunkands
Copy link

Description

Home Assistant version: 2023.10.2
Tapo Cameras Control: 5.4.4
Camera: Topa C200
Camera Firmware that breaks the config 1.3.9
(I have another camera with FW 1.3.6 that works)

After upgrading fw to 1.3.9 on Tapo C200 it will no longer work. Get errors in the logs.

This error originated from a custom integration.

Logger: custom_components.tapo_control
Source: custom_components/tapo_control/config_flow.py:770
Integration: Tapo: Cameras Control (documentation, issues)
First occurred: 16:57:43 (4 occurrences)
Last logged: 17:02:13

Error: -1, Response: {"result": {"responses": [{"msg": "Check tapo tag failed", "error_code": -1}]}, "error_code": -1}

I even tried to remove one camera from the configuration and add it again with now luck. Get an error message Unknown error

Reproduction Steps

  1. Upgrade camera FW to 1.3.9
  2. Restart
  3. Broken in HA (works in the Tapo app so the cameas are working)

Expected behavior

That camera works and send stream to HA after firmware upgrade.

If applicable, add error logs.

No response

Device Firmware

1.3.9 Build 231019 Rel.38052n(4555)

Integration Version

5.4.4

Using stream component

Yes

Does camera work via official integrations?

Yes

Camera has all attributes filled out in developer tools

Yes

HASS Environment

Home Assistant Core

Search for similar issues

Yes

Additional information

No response

@JurajNyiri
Copy link
Owner

I received the update today and my C200 v3.0 works flawlessly.

I will need access to your camera in order to debug this issue further. Please port forward it and share details via juraj.nyiri@gmail.com.

@grunkands
Copy link
Author

I have version 2.0 if that make any difference.
I understand it would help to get access to my cameras. But I do not feel comfortable with giving you access to them.
I can always downgrade to 1.3.6 that seems to work.

@JurajNyiri
Copy link
Owner

JurajNyiri commented Nov 13, 2023

That is completely understandable. We will need to wait for someone else to come with the same issue then or maybe it starts happening to me as well.
You can try using https://github.com/JurajNyiri/pytapo and see if you can replicate the issue there as well. Use "admin" account together with your cloud password. You can also try using 3rd party account with your 3rd party acc and see if that works, each camera is a little bit different in what it accepts.

@ndrsfr
Copy link

ndrsfr commented Nov 13, 2023

Hi, had the same issue after the firmware update of my C200 to 1.3.9 today.
Was able to solve it by adding my cloud password to the camera config of the integration.

@JurajNyiri
Copy link
Owner

@grunkands does this work for you?

@jdndm
Copy link

jdndm commented Nov 14, 2023

I am also experiencing a similar issue to @grunkands.

Attempting to add a C200 camera to my setup, but getting the error message Unknown Error.

image

Model: C2000 V2.0
Camera FW: 1.3.9
Tapo Cameras Control: 5.4.4

`This error originated from a custom integration.

Logger: custom_components.tapo_control
Source: custom_components/tapo_control/config_flow.py:770
Integration: Tapo: Cameras Control (documentation, issues)
First occurred: 12:12:24 PM (4 occurrences)
Last logged: 1:14:04 PM

Error: -1, Response: {"result": {"responses": [{"msg": "Check tapo tag failed", "error_code": -1}]}, "error_code": -1}`

@grunkands
Copy link
Author

I do not use the cloud service for my cameras. I have even blocked all internet traffic for them. You can call me paranoid if you like. 😅

I can also try to do some more digging on my side to try to understand what is going on.

@bysimba
Copy link

bysimba commented Nov 14, 2023

Hello yesterday i have the same problem so, i remove the tapo component restart Home Assistant, add again the tapo integration and is ok now Tapo C200

@JurajNyiri
Copy link
Owner

JurajNyiri commented Nov 14, 2023

Using cloud service has nothing to do with using the admin account on camera.

As I described above, to move this issue further, try using https://github.com/JurajNyiri/pytapo and see if you can replicate the issue there as well. Use "admin" account together with your cloud password. You can also try using 3rd party account with your 3rd party acc and see if that works, each camera is a little bit different in what it accepts. Post results here.

New "me too" comments providing no new information will be hidden, so please do not post unless you do the above or provide more information that contributes to resolution of the issue.

@kksligh

This comment was marked as off-topic.

@JurajNyiri

This comment was marked as off-topic.

@kksligh

This comment was marked as off-topic.

@Frazou1

This comment was marked as duplicate.

@iwebsource

This comment was marked as duplicate.

@maroliar
Copy link

maroliar commented Nov 14, 2023

print(tapo.getBasicInfo())
{'device_info': {'basic_info': {'device_type': 'SMART.IPCAMERA', 'device_model': 'C200', 'device_name': 'C200 1.0', 'device_info': 'C200 1.0 IPC', 'hw_version': '1.0', 'sw_ve rsion': '1.3.9 Build 231019 Rel.37378n (4555)', 'device_alias': 'Casa', 'avatar': 'Living room', 'longitude': 0, 'latitude': 0, 'has_set_location_info': 0, 'features': 3', 'barcode': 'mac': '5C-A6-E6-75-3A-6A', 'dev_id': '8021B44D704C54509622286B3E2B6D3C1F395945', 'oem_id': '8902D2F34FCE407721DE92F5759839C2', 'hw_desc': '485744455343000
00000000000000001'}}}

@boheme61

This comment was marked as off-topic.

@JurajNyiri
Copy link
Owner

JurajNyiri commented Nov 14, 2023

@maroliar That means it is working. You did not post before, what behaviour are you seeing in HA? And which credentials did you use for the script above? Please document what happens both for "admin" account and 3rd party account as well as what happens in HA for you currently.

@maroliar
Copy link

Hi @JurajNyiri, it's exactly the same behavior of @jdndm said. I tried with my 3rd party account and after I tried with this admin.

With my account:

tapo =
Tapo("192.168.1.18", "marcelo", "xxxxxxxxxxx")
Traceback (most recent call last):
File "", line 1, in
File "/home/marcelo/.local/lib/python3.9/site-packages/pytapo/init.py", line 67, in
self.basicInfo = self.getBasicInfo()
init
File "/home/marcelo/.local/lib/python3.9/site-packages/pytapo/init.py", line 825, in getBasicInfo return self.executeFunction(
File "/home/marcelo/.local/lib/python3.9/site-packages/pytapo/init.py", line 332, in executeFunction data = self.performRequest(
File "/home/marcelo/.local/lib/python3.9/site-packages/pytapo/init.py", line 436, in performRequest return self.performRequest(requestData, loginRetryCount + 1)
File "/home/marcelo/.local/lib/python3.9/site-packages/pytapo/init.py", line 436, in performRequest return self.performRequest(requestData, loginRetryCount + 1)
File "/home/marcelo/.local/lib/python3.9/site-packages/pytapo/init.py", line 438, in performRequest raise Exception(
Exception: Error: -1, Response: {"result": {"responses": [{"msg": "Check tapo tag failed", "error_code": -1}]}, "error_code": -1}

@yiskang
Copy link

yiskang commented Nov 15, 2023

It reports the same error as Marollar does, but switching to admin account with cloud password works.

This one throws exception.

from pytapo import Tapo

user = "cameraAccountUser" # user you set in Advanced Settings -> Camera Account
password = "cameraAccountPass" # password you set in Advanced Settings -> Camera Account
host = "192.168.xx.xx" # ip of the camera, example: 192.168.1.52

tapo = Tapo(host, user, password)

print(tapo.getBasicInfo())

## Exception: Error: -1, Response: {"result": {"responses": [{"msg": "Check tapo tag failed", "error_code": -1}]}, "error_code": -1}

This one works:

from pytapo import Tapo

user = "admin" # user you set in Advanced Settings -> Camera Account
password = "tplinkCloudAccountPass" # password you set in Advanced Settings -> Camera Account
host = "192.168.xx.xx" # ip of the camera, example: 192.168.1.52

tapo = Tapo(host, user, password)

print(tapo.getBasicInfo())

Additional Information:

  • Device: C200
  • Hardware: 2.0 & 3.0
  • Fireware: 1.3.9 Build 231019 Rel.38052n(5553)
  • Tapo Control version: 5.4.4

@boheme61
Copy link

boheme61 commented Nov 15, 2023

FWIW:
I Just updated 1 cam

C200
HW: 1.0
FW: 1.3.9 Build 231019 Rel.37378n(4555)
Tapo Control version: 5.3.9

Working, in 2 different Ha-installs , i could try to update 1 to Tapo Control version: 5.4.4
( however i noticed my FW for 1.0 also differs, from reported )

EDIT: Working
FW: 1.3.9 Build 231019 Rel.37378n(4555)
Tapo Control version: 5.4.4

Sorry can't be of much help here

@JurajNyiri
Copy link
Owner

JurajNyiri commented Nov 15, 2023

Thank you @yiskang @maroliar this is very helpful. I tried it with my 3.0 on the newest firmware but unfortunately that one does not accept 3rd party credentials at all.

One more step needed; Please update to pytapo 3.3.8 pip install pytapo==3.3.8.

Then initiate the script like so:

from pytapo import Tapo

user = "cameraAccountUser" # user you set in Advanced Settings -> Camera Account
password = "cameraAccountPass" # password you set in Advanced Settings -> Camera Account
host = "192.168.xx.xx" # ip of the camera, example: 192.168.1.52

tapo = Tapo(host, user, password, printDebugInformation=True)

print(tapo.getBasicInfo())

Output should have all the confidential data already redacted, please post it here and we will know where exactly the communication fails with 3rd party acc credentials.

@JurajNyiri JurajNyiri added the Help wanted Extra attention is needed label Nov 15, 2023
@yiskang
Copy link

yiskang commented Nov 15, 2023

Hi @JurajNyiri,

Here is the debug log following your instructions. I truncated some strings in the payloads of requests or responses that I'm unsure if they include confidential info.

New request:
{'data': {'method': 'login', 'params': {'encrypt_type': '3', 'username': 'cameraAccountUser'}}, 'headers': {'Host': 'REDACTED', 'Referer': 'REDACTED', 'Accept': 'application/json', 'Accept-Encoding': 'gzip, deflate', 'User-Agent': 'Tapo CameraClient Android', 'Connection': 'close', 'requestByApp': 'true', 'Content-Type': 'application/json; charset=UTF-8'}, 'verify': False}
200
{'error_code': -40413, 'result': {'data': {'code': -40401, 'encrypt_type': ['3'], 'key': 'REDACTED', 'nonce': 'REDACTED', 'device_confirm': 'REDACTED'}}}
New request:
{'data': {'method': 'login', 'params': {'cnonce': 'REDACTED', 'encrypt_type': '3', 'username': 'cameraAccountUser'}}, 'headers': {'Host': 'REDACTED', 'Referer': 'REDACTED', 'Accept': 'application/json', 'Accept-Encoding': 'gzip, deflate', 'User-Agent': 'Tapo CameraClient Android', 'Connection': 'close', 'requestByApp': 'true', 'Content-Type': 'application/json; charset=UTF-8'}, 'verify': False}
200
{'error_code': -40413, 'result': {'data': {'code': -40401, 'encrypt_type': ['3'], 'key': 'REDACTED', 'nonce': 'REDACTED', 'device_confirm': 'REDACTED'}}}
New request:
{'data': {'method': 'login', 'params': {'cnonce': 'REDACTED', 'encrypt_type': '3', 'digest_passwd': 'REDACTED', 'username': 'cameraAccountUser'}}, 'headers': {'Host': 'REDACTED', 'Referer': 'REDACTED', 'Accept': 'application/json', 'Accept-Encoding': 'gzip, deflate', 'User-Agent': 'Tapo CameraClient Android', 'Connection': 'close', 'requestByApp': 'true', 'Content-Type': 'application/json; charset=UTF-8'}, 'verify': False}
200
{'error_code': 0, 'result': {'stok': 'REDACTED', 'user_group': 'third_account', 'start_seq': 739}}
New request:
{'data': {'method': 'securePassthrough', 'params': {'request': 'aqJP...fA'}}, 'headers': {'Host': 'REDACTED', 'Referer': 'REDACTED', 'Accept': 'application/json', 'Accept-Encoding': 'gzip, deflate', 'User-Agent': 'Tapo CameraClient Android', 'Connection': 'close', 'requestByApp': 'true', 'Content-Type': 'application/json; charset=UTF-8', 'Seq': '739', 'Tapo_tag': 'REDACTED'}, 'verify': False}
500
{'error_code': 0, 'seq': 739, 'result': {'response': 'Es9...VM6p'}}
New request:
{'data': {'method': 'login', 'params': {'cnonce': 'REDACTED', 'encrypt_type': '3', 'username': 'cameraAccountUser'}}, 'headers': {'Host': 'REDACTED', 'Referer': 'REDACTED', 'Accept': 'application/json', 'Accept-Encoding': 'gzip, deflate', 'User-Agent': 'Tapo CameraClient Android', 'Connection': 'close', 'requestByApp': 'true', 'Content-Type': 'application/json; charset=UTF-8', 'Seq': '739', 'Tapo_tag': 'REDACTED'}, 'verify': False}
200
{'error_code': -40413, 'result': {'data': {'code': -40401, 'encrypt_type': ['3'], 'key': 'REDACTED', 'nonce': 'REDACTED', 'device_confirm': 'REDACTED'}}}
New request:
{'data': {'method': 'login', 'params': {'cnonce': 'REDACTED', 'encrypt_type': '3', 'digest_passwd': 'REDACTED', 'username': 'cameraAccountUser'}}, 'headers': {'Host': 'REDACTED', 'Referer': 'REDACTED', 'Accept': 'application/json', 'Accept-Encoding': 'gzip, deflate', 'User-Agent': 'Tapo CameraClient Android', 'Connection': 'close', 'requestByApp': 'true', 'Content-Type': 'application/json; charset=UTF-8', 'Seq': '739', 'Tapo_tag': 'REDACTED'}, 'verify': False}
200
{'error_code': 0, 'result': {'stok': 'REDACTED', 'user_group': 'third_account', 'start_seq': 559}}
New request:
{'data': {'method': 'securePassthrough', 'params': {'request': 'DE7Zf...b0Dv0'}}, 'headers': {'Host': 'REDACTED', 'Referer': 'REDACTED', 'Accept': 'application/json', 'Accept-Encoding': 'gzip, deflate', 'User-Agent': 'Tapo CameraClient Android', 'Connection': 'close', 'requestByApp': 'true', 'Content-Type': 'application/json; charset=UTF-8', 'Seq': '559', 'Tapo_tag': 'REDACTED'}, 'verify': False}
500
{'error_code': 0, 'seq': 559, 'result': {'response': '1DsffKNKzy...TQgu4'}}
New request:
{'data': {'method': 'login', 'params': {'cnonce': 'REDACTED', 'encrypt_type': '3', 'username': 'cameraAccountUser'}}, 'headers': {'Host': 'REDACTED', 'Referer': 'REDACTED', 'Accept': 'application/json', 'Accept-Encoding': 'gzip, deflate', 'User-Agent': 'Tapo CameraClient Android', 'Connection': 'close', 'requestByApp': 'true', 'Content-Type': 'application/json; charset=UTF-8', 'Seq': '559', 'Tapo_tag': 'REDACTED'}, 'verify': False}
200
{'error_code': -40413, 'result': {'data': {'code': -40401, 'encrypt_type': ['3'], 'key': 'REDACTED', 'nonce': 'REDACTED', 'device_confirm': 'REDACTED'}}}
New request:
{'data': {'method': 'login', 'params': {'cnonce': 'REDACTED', 'encrypt_type': '3', 'digest_passwd': 'REDACTED', 'username': 'cameraAccountUser'}}, 'headers': {'Host': 'REDACTED', 'Referer': 'REDACTED', 'Accept': 'application/json', 'Accept-Encoding': 'gzip, deflate', 'User-Agent': 'Tapo CameraClient Android', 'Connection': 'close', 'requestByApp': 'true', 'Content-Type': 'application/json; charset=UTF-8', 'Seq': '559', 'Tapo_tag': 'REDACTED'}, 'verify': False}
200
{'error_code': 0, 'result': {'stok': 'REDACTED', 'user_group': 'third_account', 'start_seq': 506}}
New request:
{'data': {'method': 'securePassthrough', 'params': {'request': '32ocm...AsG'}}, 'headers': {'Host': 'REDACTED', 'Referer': 'REDACTED', 'Accept': 'application/json', 'Accept-Encoding': 'gzip, deflate', 'User-Agent': 'Tapo CameraClient Android', 'Connection': 'close', 'requestByApp': 'true', 'Content-Type': 'application/json; charset=UTF-8', 'Seq': '506', 'Tapo_tag': 'REDACTED'}, 'verify': False}
500
{'error_code': 0, 'seq': 506, 'result': {'response': 'gS...Rz'}}

Exception log when using 3.3.8

Traceback (most recent call last):
  File "/Users/kang/Desktop/tapo/tapo.py", line 7, in <module>
    tapo = Tapo(host, user, password, printDebugInformation=True)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/pytapo/__init__.py", line 77, in __init__
    self.basicInfo = self.getBasicInfo()
                     ^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/pytapo/__init__.py", line 906, in getBasicInfo
    return self.executeFunction(
           ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/pytapo/__init__.py", line 413, in executeFunction
    data = self.performRequest(
           ^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/pytapo/__init__.py", line 517, in performRequest
    return self.performRequest(requestData, loginRetryCount + 1)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/pytapo/__init__.py", line 517, in performRequest
    return self.performRequest(requestData, loginRetryCount + 1)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/pytapo/__init__.py", line 519, in performRequest
    raise Exception(
Exception: Error: -1, Response: {"result": {"responses": [{"msg": "Check tapo tag failed", "error_code": -1}]}, "error_code": -1}

@JurajNyiri
Copy link
Owner

JurajNyiri commented Nov 15, 2023

@yiskang @maroliar @iwebsource @Frazou1 @bysimba @grunkands @jdndm @ndrsfr
Please test with https://github.com/JurajNyiri/HomeAssistant-Tapo-Control/releases/tag/5.4.6 and confirm the fix working.

In case of problem still persisting:

Add following to configuration.yaml:

logger:
  logs:
    custom_components.tapo_control: debug

Post full log in case of an error.

If you see Incorrect pytapo version installed error on start, fix your environment.

@iwebsource
Copy link

iwebsource commented Nov 15, 2023

@yiskang @maroliar @iwebsource @Frazou1 @bysimba @grunkands @jdndm @ndrsfr Please test with https://github.com/JurajNyiri/HomeAssistant-Tapo-Control/releases/tag/5.4.6 and confirm the fix working.

In case of problem still persisting:

Add following to configuration.yaml:

logger:
  logs:
    custom_components.tapo_control: debug

Post full log in case of an error.

If you see Incorrect pytapo version installed error on start, fix your environment.

@JurajNyiri ,

I can confirm that the fix you implemented (Version 5.4.6) is working for me. No issues adding it now. Thank you very much JurajNyiri for all your hard work!

My Info:
Tapo Control v5.4.6
C200 FW 1.3.9 (HW3.0)

@Frazou1

This comment was marked as off-topic.

@JurajNyiri
Copy link
Owner

JurajNyiri commented Nov 15, 2023

@Frazou1 It is linked in the post you are posting reply to. If you are using HACS it should show up soon or you can force the install by going to /hacs/repository/300358676 in your HA instance clicking 3 dots and selecting Redownload.
If you are not using hacs, just install manually as you did before. (You should be using HACS though.).

@yiskang
Copy link

yiskang commented Nov 15, 2023

@JurajNyiri Thanks a ton for your prompt help! I confirmed that 5.4.6 works and fixes the issue on my side.

My devices:

  • Model: C200
  • Hardware: 2.0 & 3.0
  • Fireware: 1.3.9 Build 231019 Rel.38052n(5553)

@grunkands
Copy link
Author

@JurajNyiri Thank you so much for the quick solution to this problem! ⭐️

@Frazou1
Copy link

Frazou1 commented Nov 15, 2023 via email

@JurajNyiri JurajNyiri added Fixed Bug has been fixed. and removed Help wanted Extra attention is needed labels Nov 17, 2023
@brianjmurrell
Copy link

I do not use the cloud service for my cameras. I have even blocked all internet traffic for them. You can call me paranoid if you like. 😅

I can also try to do some more digging on my side to try to understand what is going on.

This is my general feeling about IoT devices, and in particular cameras. But then how do you do firmware updates? We all know that out-of-date firmwares are one of the bigger vectors to cracking these kinds of devices.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Fixed Bug has been fixed.
Projects
None yet
Development

No branches or pull requests