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

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

Closed
nin9s opened this issue Oct 25, 2020 · 16 comments
Closed

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

nin9s opened this issue Oct 25, 2020 · 16 comments

Comments

@nin9s
Copy link

nin9s commented Oct 25, 2020

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
Copy link
Owner

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
Copy link

neigsti commented Oct 25, 2020

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
Copy link
Author

nin9s commented Oct 25, 2020

unfortunately the issue remains the same with 3.5.5

@colinbendell
Copy link
Owner

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
Copy link
Owner

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

@nin9s
Copy link
Author

nin9s commented Oct 25, 2020

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
Copy link
Owner

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
Copy link

neigsti commented Oct 25, 2020

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
Copy link
Owner

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
Copy link
Author

nin9s commented Oct 26, 2020

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
Copy link

ratsoid commented Oct 26, 2020

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

@colinbendell
Copy link
Owner

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
Copy link
Owner

I believe this issue has been resolved?

@nin9s nin9s closed this as completed Oct 31, 2020
@neigsti
Copy link

neigsti commented Oct 31, 2020

@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
Copy link
Owner

colinbendell commented Oct 31, 2020 via email

@neigsti
Copy link

neigsti commented Oct 31, 2020

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants