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

[tapocontrol] TapoControl L530 "Login Error" #14455

Open
CrimsonBinome24 opened this issue Feb 20, 2023 · 7 comments
Open

[tapocontrol] TapoControl L530 "Login Error" #14455

CrimsonBinome24 opened this issue Feb 20, 2023 · 7 comments
Labels
awaiting feedback bug An unexpected problem or unintended behavior of an add-on

Comments

@CrimsonBinome24
Copy link

Received "Login error" on brand new L530 devices, The bridge shows online and the "Thing" is referencing the correct bridge. This is also a brand new instance of Openhab running on Ubuntu, installed per the docs. TCPDUMP shows communication between the openhab server and the L530,

Openhab version: openHAB 3.4.2
Java: OpenJDK 11.0.18
Binding Version 3.4.2

modelId
L530
vendor
Tapo
hardwareVersion
2.0
firmwareVersion
1.0.10 Build 221129 Rel.193015

@lolodomo lolodomo changed the title TapoControl L530 "Login Error" [Tapocontrol] TapoControl L530 "Login Error" Feb 21, 2023
@lolodomo lolodomo changed the title [Tapocontrol] TapoControl L530 "Login Error" [tapocontrol] TapoControl L530 "Login Error" Feb 21, 2023
@CrimsonBinome24
Copy link
Author

CrimsonBinome24 commented Feb 21, 2023

15:05:06.290 [TRACE] [apocontrol.internal.device.TapoDevice] - (tapocontrol:L530:*REDACTED*) schedulerAction
15:05:06.292 [TRACE] [ontrol.internal.api.TapoDeviceHttpApi] - (tapocontrol:L530:*REDACTED*) not logged in
15:05:06.294 [DEBUG] [apocontrol.internal.device.TapoDevice] - (tapocontrol:L530:*REDACTED*) tried to query DeviceInfo but not loggedIn
15:05:06.339 [TRACE] [trol.internal.api.TapoDeviceConnector] - (tapocontrol:L530:*REDACTED*) sending login to url 'http://*REDACTED*/app'
15:05:06.342 [TRACE] [ontrol.internal.api.TapoDeviceHttpApi] - (tapocontrol:L530:*REDACTED*) create handhsake with payload: {"method":"handshake","params":{"key":"-----BEGIN PUBLIC KEY-----*REDACTED*-----END PUBLIC KEY-----\n"},"requestTimeMils":1676991906341}
15:05:06.345 [TRACE] [ontrol.internal.api.TapoDeviceHttpApi] - (tapocontrol:L530:*REDACTED*) sendRequest to 'http://*REDACTED*/app' with cookie ''
15:05:06.368 [TRACE] [ontrol.internal.api.TapoDeviceHttpApi] - (tapocontrol:L530:*REDACTED*) received awnser: {"error_code":0,"result":{"key":"*REDACTED*"}}
15:05:06.370 [TRACE] [pocontrol.internal.helpers.TapoCipher] - Init TapoCipher with key: *REDACTED*
15:05:06.373 [TRACE] [ontrol.internal.api.TapoDeviceHttpApi] - (tapocontrol:L530:*REDACTED*) got cookie: 'TP_SESSIONID=*REDACTED*
15:05:06.376 [TRACE] [ontrol.internal.api.TapoDeviceHttpApi] - (tapocontrol:L530:*REDACTED*) sendRequest to 'http://*REDACTED*/app' with cookie 'TP_SESSIONID=*REDACTED*
15:05:06.387 [TRACE] [ontrol.internal.api.TapoDeviceHttpApi] - (tapocontrol:L530:*REDACTED*) received result: {"error_code":-1501}
15:05:06.389 [DEBUG] [ontrol.internal.api.TapoDeviceHttpApi] - (tapocontrol:L530:*REDACTED*) login recieved errorCode -1501 - Login Error
15:05:06.392 [TRACE] [ontrol.internal.api.TapoDeviceHttpApi] - (tapocontrol:L530:*REDACTED*) not logged in

@CrimsonBinome24
Copy link
Author

I've been able to verify that at leas the bridge is working as the lights are auto-discovered via the bridge option to do so.

@lolodomo lolodomo added the bug An unexpected problem or unintended behavior of an add-on label May 12, 2023
@lsiepel
Copy link
Contributor

lsiepel commented Aug 30, 2024

Can i assume this issue is fixed for atleast curent stable openHAB 4.2.1 ? There seem to be several related PR's after 3.4.2

@frodo87
Copy link

frodo87 commented Sep 13, 2024

I am still experiencing this issue, although the error code is different.
When using protocol: AES (Secured HTTP Protocol), then the error is login failed (1111). If I change to protocol: KLAP (Secured KLAP HTTP Protocol), then the error is cant create handshake (1100).

In none of the two cases I see any package leaving the openhab to port 80, where the lamp L530 is listening. It feels as if the tapo control is not even trying to reach anything.

Error log with KLAP:

2024-09-13 23:01:00.499 [TRACE] [l.devices.wifi.TapoBaseDeviceHandler] - (tapocontrol:L530:Mr71_tapo_light_bed) schedulerAction
2024-09-13 23:01:00.500 [DEBUG] [l.devices.wifi.TapoBaseDeviceHandler] - (tapocontrol:L530:Mr71_tapo_light_bed) check if logged in but is not
2024-09-13 23:01:00.603 [TRACE] [ernal.api.protocol.klap.KlapProtocol] - (tapocontrol:L530:Mr71_tapo_light_bed / HTTP-KLAP) login to device
2024-09-13 23:01:00.603 [TRACE] [ternal.api.protocol.klap.KlapSession] - reset KlapSession
2024-09-13 23:01:00.604 [TRACE] [ternal.api.protocol.klap.KlapSession] - (tapocontrol:L530:Mr71_tapo_light_bedKLAP-Session) sending bytes'*REDACTED* to 'http://*REDACTED_ACTUAL_IP_OF_LAMP*:80/app/handshake1' 
2024-09-13 23:01:00.604 [DEBUG] [rol.internal.api.TapoDeviceConnector] - (tapocontrol:L530:Mr71_tapo_light_bed / DeviceConnector) exception while login '@text/error-api-hand-shake-failed [ "1100" ]'
2024-09-13 23:01:00.604 [DEBUG] [rol.internal.api.TapoDeviceConnector] - (tapocontrol:L530:Mr71_tapo_light_bed / DeviceConnector) handle error '@text/error-api-hand-shake-failed [ "1100" ]'
2024-09-13 23:01:00.604 [TRACE] [ternal.api.protocol.klap.KlapSession] - reset KlapSession

Error log when using AES:

==> data/openhab/userdata/logs/openhab.log <==
2024-09-13 23:03:33.077 [TRACE] [l.devices.wifi.TapoBaseDeviceHandler] - (tapocontrol:L530:Mr71_tapo_light_bed) schedulerAction
2024-09-13 23:03:33.077 [DEBUG] [l.devices.wifi.TapoBaseDeviceHandler] - (tapocontrol:L530:Mr71_tapo_light_bed) check if logged in but is not
2024-09-13 23:03:33.180 [TRACE] [l.api.protocol.aes.SecurePassthrough] - (tapocontrol:L530:Mr71_tapo_light_bed / HTTP-SecurePasstrhough) login to device
2024-09-13 23:03:33.180 [TRACE] [rotocol.aes.SecurePassthroughSession] - (tapocontrol:L530:Mr71_tapo_light_bed / SecurePassthrough-Session) create handhsake with payload: {"method":"handshake","params":{"key":"-----BEGIN PUBLIC KEY-----*REDACTED*-----END PUBLIC KEY-----\n"},"requestTimeMils":1726261413180}
2024-09-13 23:03:33.181 [TRACE] [rotocol.aes.SecurePassthroughSession] - (tapocontrol:L530:Mr71_tapo_light_bed / SecurePassthrough-Session) sending Handshake request: '{"method":"handshake","params":{"key":"-----BEGIN PUBLIC KEY-----\*REDACTED*-----END PUBLIC KEY-----\n"},"requestTimeMils":1726261413180}' to 'http://*REDACTED_ACTUAL_IP_OF_LAMP*:80/app' 
2024-09-13 23:03:33.181 [DEBUG] [rol.internal.api.TapoDeviceConnector] - (tapocontrol:L530:Mr71_tapo_light_bed / DeviceConnector) exception while login '@text/error-api-login-failed [ "1111" ]'
2024-09-13 23:03:33.182 [DEBUG] [rol.internal.api.TapoDeviceConnector] - (tapocontrol:L530:Mr71_tapo_light_bed / DeviceConnector) handle error '@text/error-api-login-failed [ "1111" ]'

==> data/openhab/userdata/logs/events.log <==
2024-09-13 23:03:33.182 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'tapocontrol:L530:Mr71_tapo_light_bed' changed from OFFLINE (COMMUNICATION_ERROR): login failed (1111) to UNKNOWN: login failed (1111)
2024-09-13 23:03:33.182 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'tapocontrol:L530:Mr71_tapo_light_bed' changed from UNKNOWN: login failed (1111) to OFFLINE (COMMUNICATION_ERROR): login failed (1111)

Details of the binding version, 4.2.1:

Source
openHAB Distribution
Provided By
openHAB
checkmark_seal_fill
Version
4.2.1
Type
binding
Connection Type
cloud
Content Type
Karaf Feature
Provisioned With
Karaf

OpenHab, v 4.2.1:

openHAB 4.2.1
Release Build

Check of outgoing packages, where openhab is the hostname of the server:

tcpdump -vvv 'src openhab and (dst port 443 or dst port 80)'

This would only show traffic when, e.g. visiting the bindings store. But it remains silent when attempting to connect to the lamp.

Model of the Lamp, as reported by Tapo app:

Model: Tapo L530
Hardware Version: 2.0
Firmware Version: 1.1.1 Build 240623 Rel.114041

@lsiepel
Copy link
Contributor

lsiepel commented Sep 21, 2024

@wildcs would you be able to comment on this issue?

@frodo87
Copy link

frodo87 commented Sep 21, 2024

@wildcs would you be able to comment on this issue?

What would you need to know? I can still try to retrieve some more information.

@lsiepel
Copy link
Contributor

lsiepel commented Sep 21, 2024

@wildcs implemented the KLAP protocol and knows alot about this binding.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting feedback bug An unexpected problem or unintended behavior of an add-on
Projects
None yet
Development

No branches or pull requests

4 participants