# Can I download the codes to EV3 via bluetooth?

**URL:** https://forum.makecode.com/t/can-i-download-the-codes-to-ev3-via-bluetooth/501
**Category:** EV3
**Created:** [August 31, 2019, 12:32am UTC](https://forum.makecode.com/t/can-i-download-the-codes-to-ev3-via-bluetooth/501 "2019-08-31T00:32:42Z")
**Posts on this page:** 20
**Page:** 1

<div class="post-metadata">

### Author: ![hgchcw](https://avatars.discourse-cdn.com/v4/letter/h/e9c0ed/32.png) [@hgchcw](https://forum.makecode.com/u/hgchcw)
#### Post date: [August 31, 2019, 12:32am UTC](https://forum.makecode.com/t/can-i-download-the-codes-to-ev3-via-bluetooth/501/1 "2019-08-31T00:32:42Z")

</div>

After writing the codes in EV3 MakeCode, can I download the codes to EV3 via bluetooth but not USB cable?

Thanks,  
Raymond

---

<div class="post-metadata">

### Author: ![peli](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/peli/32/12_2.png) [@peli](https://forum.makecode.com/u/peli)
#### Post date: [September 1, 2019, 1:42am UTC](https://forum.makecode.com/t/can-i-download-the-codes-to-ev3-via-bluetooth/501/2 "2019-09-01T01:42:14Z")

</div>

Sorry Bluetooth or WIFI downloading is not available in MakeCode.

---

<div class="post-metadata">

### Author: ![amanjarrez](https://avatars.discourse-cdn.com/v4/letter/a/51bf81/32.png) [@amanjarrez](https://forum.makecode.com/u/amanjarrez)
#### Post date: [September 1, 2019, 3:16am UTC](https://forum.makecode.com/t/can-i-download-the-codes-to-ev3-via-bluetooth/501/3 "2019-09-01T03:16:42Z")

</div>

Our team is also interested on a wireless download… Now the in First Lego League (FLL) you can program your robot with other languages, our team is really interested on MakeCode… yet the drawback at this time is having to connect the wire for every tweak on the program for every mission… in a FLL competition there are 100s of tweaks as you try your program for distance, amount to lift, push, etc. for the various missions. Is there an ETA for this capability to be supported?

---

<div class="post-metadata">

### Author: ![peli](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/peli/32/12_2.png) [@peli](https://forum.makecode.com/u/peli)
#### Post date: [September 1, 2019, 5:34pm UTC](https://forum.makecode.com/t/can-i-download-the-codes-to-ev3-via-bluetooth/501/4 "2019-09-01T17:34:45Z")

</div>

Sorry there is no ETA on BT support.

---

<div class="post-metadata">

### Author: ![Jeff](https://avatars.discourse-cdn.com/v4/letter/j/e19b73/32.png) [@Jeff](https://forum.makecode.com/u/Jeff)
#### Post date: [September 25, 2019, 1:21am UTC](https://forum.makecode.com/t/can-i-download-the-codes-to-ev3-via-bluetooth/501/5 "2019-09-25T01:21:22Z")

</div>

I created a C# app that uses Lego.Ev3.Desktop but unfortunately that didn’t seem to work.  
await brick.SystemCommand.CopyFileAsync(@“c:\temp\PlaySound.uf2”, @"…/prjs/PlaySound.uf2");

I could see the file gets created on the brick in the LME software manager but it is still just a uf2 file. I assume something special happens to the file when copied via USB? Maybe I can read in the uf2 file then split out the .rbf and .elf files then write those directly to BrkProg\_SAVE?? Any help on the format of the uf2 file would be greatly appreciated

Thanks, Jeff

---

<div class="post-metadata">

### Author: ![Jeff](https://avatars.discourse-cdn.com/v4/letter/j/e19b73/32.png) [@Jeff](https://forum.makecode.com/u/Jeff)
#### Post date: [September 25, 2019, 2:09am UTC](https://forum.makecode.com/t/can-i-download-the-codes-to-ev3-via-bluetooth/501/6 "2019-09-25T02:09:25Z")

</div>

OK I’ve made some progress. I was able to read in the uf2 file then split it into the rbf and .elf files. I then did the following:  
await brick.SystemCommand.CopyFileAsync(@“c:\temp\PlaySound.elf”, @"…/prjs/BrkProg\_SAVE/PlaySound.elf");  
await brick.SystemCommand.CopyFileAsync(@“c:\temp\PlaySound.rbf”, @"…/prjs/BrkProg\_SAVE/PlaySound.rbf");  
Success!

I can also use the DeleteFileAsync to delete unwanted files! What I’ll do is start the app with a brick Name input. I’ll use a FileSystem watcher on a folder and any time a new or updated .uf2 file is dropped there, I will split out the elf and rbf then send them to the EV3 brick. When I get a clean working solution I’ll throw it up somewhere.

---

<div class="post-metadata">

### Author: ![mmoskal](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/mmoskal/32/20_2.png) [@mmoskal](https://forum.makecode.com/u/mmoskal)
#### Post date: [September 25, 2019, 5:28pm UTC](https://forum.makecode.com/t/can-i-download-the-codes-to-ev3-via-bluetooth/501/7 "2019-09-25T17:28:28Z")

</div>

This is awesome!

If you need any help with the UF2 format let me know. You might have already found the docs here - [https://github.com/microsoft/uf2](https://github.com/microsoft/uf2)

---

<div class="post-metadata">

### Author: ![Jeff](https://avatars.discourse-cdn.com/v4/letter/j/e19b73/32.png) [@Jeff](https://forum.makecode.com/u/Jeff)
#### Post date: [September 25, 2019, 6:58pm UTC](https://forum.makecode.com/t/can-i-download-the-codes-to-ev3-via-bluetooth/501/8 "2019-09-25T18:58:36Z")

</div>

Thanks that will help. I had just looked at the binary and made some guesses about the file format 😉

---

<div class="post-metadata">

### Author: ![abchatra](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/abchatra/32/17_2.png) [@abchatra](https://forum.makecode.com/u/abchatra)
#### Post date: [September 25, 2019, 9:03pm UTC](https://forum.makecode.com/t/can-i-download-the-codes-to-ev3-via-bluetooth/501/9 "2019-09-25T21:03:46Z")

</div>

This is awesome. Please us updated on your progress

---

<div class="post-metadata">

### Author: ![Jeff](https://avatars.discourse-cdn.com/v4/letter/j/e19b73/32.png) [@Jeff](https://forum.makecode.com/u/Jeff)
#### Post date: [September 26, 2019, 7:09am UTC](https://forum.makecode.com/t/can-i-download-the-codes-to-ev3-via-bluetooth/501/10 "2019-09-26T07:09:55Z")

</div>

Yes will do. I have a real job so this work is secondary. Should have something by next week. I scrapped my little console test app for something with a GUI. I’ll need to have some robustness around BT range. I’m sure the kiddos will be moving the robots all over the place.

---

<div class="post-metadata">

### Author: ![peli](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/peli/32/12_2.png) [@peli](https://forum.makecode.com/u/peli)
#### Post date: [September 26, 2019, 10:08pm UTC](https://forum.makecode.com/t/can-i-download-the-codes-to-ev3-via-bluetooth/501/11 "2019-09-26T22:08:47Z")

</div>

Thank you Jeff for pointing us into the right direction. Interrestingly, the web serial api just hit the experimental channel in chrome so I was able to download the program from the makecode editor itself in the latest chrome/edge insider (with experimental flags enabled).

PR: [https://github.com/microsoft/pxt-ev3/pull/920/files](https://github.com/microsoft/pxt-ev3/pull/920/files)

---

<div class="post-metadata">

### Author: ![peli](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/peli/32/12_2.png) [@peli](https://forum.makecode.com/u/peli)
#### Post date: [September 27, 2019, 2:07pm UTC](https://forum.makecode.com/t/can-i-download-the-codes-to-ev3-via-bluetooth/501/12 "2019-09-27T14:07:27Z")

</div>

The feature is now in /beta. You can read more details at [https://makecode.mindstorms.com/beta](https://makecode.mindstorms.com/beta)

---

<div class="post-metadata">

### Author: ![Jeff](https://avatars.discourse-cdn.com/v4/letter/j/e19b73/32.png) [@Jeff](https://forum.makecode.com/u/Jeff)
#### Post date: [September 28, 2019, 7:07am UTC](https://forum.makecode.com/t/can-i-download-the-codes-to-ev3-via-bluetooth/501/13 "2019-09-28T07:07:13Z")

</div>

OK so I don’t need to finish my app? I do have it up and working. I basically watch a folder and then when a .uf2 is written to it I send it over to the connected brick.  
I also was able to get FileList to work so now I can have a little folder manager.

---

<div class="post-metadata">

### Author: ![peli](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/peli/32/12_2.png) [@peli](https://forum.makecode.com/u/peli)
#### Post date: [September 28, 2019, 3:35pm UTC](https://forum.makecode.com/t/can-i-download-the-codes-to-ev3-via-bluetooth/501/14 "2019-09-28T15:35:33Z")

</div>

Please do - the web serial is still experimental 🙂

---

<div class="post-metadata">

### Author: ![Jeff](https://avatars.discourse-cdn.com/v4/letter/j/e19b73/32.png) [@Jeff](https://forum.makecode.com/u/Jeff)
#### Post date: [September 30, 2019, 2:41am UTC](https://forum.makecode.com/t/can-i-download-the-codes-to-ev3-via-bluetooth/501/15 "2019-09-30T02:41:55Z")

</div>

I had a little time to work on this today but ran into an issue that took me for ever to figure out.  
Any time I would launch a program my brick would hard lock after the program finished. At times even after the 3 finger reset I would have to re-flash the brick to get it to connect back to BT.  
 ![app](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/1X/9f737a2679a31605bb82164158fb29a734ede6ae.jpeg).  
I spent a bunch of time looking at the Lego communication spec and the code in the library thinking that I was overwriting some flash bits or something.  
I finally figured out (at least I hope) what the issue was. If there is a program running on the brick and you try to send a command (read firmware ver in my case) the brick locks up after the program exits. Oddly enough the listening callback on port information doesn’t seem to cause the issue. The data stop flowing but as soon as the program exits it starts up again. Looks like I’m removing the status indicator 🙂

---

<div class="post-metadata">

### Author: ![Jeff](https://avatars.discourse-cdn.com/v4/letter/j/e19b73/32.png) [@Jeff](https://forum.makecode.com/u/Jeff)
#### Post date: [September 30, 2019, 3:58pm UTC](https://forum.makecode.com/t/can-i-download-the-codes-to-ev3-via-bluetooth/501/16 "2019-09-30T15:58:38Z")

</div>

OK I did find that the StartProgram code that I lifted from someone else was wrong. This was also causing the brick to lock up, some times.

---

<div class="post-metadata">

### Author: ![peli](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/peli/32/12_2.png) [@peli](https://forum.makecode.com/u/peli)
#### Post date: [October 1, 2019, 4:46am UTC](https://forum.makecode.com/t/can-i-download-the-codes-to-ev3-via-bluetooth/501/17 "2019-10-01T04:46:08Z")

</div>

The webserial stack is unable to open the COM port while the program is running (or portview). The user has to make sure to be back on the main screen of the brick to get the program flashing. I also tried to send some opcode to do UI\_WRITE(LED, LED\_GREEN\_PULSE) but ended doing 3 finger resets too.

---

<div class="post-metadata">

### Author: ![Jeff](https://avatars.discourse-cdn.com/v4/letter/j/e19b73/32.png) [@Jeff](https://forum.makecode.com/u/Jeff)
#### Post date: [October 2, 2019, 2:16am UTC](https://forum.makecode.com/t/can-i-download-the-codes-to-ev3-via-bluetooth/501/18 "2019-10-02T02:16:03Z")

</div>

couple of side questions:

1. Any idea why an .rbf built from the LME software exits when complete but a makecode rbf doesn’t?
2. Any know if there is a command code to read the bricks name. for BT that is pretty easy as it get set in the BT enumeration. I’m not sure how to get it via USB or Wifi without asking the brick. I looked through the opUiRead sub codes and didn’t see anything for name. Maybe a read line would do it?

---

<div class="post-metadata">

### Author: ![Jeff](https://avatars.discourse-cdn.com/v4/letter/j/e19b73/32.png) [@Jeff](https://forum.makecode.com/u/Jeff)
#### Post date: [October 7, 2019, 8:32pm UTC](https://forum.makecode.com/t/can-i-download-the-codes-to-ev3-via-bluetooth/501/19 "2019-10-07T20:32:12Z")

</div>

I did end up completing the program (at least for my needs). I found that WiFi is way more robust then BT. I ended up getting a NetGear USB wifi dongle and using that. I will need to get one for each team we are running. This will work for testing in house and then maybe switch to BT when we are at the competition. I also have a little file manager that allows for viewing, running, and deleting files.

I dumped the code and bins here: [https://1drv.ms/u/s!Am3UH\_kcAxmjjccAqBMInimo6wdRNQ?e=8R2Dl8](https://1drv.ms/u/s!Am3UH_kcAxmjjccAqBMInimo6wdRNQ?e=8R2Dl8) sorry not GitHub. Note: This is a total hack job. I’m not a UI programmer. The code here in has no implied or expressed guarantees or warranties. The original Lego.Ev3 library was not written by me. I only did some modifications to it. I may or may not randomly update these file or complete remove the share at any time 😉

It would be a huge help if the MakeCode programs would exit on completion.

---

<div class="post-metadata">

### Author: ![Rob](https://avatars.discourse-cdn.com/v4/letter/r/838e76/32.png) [@Rob](https://forum.makecode.com/u/Rob)
#### Post date: [December 20, 2019, 2:11pm UTC](https://forum.makecode.com/t/can-i-download-the-codes-to-ev3-via-bluetooth/501/20 "2019-12-20T14:11:43Z")

</div>

I have been trying to make bluetooth transfer from MakeCode work on my Android tablet but have had no success so far. Chrome is latest version and I have activated experimental features, but the bluetooth option doesn’t appear when I hit the Download button, neither in beta version. Do I really need a Windows computer to make it work? Android tablets is what I have available for my students.

[Next page](https://forum.makecode.com/t/can-i-download-the-codes-to-ev3-via-bluetooth/501.md?page=2)
