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] GATT operation failed on macOS in Pybricks Code when using other Bluetooth devices at the same time #938

Open
mrinalraghupathi opened this issue Feb 4, 2023 · 4 comments
Labels
OS: macOS Issues that only occur on macOS software: pybricks-code Issues with https://code.pybricks.com application topic: bluetooth Issues involving bluetooth

Comments

@mrinalraghupathi
Copy link

Describe the bug
I am running Mac OS 13.2 Ventura and Chrome 109.0.5414.119 and this is a 2017 Macbook pro with an intel i5.

I am also creating a screencast at the same time of the pybricks app and running the code below. When I run it I get the error

GATT operation failed for unknown reason.

I only get this error when the other screencasting software (OBS) is recording. Not sure why?

To reproduce
Steps to reproduce the behavior:

Open OBS and start a screen recording of the pybricks application.

Run the following code in pybricks

from pybricks.hubs import InventorHub
from pybricks.pupdevices import Motor, ColorSensor, UltrasonicSensor
from pybricks.parameters import Button, Color, Direction, Port, Side, Stop
from pybricks.robotics import DriveBase
from pybricks.tools import wait, StopWatch

hub = InventorHub()

hub.light.on(color=Color.RED)

wait(1000)

Expected behavior
Run without error (which is what happens when OBS is not running)

@mrinalraghupathi mrinalraghupathi added the triage Issues that have not been triaged yet label Feb 4, 2023
@laurensvalk
Copy link
Member

Thanks for reporting.

Does your computer have any other Bluetooth devices connected, like wireless speakers?

@dlech dlech added topic: bluetooth Issues involving bluetooth OS: macOS Issues that only occur on macOS software: pybricks-code Issues with https://code.pybricks.com application and removed triage Issues that have not been triaged yet labels Feb 4, 2023
@mrinalraghupathi
Copy link
Author

My MX ergo mouse is connected to my laptop and my apple mouse.

@dlech
Copy link
Member

dlech commented Feb 4, 2023

If you turn those off does it work?

To further troubleshoot we will need OS logs such as the Bluetooth packet capture described at https://bleak.readthedocs.io/en/latest/troubleshooting.html#macos

@mrinalraghupathi
Copy link
Author

Indeed turning off the MX ergo mouse and using just the apple mouse fixes the issue it seems. Tried the above run 10 times without error. So that seems to be my solve for now. Awesome. I will capture those logs as well and post so you have that to investigate.

@dlech dlech changed the title [Bug] GATT operation failed when screencasting with pybricks [Bug] GATT operation failed on macOS in Pybricks Code when using other Bluetooth devices at the same time Mar 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
OS: macOS Issues that only occur on macOS software: pybricks-code Issues with https://code.pybricks.com application topic: bluetooth Issues involving bluetooth
Projects
None yet
Development

No branches or pull requests

3 participants