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

Bluetooth Download feature #4807

Open
pelikhan opened this issue Oct 12, 2018 · 42 comments
Open

Bluetooth Download feature #4807

pelikhan opened this issue Oct 12, 2018 · 42 comments
Labels
Experiment Discussion about editor experiments

Comments

@pelikhan
Copy link
Member

pelikhan commented Oct 12, 2018

bluetoothpartialflashing

Description

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

How to enable it?

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 pelikhan added the Experiment Discussion about editor experiments label Oct 12, 2018
@pelikhan pelikhan changed the title Bluetooth Download Bluetooth Download feature Oct 12, 2018
@imhori
Copy link

imhori commented Nov 4, 2018

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

@pelikhan
Copy link
Member Author

pelikhan commented Nov 4, 2018 via email

@imhori
Copy link

imhori commented Nov 4, 2018

@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.

@pelikhan
Copy link
Member Author

pelikhan commented Nov 4, 2018

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

@pelikhan
Copy link
Member Author

pelikhan commented Nov 4, 2018

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

@pelikhan
Copy link
Member Author

pelikhan commented Nov 4, 2018

@imhori
Copy link

imhori commented Nov 4, 2018

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...

@pelikhan
Copy link
Member Author

pelikhan commented Nov 4, 2018

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

@pelikhan
Copy link
Member Author

pelikhan commented Nov 4, 2018

You can use the Android Microbit app for that.

@imhori
Copy link

imhori commented Nov 4, 2018

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
Copy link

imhori commented Nov 4, 2018

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~

@ChrisDorna
Copy link

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

@pelikhan
Copy link
Member Author

pelikhan commented Jan 2, 2019

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

@ChrisDorna
Copy link

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

@pelikhan
Copy link
Member Author

pelikhan commented Jan 3, 2019

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

@ChrisDorna
Copy link

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

@ChrisDorna
Copy link

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

@pelikhan
Copy link
Member Author

pelikhan commented Jan 7, 2019

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.

@ChrisDorna
Copy link

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
Copy link

ChrisDorna commented Jan 13, 2019

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
Copy link

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

@pelikhan
Copy link
Member Author

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

@ChrisDorna
Copy link

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.

@microbit-mark
Copy link
Contributor

Looks like this is no longer working since MakeCode 2020 release microsoft/pxt-microbit#3283

@microboym
Copy link

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.

@phoenixvane
Copy link

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
Copy link

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.

@microboym
Copy link

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 ?

@phoenixvane
Copy link

@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

@adryannn
Copy link

adryannn commented Dec 16, 2020

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

@targetarchitecture
Copy link

@adryannn do you know the root cause of this great "experimental" feature not working?

@pelikhan
Copy link
Member Author

It got broken while refactoring the webusb stack.

@adryannn
Copy link

It got broken while refactoring the webusb stack.

@pelikhan, I was assuming the same, when I have discovered this in June.
There is any chance to have this fixed in the next release?

Thank you!

@codeorganic
Copy link

When should we expect to see full flashing working? The reason I am asking is because cables might not connect, ( perhaps to due cable quality ) and having another way to write code would be grand.

@Darshnik253
Copy link

i am making project of smart car using microbit. i am sending data from mobile bluetooth terminal app to microbit using bluetooth uart service in that first time getting correct data but second time not getting correct data(some rules not followed by microbit). how to resolve ?

@abchatra
Copy link
Collaborator

@pelikhan does this experiment still work?

@pelikhan
Copy link
Member Author

pelikhan commented Jul 14, 2022 via email

@robotixdevteam
Copy link

Regrading connection between desktop to microbit via Bluetooth, , We like to know if this can be worked out we tried establishing connection as mentioned this github but we were unable to connect. Please help us with this.

@jaustin
Copy link

jaustin commented Jan 12, 2023

@pelikhan any plans to rev this for micro:bit V2? web-bluetooth is getting quite prevalent and with the 'triple tap reset to pair' change in CODAL I think the Ux for MakeCode-->micro:bit directly over Bluetooth will be really nice.

lancaster-university/codal-microbit-v2@master...triple-reset-to-pair

@pelikhan
Copy link
Member Author

Not from me

@Rkkss
Copy link

Rkkss commented Oct 21, 2023

Can't get it to work on micro:bit v2.1?
What is the alt way to download code via bluetooth? Android apps is not updated either

@xicheng135
Copy link

Bluetooth downloads don't work on my device

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Experiment Discussion about editor experiments
Projects
None yet
Development

No branches or pull requests