microsoft / pxt-microbit

A Blocks / JavaScript code editor for the micro:bit built on Microsoft MakeCode
https://makecode.microbit.org
Other
721 stars 591 forks source link

Chrome not showing Connect device option for WebUSB #4914

Closed Jaqster closed 1 year ago

Jaqster commented 1 year ago

Issue reported by an educator. Windows 10, Chrome version 109. The download button isn't showing the "Connect device" option for WebUSB pairing. This works on Edge on the same computer. Enabled all WebUSB flags on Chrome.

king-of-kool commented 1 year ago

i know right so annoying

Coderisnice commented 1 year ago

Did you update the Microbit firmware?

martinwork commented 1 year ago

The connect option shows for me in Windows 10 Chrome 109. It doesn't seem to mind if the attached micro:bit has old firmware (tested 0234) or if there's no micro:bit attached.

king-of-kool commented 1 year ago

Did you update the Microbit firmware?

how do i do that

dsssssssss9 commented 1 year ago

Did you update the Microbit firmware?

how do i do that

Hi

Have you seen this article on how to identify & upgrade the firmware ?

https://microbit.org/get-started/user-guide/firmware/

jwunderl commented 1 year ago

The checks for displaying Connect Device are all done on the browser side, depending on whether the browser supports webusb, so upgrading firmware or not having a device detected would not affect it. Most likely, if they're running into trouble with only chrome (or only edge), it's probably been disabled by an admin policy; e.g.

You can check these on the policy page at by goin to chrome://policy and filtering for those related policies

If anyone is running into this issue and don't see any issues in the policy listing above, if you could

  1. go to https://makecode.microbit.org?dbg=1
  2. open the dev tools (through either the short cut F12 or ctrl+shift+i on window or cmd+shift+i on mac, or through the "..." menu like this: image
  3. Look at the bottom of the window that opens for a console, along with a message about webusb. The easiest way to do this is to use the 'filter' to look only for messages about webusb:

filtering console to webusb only

When webusb is enabled it should look like this:

image

On a device where webusb would not work, it should look like this, with a reason listed out:

image

The check goes through here https://github.com/microsoft/pxt/blob/master/pxtlib/webusb.ts#L537, and there are two possible ones that being hit with chrome: webusb: off, older windows version which shouldn't be the case here as it only occurs on windows versions below windows 8.1, or webusb: off, security exception if we are not able to interact with the webusb api due to policy restrictions.

jwunderl commented 1 year ago

I have added a button for chrome / edge that will be in beta soon that indicates what is causing webusb to be unavailable for these devices, so closing this. re: https://github.com/microsoft/pxt/pull/9500

king-of-kool commented 1 year ago

thank you guys this has really helped me. ❤️ thank you again guys!!! 🤩


From: Coderisnice @.> Sent: 08 February 2023 12:51 To: microsoft/pxt-microbit @.> Cc: king-of-kool @.>; Comment @.> Subject: Re: [microsoft/pxt-microbit] Chrome not showing Connect device option for WebUSB (Issue #4914)

Did you update the Microbit firmware?

— Reply to this email directly, view it on GitHubhttps://github.com/microsoft/pxt-microbit/issues/4914#issuecomment-1422546186, or unsubscribehttps://github.com/notifications/unsubscribe-auth/A5VBFT6N46DYZTJIYXODB73WWOJEBANCNFSM6AAAAAAT6ESL4Q. You are receiving this because you commented.Message ID: @.***>