Problems discovering HS103P2 plug on Raspberry Pi #1741
Replies: 1 comment 1 reply
|
Your discovery output already contains the means to check half of this yourself: That is the MD5 of the e-mail address the plug was paired with. From @staticmethod
def generate_owner_hash(creds: Credentials) -> bytes:
"""Return the MD5 hash of the username in this object."""
un = creds.username
return md5(un.encode())No printf '%s' 'your.address@example.com' | md5sumUppercase the result and see whether it equals If it does not match, the password is not your problem — the plug is bound to a differently-spelled address. Because there is no normalisation, all of these hash differently: Same address, three hashes. If you set the plug up in the Kasa app years ago with a capitalised address and are now typing it lowercase, you land exactly where you are. Try the capitalisation variants you might plausibly have used at pairing time — that is what "both case-sensitive" in the error is pointing at. If it does match, then the address is right and it is genuinely the password. Worth knowing: KLAP authenticates against the credentials stored on the device at pairing time, not against the cloud. Resetting your TP-Link password in the app does not re-provision a plug that is already bound — the device keeps the old hash until it is re-paired. That would explain why simplifying the password changed nothing. Factory-reset the plug and set it up again with the new password. Incidentally, that also means the One aside: the command in your post has em-dashes rather than double hyphens, and a stray full stop after the username: That will not parse — presumably your forum software mangled it, since you got an authentication error rather than a usage error. Just make sure the real command uses The |
Uh oh!
There was an error while loading. Please reload this page.
I have some TPLink HS103P2 Smart Plugs and am trying to get them working using this Python-Kasa library on my Raspberry Pi. Here is what I posted on the Raspberry Pi forum which summarized my last attempt.
===
I thought maybe that the & in my password was a potential problem, so I reset my TPLink Kasa password to be simple.
Ran the following kasa command
kasa —host 192.168.0.110 —username “my email on TPLink account”. —password “my new simple password”
This is what came back
== Authentication failed for device ==
== Discovery Result ==
Device Type: IOT.SMARTPLUGSWITCH
Device Model: HS103(US)
IP: 192.168.0.110
MAC: AC-A7-F1-87-B3-29
Device Id (hash): 8935ba215d7eb3cd3c6a54a81eeb6445
Owner (hash): 170C35047B87C0B3D6C205FB444EAE03
HW Ver: 5.0
OBD Src: tplink
Encrypt Type: KLAP
HTTP Port: 80
Login version: 2
Raised error: Device response did not match our challenge on ip 192.168.0.110, check that your e-mail and password (both case-sensitive) are correct.
Run with --debug enabled to see stacktrace
ERROR:asyncio:Unclosed client session
client_session: <aiohttp.client.ClientSession object at 0x7ffefb2d76d0>
ERROR:asyncio:Unclosed connector
connections: ['deque([(<aiohttp.client_proto.ResponseHandler object at 0x7ffefa33c150>, 4430.557490383)])']
connector: <aiohttp.connector.TCPConnector object at 0x7ffefa31fc10>
As always any nudges are appreciated. Thanks in advance.
All reactions