kopiro / homebridge-tapo-camera

Homebridge plugin for TP-Link TAPO security cameras
ISC License
127 stars 11 forks source link

Error: Invalid authentication data" and FetchError #111

Closed midnightcomesonce closed 6 months ago

midnightcomesonce commented 9 months ago

Using a Tapo C210 camera, have followed guide and encountering these 2 errors every time and no connection to camera.

Error at 'getStatusAndUpdateCharacteristics'. FetchError: request to https://XXX.XXX.X.XXX/ failed, reason: write EPROTO 80B7FAB6:error:0A00010B:SSL routines:ssl3_get_record:wrong version number:../deps/openssl/openssl/ssl/record/ssl3_record.c:355:

at ClientRequest.<anonymous> (/var/lib/homebridge/node_modules/homebridge-tapo-camera/node_modules/node-fetch/lib/index.js:1501:11)
at ClientRequest.emit (node:events:517:28)
at TLSSocket.socketErrorListener (node:_http_client:501:9)
at TLSSocket.emit (node:events:517:28)
at emitErrorNT (node:internal/streams/destroy:151:8)
at emitErrorCloseNT (node:internal/streams/destroy:116:3)
at processTicksAndRejections (node:internal/process/task_queues:82:21) {

type: 'system', errno: 'EPROTO', code: 'EPROTO' }

AND

Error at 'getStatusAndUpdateCharacteristics'. Error: Invalid authentication data at TAPOCamera.refreshStok (/var/lib/homebridge/node_modules/homebridge-tapo-camera/src/tapoCamera.ts:289:11) at processTicksAndRejections (node:internal/process/task_queues:95:5) at TAPOCamera.getAuthenticatedAPIURL (/var/lib/homebridge/node_modules/homebridge-tapo-camera/src/tapoCamera.ts:335:19) at /var/lib/homebridge/node_modules/homebridge-tapo-camera/src/tapoCamera.ts:415:23 at TAPOCamera.getStatus (/var/lib/homebridge/node_modules/homebridge-tapo-camera/src/tapoCamera.ts:555:18) at CameraAccessory.getStatusAndUpdateCharacteristics (/var/lib/homebridge/node_modules/homebridge-tapo-camera/src/cameraAccessory.ts:234:27) at Timeout._onTimeout (/var/lib/homebridge/node_modules/homebridge-tapo-camera/src/cameraAccessory.ts:212:7)

{ "cameras": [ { "name": "XXXX", "ipAddress": "XXX.XXX.X.XXX", "username": "XXXX", "password": "XXXX", "streamUser": "XXXXX", "streamPassword": "XXXX" } ], "platform": "XXXX" }

v2.3.4 v1.7.0 v18.18.2 Raspbian GNU/Linux Bookworm (12)

junjan1245 commented 8 months ago

I encounter the same error on my C200 but only seeing the second stack trace:

[06/01/2024, 22:32:58] [homebridge-tapo-camera] Error at 'getStatusAndUpdateCharacteristics'. Error: Invalid authentication data
    at TAPOCamera.refreshStok (/var/lib/homebridge/node_modules/homebridge-tapo-camera/src/tapoCamera.ts:289:11)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
    at TAPOCamera.getAuthenticatedAPIURL (/var/lib/homebridge/node_modules/homebridge-tapo-camera/src/tapoCamera.ts:335:19)
    at /var/lib/homebridge/node_modules/homebridge-tapo-camera/src/tapoCamera.ts:415:23
    at TAPOCamera.getStatus (/var/lib/homebridge/node_modules/homebridge-tapo-camera/src/tapoCamera.ts:555:18)
    at CameraAccessory.getStatusAndUpdateCharacteristics (/var/lib/homebridge/node_modules/homebridge-tapo-camera/src/cameraAccessory.ts:234:27)
    at Timeout._onTimeout (/var/lib/homebridge/node_modules/homebridge-tapo-camera/src/cameraAccessory.ts:212:7)

Nevertheless, when manually opening the URL rtsp://username:password@IP-Address:554/stream1 (or stream2) with the identical connection data and credentials I can see the stream.

I am not sure if it is exactly the same error, but I would be happy to get a solution.

Exor commented 8 months ago

I have the same error on my C100 and C210 cameras. I can view the video stream in homekit no problem, it just clogs up my homebridge logs.

[1/30/2024, 8:41:07 PM] [tapo-camera] Error at 'getStatusAndUpdateCharacteristics'. Error: Invalid authentication data
    at TAPOCamera.refreshStok (/homebridge/node_modules/homebridge-tapo-camera/src/tapoCamera.ts:289:11)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
    at TAPOCamera.getAuthenticatedAPIURL (/homebridge/node_modules/homebridge-tapo-camera/src/tapoCamera.ts:335:19)
    at /homebridge/node_modules/homebridge-tapo-camera/src/tapoCamera.ts:415:23
    at TAPOCamera.getStatus (/homebridge/node_modules/homebridge-tapo-camera/src/tapoCamera.ts:555:18)
    at CameraAccessory.getStatusAndUpdateCharacteristics (/homebridge/node_modules/homebridge-tapo-camera/src/cameraAccessory.ts:234:27)
    at Timeout._onTimeout (/homebridge/node_modules/homebridge-tapo-camera/src/cameraAccessory.ts:212:7)

I also have an additional error, "Invalid device confirm", which always occurs 3 seconds after the error above.

[1/30/2024, 8:41:10 PM] [tapo-camera] Error at 'getStatusAndUpdateCharacteristics'. Error: Invalid device confirm
    at TAPOCamera.refreshStok (/homebridge/node_modules/homebridge-tapo-camera/src/tapoCamera.ts:205:15)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
    at TAPOCamera.getAuthenticatedAPIURL (/homebridge/node_modules/homebridge-tapo-camera/src/tapoCamera.ts:335:19)
    at /homebridge/node_modules/homebridge-tapo-camera/src/tapoCamera.ts:415:23
    at TAPOCamera.getStatus (/homebridge/node_modules/homebridge-tapo-camera/src/tapoCamera.ts:555:18)
    at CameraAccessory.getStatusAndUpdateCharacteristics (/homebridge/node_modules/homebridge-tapo-camera/src/cameraAccessory.ts:234:27)
    at Timeout._onTimeout (/homebridge/node_modules/homebridge-tapo-camera/src/cameraAccessory.ts:212:7)
Tequila98 commented 7 months ago

same problem for me with C200 and C210.

[27/02/2024, 20:27:27] [tapo-camera] Error at 'getStatusAndUpdateCharacteristics'. Error: Invalid authentication data at TAPOCamera.refreshStok (/var/lib/homebridge/node_modules/homebridge-tapo-camera/src/tapoCamera.ts:289:11) at processTicksAndRejections (node:internal/process/task_queues:95:5) at TAPOCamera.getAuthenticatedAPIURL (/var/lib/homebridge/node_modules/homebridge-tapo-camera/src/tapoCamera.ts:335:19) at /var/lib/homebridge/node_modules/homebridge-tapo-camera/src/tapoCamera.ts:415:23 at TAPOCamera.getStatus (/var/lib/homebridge/node_modules/homebridge-tapo-camera/src/tapoCamera.ts:555:18) at CameraAccessory.getStatusAndUpdateCharacteristics (/var/lib/homebridge/node_modules/homebridge-tapo-camera/src/cameraAccessory.ts:234:27) at CameraAccessory.setup (/var/lib/homebridge/node_modules/homebridge-tapo-camera/src/cameraAccessory.ts:265:7) at /var/lib/homebridge/node_modules/homebridge-tapo-camera/src/cameraPlatform.ts:30:9

radityaK commented 6 months ago

Hi all, I got the same issue. But then I realized that the tapo password is different than stream password.

  1. Tapo password is password that we enter when we login to Tapo apps
  2. Stream password is password that we set in Camera account.

After changing the password, the error above is disappear