Closed 0phenix closed 1 year ago
Make sure to use admin username and cloud password. Follow comments and documentation, it works. Restart camera, do not overload it with too many things accessing it and make sure you are using correct password.
I am certain that I use the correct password. If I usetapo = Tapo(host, "admin", password_cloud, password_cloud)
from the DownloadRecordings.py script, I get the following error.
Traceback (most recent call last): File "/home/ophenix/DownloadRecordings.py", line 62, in <module> tapo = Tapo(host, "admin", password_cloud, password_cloud) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/ophenix/.venv/lib/python3.11/site-packages/pytapo/__init__.py", line 46, in __init__ self.basicInfo = self.getBasicInfo() ^^^^^^^^^^^^^^^^^^^ File "/home/ophenix/.venv/lib/python3.11/site-packages/pytapo/__init__.py", line 461, in getBasicInfo return self.executeFunction( ^^^^^^^^^^^^^^^^^^^^^ File "/home/ophenix/.venv/lib/python3.11/site-packages/pytapo/__init__.py", line 118, in executeFunction data = self.performRequest( ^^^^^^^^^^^^^^^^^^^^ File "/home/ophenix/.venv/lib/python3.11/site-packages/pytapo/__init__.py", line 147, in performRequest self.ensureAuthenticated() File "/home/ophenix/.venv/lib/python3.11/site-packages/pytapo/__init__.py", line 66, in ensureAuthenticated return self.refreshStok() ^^^^^^^^^^^^^^^^^^ File "/home/ophenix/.venv/lib/python3.11/site-packages/pytapo/__init__.py", line 97, in refreshStok raise Exception("Invalid authentication data") Exception: Invalid authentication data
I'm not sure why thepassword_cloud
is used twice in the initialization parameters. Maybe you can explain this?
When I use the username and password from the camera's settings, example: tapo = Tapo(host, user, password, password_cloud)
, I make some progress. However, I encounter a 401 error instead.
You need to use admin username and a correct cloud password as specified in documentation. The password is there twice as it should be. It will not work with different credentials.
Follow my instructions above, unblock camera in firewall, restart it, do not overload it and it will work if you enter correct cloud password.
It still does not work...
I have reset the cloud password to ensure I have the correct cloud credentials. There is no issue logging into the Tapo app with it. I'm using the exact same password in the script. I have also restarted the camera and turned off the firewall. I don't know what else to do.
If you had it firewalled it might be confused about what is the correct password and you will need to wait - there were users who had similar issues. Camera calls home after a few days / weeks and gets the new password. You can try forcing it with restarts, or you could also remove it from your account and factory reset it to ensure it gets a proper cloud password right now, that will work for sure if you are executing the script as documented (admin username and cloud password).
Got it to work now! The restart of the camera did nothing, I had to completely remove it in the Tapo app and then add it again to get it to work.
Thanks!
Hi,
I'm using a C200 camera and trying to download recordnings from the SD card. I get this error below when i run the script.
Traceback (most recent call last): File "/home/ophenix/DownloadRecordings.py", line 100, in <module> loop.run_until_complete(download_async()) File "/usr/lib/python3.11/asyncio/base_events.py", line 653, in run_until_complete return future.result() ^^^^^^^^^^^^^^^ File "/home/ophenix/DownloadRecordings.py", line 81, in download_async async for status in downloader.download(): File "/home/ophenix/.venv/lib/python3.11/site-packages/pytapo/media_stream/downloader.py", line 115, in download async with mediaSession: File "/home/ophenix/.venv/lib/python3.11/site-packages/pytapo/media_stream/session.py", line 74, in __aenter__ await self.start() File "/home/ophenix/.venv/lib/python3.11/site-packages/pytapo/media_stream/session.py", line 156, in start raise HttpStatusCodeException(status_code) pytapo.media_stream.error.HttpStatusCodeException: HTTP request returned 401 status code
So it seems there's something wrong with the cloud authentication.
I have tried several ways, adjusting the variables with the camera password and the cloud password. When I test with print(tapo.getBasicInfo()), I get information from the camera, so at least that works. However, I still can't download any video from it.
Any ideas?