RaresAil / homebridge-tp-link-tapo

A platform to implement the tp-link tapo device and Adaptive Lighting for light bulbs
https://www.npmjs.com/package/homebridge-tp-link-tapo
Apache License 2.0
61 stars 5 forks source link

Homebridge TP-Link Tapo Plugin Error: Second Handshake Failed #100

Open ibrokethelaw opened 1 week ago

ibrokethelaw commented 1 week ago

Describe The Bug

The Homebridge TP-Link Tapo plugin encounters an error during the second handshake process. The error message indicates a "Bad Request - Invalid Header" issue, which leads to a failure in sending commands to the Tapo devices. The logs also show a TypeError where the cipher property is undefined.

Expected behavior

The plugin should successfully complete the handshake process and send commands to the Tapo devices without encountering any errors.

Logs

[KLAP] Second handshake failed: Bad Request - Invalid Header
[7/7/2024, 7:13:40 AM] [TPLink Tapo Platform] Error sending command: deviceInfo TypeError: Cannot read properties of undefined (reading 'cipher')
    at KlapAPI.sendSecureRequest (/usr/local/lib/node_modules/homebridge-tp-link-tapo/src/api/KlapAPI.ts:59:39)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
    at TPLink.sendCommandWithNoLock (/usr/local/lib/node_modules/homebridge-tp-link-tapo/src/api/TPLink.ts:243:24)
[7/7/2024, 7:13:40 AM] [TPLink Tapo Platform] Failed to get info about: 192.168.1.242

Plugin Config

{
    "platforms": [
        {
            "platform": "HomebridgeTPLinkTapo",
            "name": "TPLink Tapo Platform",
            "email": "my-email@example.com",
            "password": "my-password",
            "addresses": [
                "192.168.1.242",
                "192.168.1.66"
            ]
        }
    ],
    "log": {
        "debug": true,
        "file": "/Users/my-username/.homebridge/homebridge.log"
    }
}

Plugin Version

homebridge-tp-link-tapo version: 4.1.0

Homebridge Version

1.8.3

Node.js Version

20.9.0

NPM Version

10.8.1

Operating System

macOS 14.5 (BuildVersion: 23F79)