fishbigger / TapoP100

A module for controlling the TP-Link Tapo P100 Plugs
MIT License
572 stars 142 forks source link

Exception: Error Code: -1501, Invalid Request or Credentials #47

Closed c-bug closed 2 years ago

c-bug commented 2 years ago

am getting this on debian 11.2. I am able to login to https://www.tplinkcloud.com c&p credentials used in my script. Ideas?

p100-on.py

from PyP100 import PyP100

p100 = PyP100.P100("10.20.10.102", "x", "x") #Creating a P100 plug object

p100.handshake() #Creates the cookies required for further methods
p100.login() #Sends credentials to the plug and creates AES Key and IV for further methods

#p100.turnOn() #Sends the turn on request
#p100.turnOff() #Sends the turn off request
p100.getDeviceInfo() #Returns dict with all the device info
$ python3 p100-on.py
Traceback (most recent call last):
  File "/home/x/.local/lib/python3.9/site-packages/PyP100/PyP100.py", line 159, in login
    self.token = ast.literal_eval(decryptedResponse)["result"]["token"]
KeyError: 'result'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/x/p100-on.py", line 6, in <module>
    p100.login() #Sends credentials to the plug and creates AES Key and IV for further methods
  File "/home/x/.local/lib/python3.9/site-packages/PyP100/PyP100.py", line 163, in login
    raise Exception(f"Error Code: {errorCode}, {errorMessage}")
Exception: Error Code: -1501, Invalid Request or Credentials
v4d1mm1 commented 2 years ago

I had the same problem when my password was longer and more complex. After I've changed it everything started to work fine.

c-bug commented 2 years ago

It does not solve my problem, but I noticed this message when installing another plugin to my octoprint

ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.pyp100 0.0.18 requires requests==2.24.0, but you have requests 2.27.1 which is incompatible.
c-bug commented 2 years ago

Solved by creating a new account on tp-link site.

antoninsiska commented 1 year ago

You can have worng ip adress, email or password