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

[Bug] Unexpected error when connecting too fast. #737

Closed
laurensvalk opened this issue Oct 18, 2022 · 6 comments
Closed

[Bug] Unexpected error when connecting too fast. #737

laurensvalk opened this issue Oct 18, 2022 · 6 comments
Labels
bug Something isn't working software: pybricks-code Issues with https://code.pybricks.com application topic: bluetooth Issues involving bluetooth

Comments

@laurensvalk
Copy link
Member

Original issue
When connecting to a hub after turning it on, there is often a Bluetooth error. Trying again fixes it.

This has happened for as long as I remember, but reproducing it has been an issue.

Reproducible variant
When quickly connecting to a hub after disconnecting, there is often a Bluetooth error. Trying again fixes it.

This seems quite similar.

To reproduce

The following is done with an Inventor Hub with the latest firmware, but I have previously seen this happen with all hubs.

Screencast.from.18-10-22.09.38.10.webm

Is it possible to wait a while for getPrimaryService to get ready?

@laurensvalk laurensvalk added bug Something isn't working topic: bluetooth Issues involving bluetooth software: pybricks-code Issues with https://code.pybricks.com application labels Oct 18, 2022
@dlech
Copy link
Member

dlech commented Oct 18, 2022

What operating system are you using? We have quite a few reports already for this error on Windows.

We've already added a 1 second delay in pybricks/pybricks-code@a869675 to try to work around this.

Can you include Wireshark logs, D-Bus logs, etc?

@laurensvalk
Copy link
Member Author

Ubuntu 22.04.

I might be able to get logs on Thursday or Friday.

@dlech
Copy link
Member

dlech commented Oct 21, 2022

Does pybricks/pybricks-micropython@1815b8e make a difference?

@laurensvalk
Copy link
Member Author

laurensvalk commented Oct 21, 2022

Does pybricks/pybricks-micropython@1815b8e make a difference?

Doesn't seem like it.

It does seem to be triggered way less often, or even solved entirely*. I'll keep an eye out for it today.

*There's a slight UX issue remaining, so I'll post that over in #600

@laurensvalk
Copy link
Member Author

laurensvalk commented Oct 21, 2022

We've already added a 1 second delay in pybricks/pybricks-code@a869675 to try to work around this.

Interestingly, even a 10 second delay here doesn't help.

By contrast, waiting 10 seconds before clicking the button always works.

@dlech
Copy link
Member

dlech commented Oct 26, 2022

Since we have made an improvement, should we call this good enough and close the issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working software: pybricks-code Issues with https://code.pybricks.com application topic: bluetooth Issues involving bluetooth
Projects
None yet
Development

No branches or pull requests

2 participants