-
Notifications
You must be signed in to change notification settings - Fork 95
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
5.4.0 + 1.3.9 > Controls no longer available after a short time #438
Comments
Please post actual log file of when it starts happening, not just the summary. |
Yes, but where can I find them? (Sorry, I am a layman.) |
https://www.home-assistant.io/integrations/system_log/
|
To figure out whether time or number of requests is the issueDownload branch https://github.com/JurajNyiri/pytapo/tree/debug_request manually, and next to README.md create file test.py with content: Script 1: Stress test, possibly running out of seq number requiring new session:
Script 2: Time test, possibly expiring session:
Run using python3 in command line, if you get failures of missing modules, just run Let both running for a while (not at the same time), post the part of the script just when it starts failing and how it keeps failing. |
For example, the problem occurred at around 20:14. |
Sorry, but this is absolutely beyond my capabilities. |
I have the same problem. I will try to download the logs and run the scripts as soon as possible and I'll post here |
Script 1 result (it only took less than 2 seconds to fail: {'data': {'method': 'securePassthrough', 'params': {'request': 'REDACTED'}}, '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': '716', 'Tapo_tag': 'REDACTED'}, 'verify': False}
500
{'error_code': 0, 'seq': 716, 'result': {'response': 'REDACTED'}}
Traceback (most recent call last):
File "/home/pi_user/Projects/tapo/pytapo/test1.py", line 11, in <module>
tapo.getBasicInfo()
File "/home/pi_user/Projects/tapo/pytapo/pytapo/__init__.py", line 785, in getBasicInfo
return self.executeFunction(
^^^^^^^^^^^^^^^^^^^^^
File "/home/pi_user/Projects/tapo/pytapo/pytapo/__init__.py", line 341, in executeFunction
data = self.performRequest(
^^^^^^^^^^^^^^^^^^^^
File "/home/pi_user/Projects/tapo/pytapo/pytapo/__init__.py", line 433, in performRequest
if not self.responseIsOK(res, responseJSON):
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/pi_user/Projects/tapo/pytapo/pytapo/__init__.py", line 323, in responseIsOK
raise Exception(
Exception: Error communicating with Tapo Camera. Status code: 500 |
Script 2: Request number: 2
{'data': {'method': 'securePassthrough', 'params': {'request': 'REDACTED'}}, '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': '472', 'Tapo_tag': 'REDACTED'}, 'verify': False}
500
{'error_code': 0, 'seq': 472, 'result': {'response': 'REDACTED'}}
Traceback (most recent call last):
File "/home/pi_user/Projects/tapo/pytapo/test2.py", line 13, in <module>
tapo.getBasicInfo()
File "/home/pi_user/Projects/tapo/pytapo/pytapo/__init__.py", line 785, in getBasicInfo
return self.executeFunction(
^^^^^^^^^^^^^^^^^^^^^
File "/home/pi_user/Projects/tapo/pytapo/pytapo/__init__.py", line 341, in executeFunction
data = self.performRequest(
^^^^^^^^^^^^^^^^^^^^
File "/home/pi_user/Projects/tapo/pytapo/pytapo/__init__.py", line 433, in performRequest
if not self.responseIsOK(res, responseJSON):
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/pi_user/Projects/tapo/pytapo/pytapo/__init__.py", line 323, in responseIsOK
raise Exception(
Exception: Error communicating with Tapo Camera. Status code: 500 |
Thank you @fcachado . What was inside response? There is no reason to redact it in most of the cases, if it is encrypted it is literarily impossible to decrypt (even if I knew your password) and if it is not encrypted getBasicInfo has no confidential information. Also I see script 2 failing on Request number: 2. Can you try again? That seems very unexpected. |
Script 1 Request number: 37
{'data': {'method': 'securePassthrough', 'params': {'request': 'FJ9cQdeWUM0uw2YNlxVFdInnfzOrzwFu2Ux2LhAF/w7MLOaOjNWpZJ8tJiV/FQo2hED8pcrM4P81OJdcrAScDKdw5+SrM1uVvz/VwAptWJoz5n4XwbKZiUh8N5H9lpOgLfe3o3pPr00HqfrQPxC8ppxEyatZ064wxbbR9b9rY9/GhqvfVk27Hhh5aopA1isq'}}, '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': '489', 'Tapo_tag': 'REDACTED'}, 'verify': False}
500
{'error_code': 0, 'seq': 489, 'result': {'response': 'rLhPegMjLKTGSAmxgfBttAhEhHwnRijW8JeMKY9puEEPjM7//qyvOM5HHxKR7XNuk174rGfxQ9hX/inEIYCzd09T4IxT+jb3hu7HhFSDH2v9KpsNUlWeKGQCWAOq6Im5'}}
Traceback (most recent call last):
File "/home/pi_user/Projects/tapo/pytapo/test1.py", line 11, in <module>
tapo.getBasicInfo()
File "/home/pi_user/Projects/tapo/pytapo/pytapo/__init__.py", line 785, in getBasicInfo
return self.executeFunction(
^^^^^^^^^^^^^^^^^^^^^
File "/home/pi_user/Projects/tapo/pytapo/pytapo/__init__.py", line 341, in executeFunction
data = self.performRequest(
^^^^^^^^^^^^^^^^^^^^
File "/home/pi_user/Projects/tapo/pytapo/pytapo/__init__.py", line 433, in performRequest
if not self.responseIsOK(res, responseJSON):
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/pi_user/Projects/tapo/pytapo/pytapo/__init__.py", line 323, in responseIsOK
raise Exception(
Exception: Error communicating with Tapo Camera. Status code: 500 |
Script 2 (it fails on iteration number 2) @JurajNyiri Request number: 2
{'data': {'method': 'securePassthrough', 'params': {'request': 'ow6rx2se91dKq3QMh6ukuXGBHCIqyNNdkwZUWd3FUx8gpwlTuEUV5a3qXjIwnRiYD7Q7u1W9Awet73S/F0pzLOVML+gAE9YNVbZkOikZnduv81gHhSlK9D59rcYhg/kvb79b7ljVJoiDIQb04A9su1WcMZkD/NshwNIUO6WX4IxIbZAaqeuqITGyBtAKqmOh'}}, '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': '561', 'Tapo_tag': 'REDACTED'}, 'verify': False}
500
{'error_code': 0, 'seq': 561, 'result': {'response': 'am9fsPnZLT/qr6BOtMDLBckcRO/AuAzFnqa/0gzraubsgVNfI3bTaAQ9qwBA/g+rvwHA8FCJlLJMQHnMODSpha7hyjErs1YGoCHA1Aal6LldjB/Zc1kzgjnuHnMK4UHW'}}
Traceback (most recent call last):
File "/home/pi_user/Projects/tapo/pytapo/test2.py", line 13, in <module>
tapo.getBasicInfo()
File "/home/pi_user/Projects/tapo/pytapo/pytapo/__init__.py", line 785, in getBasicInfo
return self.executeFunction(
^^^^^^^^^^^^^^^^^^^^^
File "/home/pi_user/Projects/tapo/pytapo/pytapo/__init__.py", line 341, in executeFunction
data = self.performRequest(
^^^^^^^^^^^^^^^^^^^^
File "/home/pi_user/Projects/tapo/pytapo/pytapo/__init__.py", line 433, in performRequest
if not self.responseIsOK(res, responseJSON):
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/pi_user/Projects/tapo/pytapo/pytapo/__init__.py", line 323, in responseIsOK
raise Exception(
Exception: Error communicating with Tapo Camera. Status code: 500 |
@fcachado Thank you! Please pull/download the branch again, I have added a print which logs a decoded response. Knowing what is in the last response should help us understand the issue. Please run the scripts again. |
@JurajNyiri Script 1 Request number: 12
{'data': {'method': 'securePassthrough', 'params': {'request': 'mJ1JxqjSatl39y4xP0Cswo2XZOMK8TF8fLOmUdp94J2tPR5S3nyP77KZQe96/CsMOqTT7uDb/t8tGlNoV71luDaWA0YVXIrKzfHiue18K8atf3blyOPrgRJNLozCQXdiFovXcn++ZNNi8P+8ac8wsb3ImZKvimy4GFDAxMC/bStFRohtbuCnxEU49mNlxfj5'}}, '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': '28', 'Tapo_tag': 'REDACTED'}, 'verify': False}
500
{'error_code': 0, 'seq': 28, 'result': {'response': 'vPz0h/fww6++oo/uu13m716jG26S9wr1G8xtBl/yBQOjVLJqw2/Tb5yi6tu7HOn8mrNZf9BKO3jSlNRrWTKbMRQh0zNZXKAYGOb52n/hPa95RtVZ2+VBttDaPOX3VDqC'}}
{'result': {'responses': [{'msg': 'Http seq illegaly', 'error_code': -1}]}, 'error_code': -1}
Traceback (most recent call last):
File "/home/pi_user/Projects/tapo/pytapo/test1.py", line 11, in <module>
tapo.getBasicInfo()
File "/home/pi_user/Projects/tapo/pytapo/pytapo/__init__.py", line 786, in getBasicInfo
return self.executeFunction(
^^^^^^^^^^^^^^^^^^^^^
File "/home/pi_user/Projects/tapo/pytapo/pytapo/__init__.py", line 341, in executeFunction
data = self.performRequest(
^^^^^^^^^^^^^^^^^^^^
File "/home/pi_user/Projects/tapo/pytapo/pytapo/__init__.py", line 434, in performRequest
if not self.responseIsOK(res, responseJSON):
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/pi_user/Projects/tapo/pytapo/pytapo/__init__.py", line 323, in responseIsOK
raise Exception(
Exception: Error communicating with Tapo Camera. Status code: 500 |
Very interesting, lets try to reauth on this specific error. I will provide new code to try out soon. |
@fcachado Please try again with the same branch, I have pushed a new logic that should refresh auth on this error. |
It's running for the last 5m without any error |
@fcachado That's great! Keep it running for a few hours just to make sure. Please report back in like 2-3 hours, my meetings would've finished by then and I can release the fix to public. |
It's still running without issues @JurajNyiri |
Can confirm that |
Thank you! I will publish fix in a couple of hours. |
Fix #438: Controls no longer available after a short time on encrypted traffic
I'm still unable to control my C210 with FW 1.3.9 Build 231019 Rel.13805n(4555). After adding the camera in the integration I get the following error:
The following error appears constantly, especially when I want to use the control button or switches:
I've been having these problems since the release 5.4.0 for the new authorization for Tapo FW 1.3.9 and had hoped that they could be fixed with release 5.4.1, but unfortunately not. Please help |
@mafr95 does the camera work at first and then goes unavailable or not at all? |
@fcachado @kwermeister please confirm fix working |
The stream works perfectly. The switch, button etc. entities are available in HA. But I can't use them, from the beginning after adding the camera. Every time the error EDIT : Entities are available means they are not grayed out. |
If you make an update to the camera (for example setting privacy mode) through the app, does the change show in HA?
When did you add the camera? |
This also shows something really weird going on with the envrionment. Try to clear everything tapo_control related (go through entries in .storage as well after removing via UI, restart HA) and set up again. |
Done. So far no error after adding or controlling the camera. Thank you so much for your time and work! |
@JurajNyiri a big thank you for your efforts. After a few restarts of the camera and HA, it runs and can be controlled as before. Today the 1.3.9 updates for my other 2 cameras arrived on time. |
Thank you for reporting back. That is explained in faq in readme. |
I got similar issue with latest version of firmware. When I tried to remove everything and add it all back, my cameras with .7 version were added fine, but with .9 version I can't even authenticate get the following error: Invalid authentication data. Make sure you have created your 3rd party account via Tapo app. You can also test if these credentials work via rtsp stream, for example VLC using link rtsp://username:password@IP Address:554/stream1. I even tried with VLC to run the stream also same issue. but my Tapo app, Agent DVR and Synology Surveillance working fine. |
Wrong issue. |
Description
Hello.
Thank you for the new 5.4.0, but unfortunately I now have a new problem.
Since 5.4.0, approx. 1 hour after rebooting the camera, almost all control elements are grayed out and can no longer be used and individual messages such as "Move down no longer available" appear in the logbook. This only affects the camera with SW 1.3.9.
Movements are still detected in the HA logbook, but the camera can no longer be controlled.
The camera is fully functional in the Tapo app.
If I restart the camera by interrupting the power supply, the control elements are no longer grayed out and are functional again for approx. 1 hour.
Two identical camera models with SW 1.3.7. do not show these problems.
Reproduction Steps
Expected behavior
Permanent availability of the controls
If applicable, add error logs.
Logger: homeassistant.components.camera
Source: helpers/entity_platform.py:857
Integration: Kamera (documentation, issues)
First occurred: 4. November 2023 um 23:10:47 (2581 occurrences)
Last logged: 20:42:50
Updating tapo_control camera took longer than the scheduled update interval 0:00:30
Logger: homeassistant.components.camera
Source: helpers/entity_platform.py:857
Integration: Kamera (documentation, issues)
First occurred: 4. November 2023 um 23:10:47 (2581 occurrences)
Last logged: 20:42:50
Updating tapo_control camera took longer than the scheduled update interval 0:00:30
Logger: custom_components.tapo_control
Source: custom_components/tapo_control/utils.py:596
Integration: Tapo: Kamerasteuerung (documentation, issues)
First occurred: 4. November 2023 um 23:08:21 (14722 occurrences)
Last logged: 20:43:10
Authority failure
Logger: custom_components.tapo_control
Source: custom_components/tapo_control/init.py:416
Integration: Tapo: Kamerasteuerung (documentation, issues)
First occurred: 4. November 2023 um 23:14:23 (5808 occurrences)
Last logged: 20:43:11
Device Firmware
1.3.9 Build 231019 Rel.13805n(4555)
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 intel nuc installation
Search for similar issues
Yes
Additional information
No response
The text was updated successfully, but these errors were encountered: