-
-
Notifications
You must be signed in to change notification settings - Fork 7
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 for unknown reasons. with Spike Prime Hub #740
Comments
What operating system are you using? Can you click the Copy Error Message button and paste the error here so we can see the full error? |
I'm on Mac OSX 12.4 (M1-based) with Chrome 106.0.5249.119. Here's from the copy error message:
|
This is in the middle of big revisions to the Bluetooth code. Before digging into this, you may want to try:
|
Thanks @laurensvalk for responding so quickly! As I mentioned, the previous commit (ed2e584) worked without problems. And yes, I did try the latest version of the master branch (which also does not work) -- that was what failed for me first so I decided to find the earliest commit that cause this to break (b83536e). FWIW, I also tried pybricks/pybricks-micropython@b83536e against pybricks/pybricks-code@81d52db and it did not work either. |
Right, anything before those Bluetooth changes is supposed to work with https://beta.pybricks.com/ up to today.
No matching Pybricks Code version was released (or even pushed) at the time, I think. But since you are able to run Pybricks Code locally, it would be great if you want to try the latest version of the master branches of both, together. To be specific, e.g.: pybricks/pybricks-micropython@57efb61 with pybricks/pybricks-code@7e726ff I've been running those all day today. Would be great to know if the issue persists in that case. Thanks! |
Just tried pybricks/pybricks-micropython@57efb61 with pybricks/pybricks-code@7e726ff still not working:
|
Can you do a Bluetooth packet capture as described at https://bleak.readthedocs.io/en/latest/troubleshooting.html#macos while trying to connect? We changed the layout of the GATT attributes on the device and I have a hunch that macOS may be serving up a cached attribute database instead of reading it from the hub. |
Sure, here's the capture from PacketLogger: |
@dlech I think your hunch is correct. I cleared my Bluetooth cache and it seemed to work now: https://stackoverflow.com/questions/20553957/how-can-i-clear-the-corebluetooth-cache-on-macos |
Bummer... spoke too soon. Now the Bluetooth connects but the hub seems to crash and reset when I try to open up the interactive Python session. |
Thanks! I'm working on a fix to use random Bluetooth addresses to avoid the caching issues. The REPL issue is also being worked on in #741. |
REPL shouldn't currently crash, so feel free to open an issue if that persists. |
Thanks for testing on the cutting edge. Hopefully it doesn't spoil your first impression of Pybricks 😅 . |
See #744 (comment) for workaround. |
It seems like this issue is resolved. Let us know if it isn't. |
I get the same error (randomly but not always) while running the following code on the robot inventor hub. Mac OS: Ventura 13.2 (running Intel i5) Code being run
Error message
|
I was making a screencast to show folks how to use pybricks at the same time. It seems the error only happens when the screencast software is also running (OBS studio). |
Describe the bug
After upgrading pybricks-micropython to b83536e69693e64e312343ec6b9a79c513fdc24f, when I try to use bluetooth to connect on code, I get an error GATT operation failed for unknown reason. The previous commit at ed2e5849f52211f0e3e98d269e861c4fb08752c2 seems to work fine.
To reproduce
Steps to reproduce the behavior:
Expected behavior
The editor should have connected to the hub via bluetooth.
Screenshots
The text was updated successfully, but these errors were encountered: