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

Exception: Invalid authentication data #80

Closed
NicoCaldo opened this issue Nov 7, 2023 · 3 comments
Closed

Exception: Invalid authentication data #80

NicoCaldo opened this issue Nov 7, 2023 · 3 comments

Comments

@NicoCaldo
Copy link

NicoCaldo commented Nov 7, 2023

I've 2 C210 correctly linked to a single account and to the WiFi network.

One of them, suddenly, because I've wrongly left the auto update option ON, automatically updated its firmware

Now, for some reason, even if I'm using admin as a user, I've having the issue

File "/home/lab/dashboardlab/.venv/lib/python3.10/site-packages/pytapo/__init__.py", line 269, in refreshStok
    raise Exception("Invalid authentication data")
Exception: Invalid authentication data

The C210 that still works

  • v. firmware 1.3.7

The C210 that has the Invalid authentication data issue

  • v. firmware 1.3.9 Build 231019 Rel.31045n(4555)

pytapo is updated to the latest version. IP is correct as I'm able to see it via rstp

@NicoCaldo
Copy link
Author

It seems it was introduced here JurajNyiri/HomeAssistant-Tapo-Control#436

@JurajNyiri
Copy link
Owner

JurajNyiri commented Nov 7, 2023

Factory reset camera / readd to tapo app, there is a bug in camera for some users where it does not properly load the new password hash. And use the latest version of pytapo.

@robozb
Copy link

robozb commented Nov 15, 2023

On my C110 (FW: 1.3.9) the solution was: simple upgrade to the latest pytapo (in the virt env):

Before:

Traceback (most recent call last):
  File "/home/pytapo/pytapo/tapo-camera-on.py", line 10, in <module>
    tapo1 = Tapo(host1, user, password)
  File "/home/pytapo/pytapo/virt/lib/python3.9/site-packages/pytapo/__init__.py", line 45, in __init__
    self.basicInfo = self.getBasicInfo()
  File "/home/pytapo/pytapo/virt/lib/python3.9/site-packages/pytapo/__init__.py", line 364, in getBasicInfo
    return self.executeFunction(
  File "/home/pytapo/pytapo/virt/lib/python3.9/site-packages/pytapo/__init__.py", line 105, in executeFunction
    data = self.performRequest(
  File "/home/pytapo/pytapo/virt/lib/python3.9/site-packages/pytapo/__init__.py", line 128, in performRequest
    self.ensureAuthenticated()
  File "/home/pytapo/pytapo/virt/lib/python3.9/site-packages/pytapo/__init__.py", line 65, in ensureAuthenticated
    return self.refreshStok()
  File "/home/pytapo/pytapo/virt/lib/python3.9/site-packages/pytapo/__init__.py", line 84, in refreshStok
    raise Exception("Invalid authentication data")
Exception: Invalid authentication data
10:12:14 Normal: --- Startup, daemonizing ---

Upgrade:

source virt/bin/activate
(virt) root@rpi4:/home/pytapo/pytapo# python3 -m pip install pytapo --upgrade
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
Requirement already satisfied: pytapo in ./virt/lib/python3.9/site-packages (2.8)
Collecting pytapo
  Downloading https://www.piwheels.org/simple/pytapo/pytapo-3.3.6-py3-none-any.whl (29 kB)
Requirement already satisfied: pycryptodome in ./virt/lib/python3.9/site-packages (from pytapo) (3.16.0)
Requirement already satisfied: requests in ./virt/lib/python3.9/site-packages (from pytapo) (2.28.1)
Requirement already satisfied: urllib3 in ./virt/lib/python3.9/site-packages (from pytapo) (1.26.13)
Collecting rtp
  Downloading https://www.piwheels.org/simple/rtp/rtp-0.0.3-py3-none-any.whl (14 kB)
Requirement already satisfied: certifi>=2017.4.17 in ./virt/lib/python3.9/site-packages (from requests->pytapo) (2022.12.7)
Requirement already satisfied: idna<4,>=2.5 in ./virt/lib/python3.9/site-packages (from requests->pytapo) (3.4)
Requirement already satisfied: charset-normalizer<3,>=2 in ./virt/lib/python3.9/site-packages (from requests->pytapo) (2.1.1)
Installing collected packages: rtp, pytapo
  Attempting uninstall: pytapo
    Found existing installation: pytapo 2.8
    Uninstalling pytapo-2.8:
      Successfully uninstalled pytapo-2.8

Result: all good :)

Thanks a lot!

Bela

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

No branches or pull requests

3 participants