Upload Failed


#1

When I go to upload a simple arduino program to my mBot Ranger I get the following message: Upload Failed. It is an immediate fail - as soon as I start…I checked all the basics. ANY help would be appreciated…

I feel like it must be something simple because I just successfully uploaded a simple script that read the temp to ensure the communication is working between the computer and the bot works. Plus I can restore the restore the default program.

What could be wrong?


#2

Hi!

Could you provide the following information?

  1. What OS (Windows, macOS) and version are you using?
  2. What version of mBlock are you using? (Or are you using the Arduino programming environment?)
  3. Is your computer connected to the mBot Ranger via USB cable?
  4. Have you connected to the USB cable from the Connect->Serial Port menu?
  5. Are you sure you are using the correct COM port (if on Windows)?

Uploading code to an mBot Ranger requires that you be connected via USB cable. You cannot do this over Bluetooth or Wifi because those modules do not have access to the onboard avrdude programmer.

Also, be aware that running a program over Bluetooth, Wifi, or even the USB cable is not uploading the program, it is merely executing the program within the mBlock environment which sends action codes over the serial connection to the onboard firmware. Uploading a program requires the use of the Auriga Program hat block and will invoke the embedded Arduino compilation environment to compile and upload the code to the mBot Ranger.

To restore the default program:

  1. Connect the mBot Ranger with the USB cable.
  2. Select the serial port from the Connect->Serial Port menu item.
  3. Select the Connect->Reset Default Program menu item

Hope this helps.

Chuck


#3

Thanks Chuck for your response. I am using the mBot Rangers at the middle school I teach at. We are using Windows 10 plus we downloaded the latest version mBlock last week. The Rangers are connected via USB cables, plus installed the drivers and updated the firmware and we checked that it was connected via the correct Serial Port. Here is what I think might be the problem but I need you help figuring this out…

When I run a simple test just using mBlock for example to say the light sensor number - it works fine. Our problem is when we try to use the Aurigo Programming hat block and then Upload to Arduino. So could the problem be I don’t have enough privileges on the desktop computer? Does Arduino need to write a file when it compiles? Unfortunately, I do not know enough about what happens when I click on Upload to Arduino…Any ideas?

  • Roseanna

#4

Privileges might be the issue. I’m not familiar with your school’s security policies, but I seem to remember hearing something like that before. I would consult with your system administrator because mBlock needs to be able to write files to disk when you use the Upload to Arduino button for standalone programs.

What happens when you click on the Upload to Arduino button:

  1. The extensions generate C/C++ code.
  2. mBlock invokes the command line version of the Arduino compilation environment.
  3. The Arduino compilation environment compiles the code.
  4. The Arduino compilation environment attempts to upload the code via the USB cable to the onboard programmer (called avrdude).

Step 4 has the effect of overwriting anything, such as the default program, that was in memory.


#5

Hi Chuck,

I asked our tech guy to give me a hand with this one. Here is what he discovered: because we are running on a domain, there is an issue writing to the registry. There was a simple fix that we then installed on all the computers in my lab. This resolved the issue. Thanks again for all your help. I learned a lot more about Arduino along the way. Have a great weekend!

Roseanna


#6

Bonjour Roseanna,

I have the same issue but my IT team has no clue how to fix this.
Could you please let me know what you have done to allow your students to upload their programs ?

Thank you for your help.


#7

Hi Dominique,

Please try don’t install the mBlock software under Program file.
You may create a mBlock file in the C drive root directory a and then install mBlock under C:/mBlock have a check.