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

micro:bit - Scratch app not able to connect via Bluetooth with newer Chromebook #8324

Open
martinwork opened this issue May 4, 2024 · 11 comments

Comments

@martinwork
Copy link

martinwork commented May 4, 2024

Expected Behavior

Scratch can connect to micro:bit via Bluetooth

Actual Behavior

Scratch fails to connect to micro:bit via Bluetooth.

Tested on Android 14 tablet, multiple Chromebooks with Android 13 and 9.

It works on the Chromebooks with Android 9, but not on any device tested with Android 13 or 14.

We checked Android location is on.

Steps to Reproduce

Explain what someone needs to do in order to see what's described in Actual behavior above

Steps to reproduce the behavior:

  1. Load Scratch app
  2. Click/tap on the extensions button
  3. Click/tap the micro:bit extension
  4. See error

System Details

If the problem occurs in the browser, please provide operating system and browser e.g. Mac OS 10.11.6 Safari 10.0

If using one of the Apps please provide the app version and device details, e.g. Scratch 3.0.57, Android 9 on HP x360 Chromebook

Scratch 3.0.66, Chromebooks with Android 13.

Screenshots
If applicable, add screenshots to help explain your problem.

@martinwork
Copy link
Author

@cwillisf Am I posting in the right place for this issue and #8286

@martinwork
Copy link
Author

@cwillisf
Copy link
Contributor

cwillisf commented May 7, 2024

Sorry for the trouble! Thanks for providing details. I can't promise when we'll be able to fix this, but knowing that this seems to be related to newer versions of Android should help quite a bit.

Am I posting in the right place

The best place for individual support is the "Contact Us" form on our website. GitHub Issues is a good place to report a software defect or incompatibility. For this issue in particular, I think this is a fine place to post. Thanks!

@martinwork
Copy link
Author

Thanks @cwillisf Micro:bit Foundation Help & Support has received multiple enquiries from teachers trying to use Scratch on Chromebooks. Before realising this was probably the right place to post, I sent a message on the "Contact us" form at the end of April.

@cwillisf
Copy link
Contributor

I've tested a number of situations on my end; you can see my results in the table below.

Note that the very first scan causes a permission prompt in all circumstances, and even if the user picks "Allow," that scan will not work correctly. The behavior listed below corresponds to a second scan, after choosing "Allow." We should certainly refine that experience, but I'll track that as a separate issue.

Device Android Version Behavior
Samsung Tablet Android 13 (Samsung One UI) Works correctly
Simulated Android Tablet (AVD) Android 13 Works correctly (AVD)
Simulated Android Tablet (AVD) Android 14 Works correctly (AVD)
Simulated Android Desktop (AVD) Android 13 Works correctly (AVD)
Chromebook Android 13 Does not display CDM
  • "Works correctly" means that the CDM device selection menu is displayed, I'm able to select a micro:bit from that menu, and I can connect to that micro:bit and use it in Scratch.
  • "Works correctly (AVD)" means that the CDM device selection menu is displayed. The AVD emulation does not allow me to check actual device connection, but it gets at least this far.
  • "Does not display CDM" means that the CDM device selection menu does not appear. Nothing appears to happen when the scan is initiated.

Interestingly, the official Android sample code exhibits the same behavior: it correctly displays the CDM device selection menu except for on my Chromebook.

There are no errors emitted to the logs, so it's not clear to me what's going wrong. More investigation needed.

@martinwork, are you aware of any application that can connect to a micro:bit on Android 13 or higher while running on a Chromebook? Even without source code, I could check for differences in our permissions requests and such.

@cwillisf
Copy link
Contributor

It's worth noting that none of this behavior seems specific to micro:bit -- other BT and BLE extensions are affected as well.

@martinwork
Copy link
Author

@cwillisf Thanks for testing.

@martinwork, are you aware of any application that can connect to a micro:bit on Android 13 or higher while running on a Chromebook? Even without source code, I could check for differences in our permissions requests and such.

No. I must see if I can get access to a recent Chromebook. The example video I have seen did not produce the device selection menu, so matches what you see.

It's worth noting that none of this behavior seems specific to micro:bit -- other BT and BLE extensions are affected as well.

Thanks for that!

After more testing with my Samsung Android 14 tablet, I am able to connect Scratch to micro:bit. Scratch fails to connect if the micro:bit had been paired before the scratch-microbit hex was transferred. In that case I see "Choose a device to be managed by Scratch", but then "Oops, looks like something went wrong.", or it hangs on connecting. It's fine after the micro:bit is unpaired.

@martinwork martinwork changed the title micro:bit - Scratch app not able to connect via Bluetooth with newer Android on tablet or Chromebook micro:bit - Scratch app not able to connect via Bluetooth with newer Chromebook May 16, 2024
@cwillisf
Copy link
Contributor

Scratch fails to connect if the micro:bit had been paired before the scratch-microbit hex was transferred.

Oh, interesting! I'm not sure we'll be able to do anything about that, but it's worth a look next time I'm in there. Thanks!

@martinwork
Copy link
Author

@cwillisf Yes, I fell foul of the pairing issue on my PC yesterday, despite knowing about it, and it being mentioned in the Foundation's guide under Troubleshooting!
https://support.microbit.org/en/support/solutions/articles/19000026080-using-the-micro-bit-with-scratch

I'm not sure what the Bluetooth error is in other systems, but in iOS, there's a specific error code: something like "Peer removed pairing information".

I suppose it's difficult to customise or expand the Oops message to include a clue about what actually went wrong?

@martinwork
Copy link
Author

@cwillisf Has there been any progress? We have received another report about Chromebooks with Android 13.

@martinwork
Copy link
Author

Reported in Micro:bit Educational Foundation support ticket 82581 (private)

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