pxt icon indicating copy to clipboard operation
pxt copied to clipboard

Bluetooth Download feature

Open pelikhan opened this issue 6 years ago • 42 comments

bluetoothpartialflashing

Description

Download code wirelessly via Web Bluetooth. Supported for micro:bit currently.

How to enable it?

  • Open a browser that supports Web Bluetooth. See https://caniuse.com/#feat=web-bluetooth. On Windows, you'll need Chrome 70+.
  • Go to the gearwheel menu and click on Pair Bluetooth
  • Select your device and pair
  • Press Download to start remote flashing.

If you cannot see that button and you editor supports this experiment, go to About, then click Experiments and Bluetooth Download. If you cannot see this card, your editor does not support yet this feature.

Known issues

Needs initial drag & drop

This feature only supports partial flashing now. This means that you need to first drag and drop a .hex file using the USB cable; then you'll be able to update that same scripts using Bluetooth.

Pairing issues in windows

Use the "No Pairing" setting in the Project Settings for Windows.

My micro:bit is stuck in pairing mode

Partial flashing failed to finish.

  • Drag and drop a .hex file via USB

My micro:bit won't start after failed partial flashing?

Feedback

Do you use this feature? Is there something you'd like to change? Did you encounter issues? Please drop a comment on this issue to send us your feedback.

pelikhan avatar Oct 12 '18 16:10 pelikhan

Is the function supported in android chrome?

  1. Microbit has a pairing-mode LED showing after press "Download" in macos 10.14.1 with chrome 70.0.3538.77
  2. Test in android 8.0.0, chrome 70.0.3538.80 has a stucking after press "Download", LED always no change. screenshot_20181104-083752

imhori avatar Nov 04 '18 00:11 imhori

Please try on https://makecode.microbit.org/beta

Get Outlook for iOShttps://aka.ms/o0ukef


From: u-hori [email protected] Sent: Saturday, November 3, 2018 5:52 PM To: Microsoft/pxt Cc: Peli de Halleux; Author Subject: Re: [Microsoft/pxt] Bluetooth Download feature (#4807)

Is the function supported in android chrome?

  1. Microbit has a pairing-mode LED showing after press "Download" in macos 10.14.1 with chrome 70.0.3538.77
  2. Test in android 8.0.0, chrome 70.0.3538.80 has a stucking after press "Download", LED always no change. [screenshot_20181104-083752]https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fuser-images.githubusercontent.com%2F41528875%2F47958775-4fa1ca80-e00d-11e8-9aac-d9a0a17f4047.jpg&data=02%7C01%7Cjhalleux%40microsoft.com%7Cae827a6b0866465544b008d641efc2cb%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636768895359644149&sdata=C1giAbsTNZAkjvYiozPVEg2nlPzyQ%2FDcMJvitkCgdzA%3D&reserved=0

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FMicrosoft%2Fpxt%2Fissues%2F4807%23issuecomment-435632815&data=02%7C01%7Cjhalleux%40microsoft.com%7Cae827a6b0866465544b008d641efc2cb%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636768895359654157&sdata=gBq%2BYj9F8cUiNeE68vLjRg%2FgkPOETvGCZkTZtwWiJ1I%3D&reserved=0, or mute the threadhttps://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAD-4KXOUa5snm6ygpl-ENdvjxCp6D4_oks5urjo9gaJpZM4XZy3B&data=02%7C01%7Cjhalleux%40microsoft.com%7Cae827a6b0866465544b008d641efc2cb%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636768895359654157&sdata=BOE%2B%2FokVGQ6Gqcqrdoz02ZLiAXUOtRfdtDnvgGPZS3E%3D&reserved=0.

pelikhan avatar Nov 04 '18 01:11 pelikhan

@pelikhan Use https://makecode.microbit.org/beta#editor has tha same result. And in beta, Macos also can't trigger a pairing-mode LED showing.

imhori avatar Nov 04 '18 01:11 imhori

Try going into “no pairing mode”. For the first flash, you need to do drag and drop. Still beta - UI needs love.

pelikhan avatar Nov 04 '18 01:11 pelikhan

Use https://makecode.microbit.org/beta?dbg=1 and open JavaScript console to see full logs

pelikhan avatar Nov 04 '18 01:11 pelikhan

https://twitter.com/krantas/status/1057996189981798400?s=21

pelikhan avatar Nov 04 '18 01:11 pelikhan

Use https://makecode.microbit.org/beta?dbg=1 and open JavaScript console to see full logs

Macos's console log for the first flash: pf: error USB flashing required

I got your hint and the Macos's bluetooth download was done normally in beta UI! Now I need a Type C to OTG converter for my android to next step...

imhori avatar Nov 04 '18 03:11 imhori

It is possible to flash the entire image but it takes much longer. Not supported yet.

pelikhan avatar Nov 04 '18 04:11 pelikhan

You can use the Android Microbit app for that.

pelikhan avatar Nov 04 '18 04:11 pelikhan

You can use the Android Microbit app for that.

Use android microbit app to wireless DFU download the makecode beta build no-pairing-mode's hex, but still has a stucking after press "Download", LED always no change.

imhori avatar Nov 04 '18 07:11 imhori

I buy a Type-C OTG wire and do testing the result re-flashing (partial is fast) with Bluetooth is workable, but no pairing-mode LED is shown in downloading. The usage difference in android from macos is the OTG wire has to be connected, otherwise beta UI will have a stuck after press "Download" as before. FYR~

imhori avatar Nov 04 '18 09:11 imhori

This would be a great option! I tried it but the code is not flashed to the micro:bit. These were my steps:

  • I enabled the experiment
  • I was able to connect to make a bluetooth connection bt1
  • I see the special pattern on the m:b
  • I uploaded the hex via USB to the m:b
  • I unplugged the USB-connection
  • I changed the script
  • I tried to upload it
  • Nothing happens, stil have the special pattern on the m:b

I am on Chrome 71.0.3578.98 and Windows 10

ChrisDorna avatar Jan 02 '19 16:01 ChrisDorna

Make sure to flash using USB at least once (we still need to support full flashing).

pelikhan avatar Jan 02 '19 16:01 pelikhan

Hi,

  • I built a program and saved it as a hex-file
  • From the Windows Explorer I copied the hex-file to the micro:bit (I suppose this is what you mean by full flashing)
  • I made the bluetooth connection with the micro:bit
  • Changed the program
  • Clicked the Download button -The color of the button changed for some seconds, but nothing happens on the micro:bit

ChrisDorna avatar Jan 03 '19 09:01 ChrisDorna

On windows, you need to enable the “no pairing” mode.

pelikhan avatar Jan 03 '19 15:01 pelikhan

I tried it on another micro:bit and it works! Both micro:bits have the same firmware...

ChrisDorna avatar Jan 04 '19 09:01 ChrisDorna

Are there different micro:bits? The first micro:bit didn't accept the code and the second did

ChrisDorna avatar Jan 07 '19 14:01 ChrisDorna

Could you add ?dbg=1 to the URL, open the javascript console (F12) and retry again. The output would be helpful to understand what's going on.

pelikhan avatar Jan 07 '19 16:01 pelikhan

This is the code on the micro:bit on which Bluetooth flashing does not work: snag_20185e32

And this is the code with the micro:bit where Bluetooth flashing works perfectly: snag_2019003f

ChrisDorna avatar Jan 08 '19 14:01 ChrisDorna

Yesterday we did some experiments with the same micro:bits on Scratch and the micro:bit that gives problems with the Bluetooth flashing also refused to connect with Scratch link.

The serial number on the micro:bit is 400854 1401 529826 1730 and the number on the back is V1.3B (which is th e same as on a micro:bit that does works)

ChrisDorna avatar Jan 13 '19 13:01 ChrisDorna

@pelikhan Do the errors I catched make any sense to you?

ChrisDorna avatar Jan 23 '19 20:01 ChrisDorna

Make sure to specify “no pairing” on windows. It might be a security setting.

pelikhan avatar Jan 23 '19 20:01 pelikhan

We checked that several times. It is strange because the micro:bits seems to be the same. Tommorow I will be at the BETT in London and I have the two micro:bits with me. Perhaps there is somebody wo can have a look.

ChrisDorna avatar Jan 23 '19 20:01 ChrisDorna

Looks like this is no longer working since MakeCode 2020 release https://github.com/microsoft/pxt-microbit/issues/3283

microbit-mark avatar Jun 18 '20 12:06 microbit-mark

I write code on MacOS 10.15.6 with Chrome 84.0.4147.89 (Official Build) (64-bit), the firmware version is 0253. I tried it but the code is not flashed to the micro:bit. These were my steps:

  • I enabled the experiment on https://makecode.microbit.org/beta?dbg=1#editor

  • I built a program and uploaded the hex via USB to the micro:bit

  • I unpluged the USB-connection

  • I held button A and B, then pressed the restart button on micro:bit

  • I was able to connect to make a bluetooth connection Screenshot 2020-07-24 at 10 51 54

  • I changed the script

  • I pressed the download button

  • It saved the .hex file Screenshot 2020-07-24 at 11 07 18

Nothing happened on the micro:bit.

microboym avatar Jul 24 '20 03:07 microboym

I encountered the same issue (bluetooth paring being successful while the downloading partially revised code only ending up with downloading .hex file locally) as @microboym has posted above. For myself, I tried this bluetooth download feature on: (i) Mac OS 10.13.6 with Chrome 84.0.4147.89 (64 bit) (Official Build) and micro:bit firmware version 0253. (ii) Windows 10 Home Version 1909 with Chrome 84.0.4147.105 (64 bit) (Official Build)and micro:bit firmware version 0253. (following the instruction, with "no-paring" setting)

I have successfully paired and flashed codes from (a) iPad with the micro:bit app and I also confirmed that (b) the scratch link via bluetooth works on both of the environments (i) and (ii) above (this (b) may be irrelevant here though).

Fully understand that this bluetooth download feature is on its experimental phase and grateful for the effort to enable code downloading without cable connection. Thank you.

phoenixvane avatar Jul 29 '20 19:07 phoenixvane

I overlooked the post by @microbit-mark on June 18 - sorry to see that this feature is no longer available on MakeCode 2020. Out of curiosity, I tried using the old version MakeCode, with which this feature successfully worked.

phoenixvane avatar Jul 29 '20 19:07 phoenixvane

I overlooked the post by @microbit-mark on June 18 - sorry to see that this feature is no longer available on MakeCode 2020. Out of curiosity, I tried using the old version MakeCode, with which this feature successfully worked.

How to use the old version MakeCode, @phoenixvane ?

microboym avatar Aug 01 '20 05:08 microboym

@microboym, please kindly see below for the way to use the previous version of MakeCode where the bluetooth download feature is still available.

Access to the previous version of the editor Should you need to, you will still be able to access the previous version at https://makecode.microbit.org/v2 until 2022 and you can access the old version at https://makecode.microbit.org/v0 until 2020.

https://support.microbit.org/support/solutions/articles/19000058445-makecode-editor-updates

phoenixvane avatar Aug 01 '20 23:08 phoenixvane

As documentation for downloading a project to Microbit via Bluetooth is not very clear, at least for someone that is trying for the first time, I have decided to put the steps that works fine for me, on a paper:

Note: +All these steps have been tested on Windows10 OS +You should have basic understanding of working with Microbit (e.g. loading a project via cable)

Prerequisites: 1 x Microbit + battery pack micro USB cable PC & Chrome browser v70+

Step 1: Create a new Microbit project in the previous editor version - v1 (the v2 currently doesn't work with Bluetooth Download extension) Open following link in Chrome browser: https://makecode.microbit.org/v1#editor

Step 2: Enable Bluetooth download extension In project: go toSettings>About>Experiments>click on the Bluetooth Download tile

Step 3: check No Pairing Required in Project Settings In project: go to Settings>Project Settings> >Provide a Name: e.g. Myproject >Enable No Pairing Required >Click Save Click Download and save the .hex file in your PC

Step 4: Download this project to Microbit via cable (this is mandatory only for the first time, after that, this project can be updated via bluetooth) Connect Microbit to PC using micro USB cable Copy the .hex file (resulted from step 3) to Microbit When transfer is finished, unplug the USB cable from Microbit

Step 5: Connect to Microbit via Bluetooth (this is necessary only when you open your project for first time) Make sure the Microbit is powered (e.g via battery pack) Put the Microbit in Pairing mode: press simultaneous the buttons A + B + reset, and keep pressed until the Bluetooth icon appears on Microbit board In project: go to Settings>Pair Bluetooth>select the Microbit and click on Pair

Step 6:Download the project to Microbit Make sure the Microbit is powered (e.g via battery pack) Put the Microbit in Pairing mode: press simultaneous buttons A + B + reset, and keep pressed until the Bluetooth icon appears on Microbit In project: Click on Download button: the Microbit patern leds will start to flicker and will switch off when download is finished *Sometimes if nothing happens when you click on Download button, you may need to repet the Step 6 (put again the Microbit in Paring mode)

Enjoy! Adrian

adryannn avatar Dec 16 '20 10:12 adryannn