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

BLE connection gives an exception: Cannot read property 'localName' of undefined #7

Closed
koktaildotcom opened this issue Dec 10, 2018 · 16 comments
Assignees
Labels
bug Something isn't working
Milestone

Comments

@koktaildotcom
Copy link

TypeError: Cannot read property 'localName' of undefined
    at new BleAdvertisement (/opt/homey-client/system/manager/ManagerApps/bootstrap/sdk/v2/lib/BleAdvertisement.js:1:369)
    at ManagerBLE.__createAdvertisementInstance (/opt/homey-client/system/manager/ManagerApps/bootstrap/sdk/v2/manager/ble.js:1:1220)
    at __advertisementsByPeripheralUUID.(anonymous function).__client.emit.then.e (/opt/homey-client/system/manager/ManagerApps/bootstrap/sdk/v2/manager/ble.js:1:1089)
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:189:7)
@WeeJeWel
Copy link

Fixed in Homey v2.0.0-rc.3

@koktaildotcom
Copy link
Author

This is not fixed in v2.0.0-rc.3

@WeeJeWel WeeJeWel reopened this Dec 12, 2018
@WeeJeWel
Copy link

Can you share more code when this happens?

@koktaildotcom
Copy link
Author

koktaildotcom commented Dec 12, 2018

When i'm trying to find an BleAdvertisement from the ManagerBLE.

where let uuid = <string>

Homey.ManagerBLE.find(uuid).then(function (advertisement) {
    return advertisement;
});

@koktaildotcom
Copy link
Author

Sorry. The update to rc3 was failed and i've retested it on rc2.

@WeeJeWel
Copy link

No problem!

@koktaildotcom
Copy link
Author

This issue is back at v2.0.0-rc.8

@koktaildotcom koktaildotcom reopened this Dec 21, 2018
@koktaildotcom
Copy link
Author

koktaildotcom commented Dec 21, 2018

I've added the code where this happens to: https://github.com/koktaildotcom/homey-mi-flora/tree/feature/ble-advertisement-exception.

note: Due to compatibility to 2.0 i've added BLE permissions. They should be removed to be compatible with < 2.0

@koktaildotcom
Copy link
Author

@WeeJeWel any idea when you can take a look at this issue?

koktaildotcom added a commit to koktaildotcom/homey-mi-flora that referenced this issue Jan 11, 2019
  * trigger flows static thought the app (best practice 2.0)
  * rewrite the update sequence part for better performance
  * try to resolve issue with bug athombv/homey-apps-sdk-issues#11
  * try to resolve issue with bug athombv/homey-apps-sdk-issues#7
  * fixed typo bug `true` => `this` in the `Homey.FlowCardTriggerDevice`
@koktaildotcom
Copy link
Author

Still an issue with 2.0.0

@WeeJeWel
Copy link

This has been fixed in Homey v2.0.5. Thank you for reporting!

@WeeJeWel WeeJeWel self-assigned this Feb 28, 2019
@WeeJeWel WeeJeWel added bug Something isn't working fixed labels Feb 28, 2019
@WeeJeWel WeeJeWel added this to the Homey v2.0.5 milestone Feb 28, 2019
@koktaildotcom
Copy link
Author

This is still an issue on Homey 2.0.5

@WeeJeWel WeeJeWel reopened this Mar 4, 2019
@WeeJeWel
Copy link

WeeJeWel commented Mar 5, 2019

Can you provide a reproduction path?

@koktaildotcom
Copy link
Author

Looks related to: #73

@koktaildotcom
Copy link
Author

Can you provide a reproduction path?

  1. Checkout: https://github.com/koktaildotcom/homey-mi-flora/tree/feature/ble-advertisement-exception. and run the code.
  2. Set the update interval to 1000 here: https://github.com/koktaildotcom/homey-mi-flora/blob/ddac6bebc3417fc00733065b2df2d4a012eadb49/lib/MiFloraDriver.js#L61 (otherwise you need to wait it out)
  3. Add a new device
  4. Wait until the second iteration kicks in, this is the point the error occur.

@WeeJeWel
Copy link

WeeJeWel commented Mar 8, 2019

Thank you! That helped a lot. I'm 100% sure I found the issue and fixed it in Homey v2.0.5-rc.5.

@WeeJeWel WeeJeWel closed this as completed Mar 8, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Development

No branches or pull requests

2 participants