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 driver issues #13

Closed
AuspeXeu opened this issue Apr 15, 2020 · 21 comments
Closed

BLE driver issues #13

AuspeXeu opened this issue Apr 15, 2020 · 21 comments

Comments

@AuspeXeu
Copy link
Contributor

AuspeXeu commented Apr 15, 2020

I am having a lot of issues with the BLE driver it seems. After connecting I get this log message a lot NotSupportedError: GATT operation failed for unknown reason. After a while it will transmit partial data from the PM5. However not everything there should be and I also get tons of this logged. wrong csafe frame ending.

Any thoughts how to zero in on this bug?

It seems like this might be related: https://bugs.chromium.org/p/chromium/issues/detail?id=664863

@tijmenvangulik
Copy link
Owner

tijmenvangulik commented Apr 15, 2020 via email

@AuspeXeu
Copy link
Contributor Author

AuspeXeu commented Apr 15, 2020

I am trying to use the BLE driver on the web. Hardware is my computer which has bluetooth and I am doing that inside chrome.

According to the link I attached in my first comment, it seems like you should serialize the calls to startNotifications.

@tijmenvangulik
Copy link
Owner

tijmenvangulik commented Apr 15, 2020 via email

@AuspeXeu
Copy link
Contributor Author

AuspeXeu commented Apr 15, 2020

Windows 10, chrome 81.

@tijmenvangulik
Copy link
Owner

tijmenvangulik commented Apr 15, 2020 via email

@tijmenvangulik
Copy link
Owner

tijmenvangulik commented Apr 15, 2020 via email

@AuspeXeu
Copy link
Contributor Author

It's localhost. Ergometer-space.org has the same issues it seems.

@tijmenvangulik
Copy link
Owner

tijmenvangulik commented Apr 15, 2020 via email

@AuspeXeu
Copy link
Contributor Author

Well ... according to the link, in case you haven't had a chance to look at it. It can cause issues if the startNotifications commands are called in parallel instead of in sequence. And I checked your code, you're doing them all at once.

@tijmenvangulik
Copy link
Owner

tijmenvangulik commented Apr 15, 2020 via email

@AuspeXeu
Copy link
Contributor Author

Well, your promiseAllSync does not actually serialize the execution of the promises. they are just awaited in a different way. The execution is started upon new Promise which is before the promiseAllSync call.

@tijmenvangulik
Copy link
Owner

tijmenvangulik commented Apr 16, 2020 via email

@tijmenvangulik
Copy link
Owner

tijmenvangulik commented Apr 16, 2020 via email

@AuspeXeu
Copy link
Contributor Author

AuspeXeu commented Apr 16, 2020

This is not correct. The promise code starts executing immediately after the promise is instantiated. The then code simply means this is called after the promise finished. I have a small fix in my version right now which I'll be trying out today and see if it helps.

Edit: Just try the following code. By your logic, none of the code inside the promises should run, since we don't use any then.

for(let i = 0; i < 10; i++) {
  new Promise(() => console.log(i))
}

@AuspeXeu
Copy link
Contributor Author

Yeah, so this still seems unresolved for me. I tried to run this on my Android phone. and am getting these weird GATT errors.

@tijmenvangulik
Copy link
Owner

tijmenvangulik commented Apr 20, 2020 via email

@AuspeXeu
Copy link
Contributor Author

It is a fairly old phone. You have the latest version from the git repo running on your erg space, no?

@tijmenvangulik
Copy link
Owner

tijmenvangulik commented Apr 20, 2020 via email

@tijmenvangulik
Copy link
Owner

I could for the first time repeat the connection problems. Hopefully I can now debug and fix this.

@tijmenvangulik
Copy link
Owner

I have published a fix for multi plex mode for android. You can turn on this mode and then it should compensate for limited blue tooth hard ware.

@AuspeXeu AuspeXeu closed this as completed Nov 7, 2020
@AuspeXeu
Copy link
Contributor Author

AuspeXeu commented Nov 7, 2020

Thanks

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

2 participants