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

Error Code: -1501, Invalid Request or Credentials under Windows10 PC, not Windows7 PC #119

Open
JeanDaraspe2 opened this issue Jul 13, 2023 · 5 comments

Comments

@JeanDaraspe2
Copy link

Dear all,

I get same error message than #1 Windows 10 Pro with python-3.8.10-amd64 on a P100 plug (firmware 1.4.16 build 20230224) with static IP address (the plug looks ok, I can control it with the Tapo App):

`Traceback (most recent call last):
File "C:\Python38\lib\site-packages\PyP100\PyP100.py", line 168, 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 "turnoff.py", line 7, in
p100.login() #Sends credentials to the plug and creates AES Key and IV for further methods
File "C:\Python38\lib\site-packages\PyP100\PyP100.py", line 172, in login
raise Exception(f"Error Code: {errorCode}, {errorMessage}")
Exception: Error Code: -1501, Invalid Request or Credentials
`
I tried all the things that are described in #1 without any success (changing password with uppercase, or lowercase or numbers etc , changing account, reset the plug etc....) So I thought it was my P100 plug that maybe have a problem.

I have another P100 plug in another room (same firmware 1.4.16 build 20230224) with static IP address that work perfectly under windows 7 pro with same python-3.8.10-amd64

So I take it to try it with my Windows 10 pro computer using the same script than the windows 7 computer and it doesn't work as well...:(

Both computers are in the same domain. It doesn't work even without firewall.

Some month ago this Windows 10 pro computer works perfectly with the P100 plug.

I reallly don't unsderstand what is the problem here. If someone have an idea?

@Karbust

This comment was marked as resolved.

@adrianmmiller
Copy link

I'm having the same issue with two P110 plugs: Error Code: -1501, Invalid Request or Credentials

Firmware: 1.2.3 Build 230425 Rel.142542

Can ping the devices from the docker container.

I'm using this code: https://github.com/FergusInLondon/Tapo-P110-Prometheus-Exporter

PyP100 version set to 0.1.2.

On Windows 10 Pro with Python 3.10.4 it works without problems. On docker I'm using the image from python:3.11-slim-bullseye.

Care to share how you set the prometheus side up as id like to test it....

@Karbust
Copy link

Karbust commented Jul 21, 2023

I'm having the same issue with two P110 plugs: Error Code: -1501, Invalid Request or Credentials
Firmware: 1.2.3 Build 230425 Rel.142542
Can ping the devices from the docker container.
I'm using this code: https://github.com/FergusInLondon/Tapo-P110-Prometheus-Exporter
PyP100 version set to 0.1.2.
On Windows 10 Pro with Python 3.10.4 it works without problems. On docker I'm using the image from python:3.11-slim-bullseye.

Care to share how you set the prometheus side up as id like to test it....

I haven't set it up, I just got this plugs recently and today tried to add monitoring for my grafana, but can't even login, so I haven't been able to test it.

@adrianmmiller
Copy link

I'm having the same issue with two P110 plugs: Error Code: -1501, Invalid Request or Credentials
Firmware: 1.2.3 Build 230425 Rel.142542
Can ping the devices from the docker container.
I'm using this code: https://github.com/FergusInLondon/Tapo-P110-Prometheus-Exporter
PyP100 version set to 0.1.2.
On Windows 10 Pro with Python 3.10.4 it works without problems. On docker I'm using the image from python:3.11-slim-bullseye.

Care to share how you set the prometheus side up as id like to test it....

fwiw i recently (2 weeks ago?) tested that version of FW with python on Windows (ive never used docker) and had no issues....i cant find my post on here about that however, seems to be missing....ill try and restest soon (after dinner) just to be certain

@Karbust
Copy link

Karbust commented Jul 21, 2023

I'm having the same issue with two P110 plugs: Error Code: -1501, Invalid Request or Credentials
Firmware: 1.2.3 Build 230425 Rel.142542
Can ping the devices from the docker container.
I'm using this code: https://github.com/FergusInLondon/Tapo-P110-Prometheus-Exporter
PyP100 version set to 0.1.2.
On Windows 10 Pro with Python 3.10.4 it works without problems. On docker I'm using the image from python:3.11-slim-bullseye.

Care to share how you set the prometheus side up as id like to test it....

fwiw i recently (2 weeks ago?) tested that version of FW with python on Windows (ive never used docker) and had no issues....i cant find my post on here about that however, seems to be missing....ill try and restest soon (after dinner) just to be certain

I've hidden my comment, I was configuring the script incorrectly, was using the wrong paramenters/environment variables, after fixing my docker command it immediately worked and the prometheus endpoint is published.

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