colinbendell / homebridge-blink-for-home

Blink For Home Camera Homebridge plugin
MIT License
88 stars 27 forks source link

TypeError: Cannot read property 'fw_version' of undefined #2

Closed nin9s closed 3 years ago

nin9s commented 3 years ago

first of all, thanks for your effort! Account and 2fa pin successfully validated but then the following happens after a restart of homebridge.

10/25/2020, 3:00:36 PM] [Home] TypeError: Cannot read property 'fw_version' of undefined
    at BlinkNetwork.get firmware [as firmware] (/homebridge/node_modules/homebridge-blink-for-home/src/blink.js:107:50)
    at BlinkNetwork.createAccessory (/homebridge/node_modules/homebridge-blink-for-home/src/blink.js:89:70)
    at BlinkNetwork.createAccessory (/homebridge/node_modules/homebridge-blink-for-home/src/blink.js:142:15)
    at /homebridge/node_modules/homebridge-blink-for-home/src/index.js:54:60
    at Array.map (<anonymous>)
    at HomebridgeBlink.init (/homebridge/node_modules/homebridge-blink-for-home/src/index.js:54:41)
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
[10/25/2020, 3:00:36 PM] [Home] NOTE: Blink devices in HomeKit will not be responsive.
colinbendell commented 3 years ago

Yea, I did a bunch of last minute refactoring to manually downshift from ES2020 to node 12 compat which was my downfall. Can you update to 3.5.5 and verify?

neigsti commented 3 years ago

I'm running HomeBridge in Docker, so I loaded version 3.5.5 and have the same issue @nin9s reported above, yet the 3.5.5 version did not seem to resolve. Happy to provide any additional information as needed, just let me know.

nin9s commented 3 years ago

unfortunately the issue remains the same with 3.5.5

colinbendell commented 3 years ago

What blink hardware are you using? This looks like a schema difference in the API. Can you turn on debug mode and share with me the output from the /network/{networkID}/camera/{cameraID} and api/v3/accounts/{accountID}/homescreen?

colinbendell commented 3 years ago

Specifically, do you have a sync-module with your setup?

nin9s commented 3 years ago

its a blink mini and there is no sync module. there does not seem to be /network/{networkID}/camera/{cameraID} in the debug but you may find this useful anyway?

10/25/2020, 11:52:45 PM] [Home] {"account":{"id":61736,"verification_required":false,"new_account":false},"client":{"id":166279,"verification_required":false},"authtoken":{"authtoken":"YHhQqCv2cOYz5JzTcB2llQ","message":"auth"},"region":{"tier":"e003","description":"Europe","code":"eu"},"lockout_time_remaining":0,"force_password_reset":false,"allow_pin_resend_seconds":60}
[10/25/2020, 11:52:45 PM] [Home] GET /api/v3/accounts/61736/homescreen
[10/25/2020, 11:52:45 PM] [Home] {
  method: 'GET',
  headers: {
    'User-Agent': 'Blink/8854 CFNetwork/1202 Darwin/20.1.0',
    'app-build': 'IOS_8854',
    Locale: 'en_US',
    'accept-language': 'en_US',
    Accept: '*/*',
    TOKEN_AUTH: 'YHhQqCv2cOYz5JzTcB2llQ'
  }
}
[10/25/2020, 11:52:45 PM] [Home] {
  connection: 'close',
  'content-encoding': 'gzip',
  'content-type': 'application/json',
  date: 'Sun, 25 Oct 2020 22:52:45 GMT',
  server: 'nginx + Phusion Passenger',
  status: '200 OK',
  'transfer-encoding': 'chunked',
  vary: 'Accept-Encoding',
  via: '1.1 97101640da3dcba7a2d4a3d67a31b115.cloudfront.net (CloudFront)',
  'x-amz-cf-id': 'CDeRCY03FsLCnaGcvSAnhVwQM_K0vwGmlRqTlEGzp-CX2vgki-v1Pw==',
  'x-amz-cf-pop': 'PRG50-C1',
  'x-blink-served-by': 'i-01134b401b7d56d2c',
  'x-cache': 'Miss from cloudfront',
  'x-content-type-options': 'nosniff',
  'x-powered-by': 'Phusion Passenger'
}
[10/25/2020, 11:52:45 PM] [Home] {"account":{"id":61736,"email_verified":true,"email_verification_required":true},"networks":[{"id":66418,"created_at":"2020-10-16T15:27:44+00:00","updated_at":"2020-10-24T14:06:18+00:00","name":"Home","time_zone":"Europe/Vienna","dst":true,"armed":false,"lv_save":false}],"sync_modules":[],"cameras":[],"sirens":[],"chimes":[],"video_stats":{"storage":1,"auto_delete_days":3,"auto_delete_day_options":[3,7,14,30,365]},"doorbell_buttons":[],"owls":[{"id":65959,"created_at":"2020-10-16T17:04:12+00:00","updated_at":"2020-10-24T14:40:55+00:00","name":"G8T1-9400-0164-0C2C","type":"owl","onboarded":true,"serial":"G8T1940001640C2C","fw_version":"9.63","enabled":false,"thumbnail":"/media/e003/account/61736/network/66418/owl/65959/thumbnail/fw_9.63___g2OQ4qQ_2020_10_20__12_06PM","status":"online","network_id":66418,"local_storage_enabled":false,"local_storage_compatible":false}],"app_updates":{"message":"OK","code":103,"update_available":false,"update_required":false},"device_limits":{"camera":10,"chime":5,"doorbell_button":2,"owl":10,"siren":5,"total_devices":20},"whats_new":{"updated_at":20200924,"url":"https://updates.blinkforhome.com/"}}
[10/25/2020, 11:52:45 PM] [Home] initing Blink:Network:66418
[10/25/2020, 11:52:45 PM] [Home] TypeError: Cannot read property 'fw_version' of undefined
    at BlinkNetwork.get firmware [as firmware] (/homebridge/node_modules/homebridge-blink-for-home/src/blink.js:115:50)
    at BlinkNetwork.createAccessory (/homebridge/node_modules/homebridge-blink-for-home/src/blink.js:92:70)
    at BlinkNetwork.createAccessory (/homebridge/node_modules/homebridge-blink-for-home/src/blink.js:165:15)
    at /homebridge/node_modules/homebridge-blink-for-home/src/index.js:53:60
    at Array.map (<anonymous>)
    at HomebridgeBlink.init (/homebridge/node_modules/homebridge-blink-for-home/src/index.js:53:41)
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
[10/25/2020, 11:52:45 PM] [Home] NOTE: Blink devices in HomeKit will not be responsive.
colinbendell commented 3 years ago

This is helpful. I don't have any mini's to test with but I think I can get you operational with minor updates to the code. (The mini's use a slightly different API)

neigsti commented 3 years ago

I’ll have to test this later but wanted to comment I only have a Blink Mini at this time. Seems to be consistent with @nin9s

colinbendell commented 3 years ago

I might have to build a quick debug tool to capture the different API responses for the different hardware. That said, I think I might have a 'good enough' solution for the mini's. (most of APIs for the mini's just use /owls instead of /cameras) I'll publish later for testing.

nin9s commented 3 years ago

Now the camera is visible in homekit and sometimes (not sure when exactly) updating images. However live view as a stream is not working.

image

ratsoid commented 3 years ago

same as @nin9s . I'm seeing the no signal splash even if LiveView is enabled or disabled. This might still be WIP though 👍

colinbendell commented 3 years ago

Yes. Liveview is absolutely broken right now and I probably won't be able to get back to it for another week. (I'm hoping that the protocol is the same for the mini's so might need some low level debugging support from you)

Thumbnails refresh every 10min unless you turn off the battery saver then they will refresh every 1min. There does appear to be some weirdness in the frequency in the UI refresh which might be some kind of race condition that I'm not fully comprehending.

colinbendell commented 3 years ago

I believe this issue has been resolved?

neigsti commented 3 years ago

@colinbendell I'm still getting the same (Original) error, using version 3.5.5. Is there a newer version than 3.5.5? I run HomeBridge in a Docker and have it pull the latest version and it still seems to pull 3.5.5. I have a Blink account with ONLY a Blink Mini at this time.

[10/31/2020, 6:38:12 AM] ---
[10/31/2020, 6:38:13 AM] Loaded plugin: homebridge-blink-for-home@3.5.5
[10/31/2020, 6:38:13 AM] Registering platform 'homebridge-blink-for-home.Blink'

[10/31/2020, 6:38:19 AM] [Blink] initing Blink:Network:26700
[10/31/2020, 6:38:19 AM] [Blink] TypeError: Cannot read property 'fw_version' of undefined
at BlinkNetwork.get firmware [as firmware] (/homebridge/node_modules/homebridge-blink-for-home/src/blink.j s:115:50)
at BlinkNetwork.createAccessory (/homebridge/node_modules/homebridge-blink-for-home/src/blink.js:92:70)
at BlinkNetwork.createAccessory (/homebridge/node_modules/homebridge-blink-for-home/src/blink.js:165:15)
at /homebridge/node_modules/homebridge-blink-for-home/src/index.js:53:60
at Array.map ()
at HomebridgeBlink.init (/homebridge/node_modules/homebridge-blink-for-home/src/index.js:53:41)
at processTicksAndRejections (internal/process/task_queues.js:97:5)
[10/31/2020, 6:38:19 AM] [Blink] NOTE: Blink devices in HomeKit will not be responsive.

colinbendell commented 3 years ago

3.5.11 is the latest

On Sat, Oct 31, 2020 at 07:51 neigsti notifications@github.com wrote:

@colinbendell https://github.com/colinbendell I'm still getting the same (Original) error, using version 3.5.5. Is there a newer version than 3.5.5? I run HomeBridge in a Docker and have it pull the latest version and it still seems to pull 3.5.5. I have a Blink account with ONLY a Blink Mini at this time.

[10/31/2020, 6:38:12 AM] --- [10/31/2020, 6:38:13 AM] Loaded plugin: homebridge-blink-for-home@3.5.5 [10/31/2020, 6:38:13 AM] Registering platform 'homebridge-blink-for-home.Blink'

[10/31/2020, 6:38:19 AM] [Blink] initing Blink:Network:26700 [10/31/2020, 6:38:19 AM] [Blink] TypeError: Cannot read property 'fw_version' of undefined at BlinkNetwork.get firmware [as firmware] (/homebridge/node_modules/homebridge-blink-for-home/src/blink.j s:115:50) at BlinkNetwork.createAccessory (/homebridge/node_modules/homebridge-blink-for-home/src/blink.js:92:70) at BlinkNetwork.createAccessory (/homebridge/node_modules/homebridge-blink-for-home/src/blink.js:165:15) at /homebridge/node_modules/homebridge-blink-for-home/src/index.js:53:60 at Array.map () at HomebridgeBlink.init (/homebridge/node_modules/homebridge-blink-for-home/src/index.js:53:41) at processTicksAndRejections (internal/process/task_queues.js:97:5) [10/31/2020, 6:38:19 AM] [Blink] NOTE: Blink devices in HomeKit will not be responsive.

— You are receiving this because you were mentioned.

Reply to this email directly, view it on GitHub https://github.com/colinbendell/homebridge-blink-for-home/issues/2#issuecomment-719923436, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAMMERIW5CR6FPAE4VUUKGLSNP24TANCNFSM4S6LFM5Q .

neigsti commented 3 years ago

@colinbendell You're right. Not sure why my Docker is not pulling the latest and greatest version when I have it set to - but that's not your problem! :)

Thanks for pointing that out.