kopiro / homebridge-tapo-camera

Homebridge plugin for TP-Link TAPO security cameras
ISC License
119 stars 10 forks source link

Tapo C225 not working after firmware update & infinite Homebridge restart loop #98

Closed z0gst closed 7 months ago

z0gst commented 7 months ago

After upgrading C225 to a firmware version 1.0.27, I started getting the following errors on Homebridge. It looks like the camera still starts based on the logs, however another error seems to send Homebridge to an infinite restart loop.

Logs:

[30/11/2023, 19:28:06] [tapo-camera] Error at 'getStatusAndUpdateCharacteristics'. Error: Unknown password encryption method
    at TAPOCamera.getHashedPassword (/var/lib/homebridge/node_modules/homebridge-tapo-camera/src/tapoCamera.ts:88:13)
    at TAPOCamera.refreshStok (/var/lib/homebridge/node_modules/homebridge-tapo-camera/src/tapoCamera.ts:175:28)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
    at TAPOCamera.getAuthenticatedAPIURL (/var/lib/homebridge/node_modules/homebridge-tapo-camera/src/tapoCamera.ts:339:19)
    at /var/lib/homebridge/node_modules/homebridge-tapo-camera/src/tapoCamera.ts:419:23
    at TAPOCamera.getStatus (/var/lib/homebridge/node_modules/homebridge-tapo-camera/src/tapoCamera.ts:559: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
[30/11/2023, 19:28:06] Camera A497 is running on port 44859.
[30/11/2023, 19:28:06] Please add [Camera A497] manually in Home app. Setup Code: 667-13-451

[30/11/2023, 19:28:17] TypeError: callback.call is not a function
    at Cam.<anonymous> (/var/lib/homebridge/node_modules/homebridge-tapo-camera/node_modules/onvif/lib/events.js:309:14)
    at parseSOAPString (/var/lib/homebridge/node_modules/homebridge-tapo-camera/node_modules/onvif/lib/utils.js:108:3)
    at IncomingMessage.<anonymous> (/var/lib/homebridge/node_modules/homebridge-tapo-camera/node_modules/onvif/lib/cam.js:297:4)
    at IncomingMessage.emit (node:events:529:35)
    at endReadableNT (node:internal/streams/readable:1368:12)
    at processTicksAndRejections (node:internal/process/task_queues:82:21)
[30/11/2023, 19:28:17] Got SIGTERM, shutting down Homebridge...
[30/11/2023, 19:28:22] [HB Supervisor] Homebridge Process Ended. Code: 143, Signal: null
[30/11/2023, 19:28:27] [HB Supervisor] Restarting Homebridge...

Plugin Config:

{
  "cameras": [
    {
      "name": "Camera",
      "ipAddress": "192.168.0.15",
      "password": "super secret",
      "streamUser": "username",
      "streamPassword": "extrasecret",
      "privacyAccessoryName": "Eyes",
      "alarmAccessoryName": "Alarm"
    }
  ],
  "platform": "tapo-camera"
}

Environment:

kopiro commented 7 months ago

Can you try https://github.com/kopiro/homebridge-tapo-camera/releases/tag/v2.3.2

n850903 commented 7 months ago

Same firmware version here, just installed v2.3.2, can confirm that homebridge still restarts about every minute. The rtsp link seems to be working fine, same with motion sensor and eye switch. But the feed just wouldn't show up. Also noticed the port seem to be changing too. Logs:

[11/30/2023, 9:41:17 PM] [tapo-camera] StokRefresh: Using secure connection [11/30/2023, 9:41:17 PM] [tapo-camera] StokRefresh: Login response :>> 200 {"result":{"data":{"code":-40401,"time":8,"max_time":10,"encrypt_type":["3"],"key":"MFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBAJ54CtZ0WdbvDEzCZnM1IpoRGs16RLcZc8EP/6utWiO55qjovzmngjr5kIJ0FD9W4u2Gn5jqnqceLgwhtvMJV+8CAwEAAQ==","nonce":"07D3B2CFA0E82E9E","device_confirm":"1511748D529C037A0CBDC6762469E82513416F534A4DCE2FB2EE3B23EB3FA99907D3B2CFA0E82E9E3676D8DB33108BBB"}},"error_code":-40413} [11/30/2023, 9:41:17 PM] [tapo-camera] StokRefresh: Start_seq response :>> 200 {"result":{"user_group":"root","stok":"kTu18rInMT~uuuuTTHmuAue0xAyw~HIu","start_seq":490},"error_code":0} [11/30/2023, 9:41:17 PM] [tapo-camera] StokRefresh: Success :>> kTu18rInMT~uuuuTTHmuAue0xAyw~HIu [11/30/2023, 9:41:18 PM] [tapo-camera] API response 200 {"result":{"responses":[{"method":"getAlertConfig","result":{"msg_alarm":{"chn1_msg_alarm_info":{"enabled":"off","light_alarm_enabled":"on","alarm_mode":["light","sound"],"alarm_type":"0","light_type":"1","sound_alarm_enabled":"on","alarm_volume":"high","alarm_duration":"0"}}},"error_code":0},{"method":"getLensMaskConfig","result":{"lens_mask":{"lens_mask_info":{"enabled":"off"}}},"error_code":0}]},"error_code":0} [11/30/2023, 9:41:18 PM] [tapo-camera] Updating characteristics { alert: false, lensMask: false } [11/30/2023, 9:41:18 PM] Publishing external accessory (name: C225, publishInfo: { username: 'AC:91:0B:D9:9E:CE', pincode: '*-*-', category: 17, port: undefined, bind: undefined, mdns: undefined, addIdentifyingMaterial: true, advertiser: undefined }). [11/30/2023, 9:41:18 PM] C225 79C5 is running on port 40740. [11/30/2023, 9:41:18 PM] Please add [C225 79C5] manually in Home app. Setup Code: 972-47-906 [11/30/2023, 9:41:18 PM] [tapo-camera] [C225] Setup polling [11/30/2023, 9:41:27 PM] [tapo-camera] [C225] Motion detected true [11/30/2023, 9:41:28 PM] [tapo-camera] [C225] Motion detected false

z0gst commented 7 months ago

Can you try https://github.com/kopiro/homebridge-tapo-camera/releases/tag/v2.3.2

No change, unfortunately still getting the same errors.

bonesoul commented 7 months ago

same issue here, after the update i can't use my tapo camera anymore. I'm using C320WS and I checked my credentials with VLC and the camera is working latest firmware. But no luck even with 2.3.2.