Code uploaded to mBot does not work


#1

Hi,

I just recently bought the mBot Ranger (3-in-1 Educational Robot Kit) to teach my kids about robotics and I am having trouble when I upload a script to my mBot. No matter what the script the mBot does not run it even though I get the confirmation, “Upload Finish”.

Please note:

  • I have also ensured that my mBot is connected to the correct port.
  • When my mBot is tethered using a USB cable, the same script (that I try to upload) works perfectly.

However, I have noticed that even though the upload finishes, I do get these lines in the arduino compile and upload window:
avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0x56
avrdude: stk500_getsync() attempt 2 of 10: not in sync: resp=0x65
avrdude: stk500_getsync() attempt 3 of 10: not in sync: resp=0x72
avrdude: stk500_getsync() attempt 4 of 10: not in sync: resp=0x73
avrdude: stk500_getsync() attempt 5 of 10: not in sync: resp=0x69
avrdude: stk500_getsync() attempt 6 of 10: not in sync: resp=0x6f
avrdude: stk500_getsync() attempt 7 of 10: not in sync: resp=0x6e
avrdude: stk500_getsync() attempt 8 of 10: not in sync: resp=0x3a
avrdude: stk500_getsync() attempt 9 of 10: not in sync: resp=0x20
avrdude: stk500_getsync() attempt 10 of 10: not in sync: resp=0x30

I have attached an image for reference as well.

Please advise what could possibly be causing it to not run.

Regards.


#2

The screenshot clearly says that Makeblock is not connected to the mBot - see the title bar and the red light.

Connect using USB cable and please make sure to pick the right serial port number.


#3

The status becomes disconnected once it says “Upload Finish”. This screenshot was taken then. When I uploaded the script, the status was connected. Also once connected to the serial port I always ensure that there is a tick present next to the COM. I have checked that several times including in the device manager. That doesn’t seem to be the issue here either.


#4

Ok, I tried that, and you are right. To upload code to the mBot through USB, you don’t need to be connected through a serial port.

The error messages you get are probably even caused by an additional serial connection which you do not need for the programming - you would only need that to communicate with the bot through the terminal (right bottom corner of the screen).

Does the robot work properly, e.g. if you restore the default program, can you move it with the IR control?


#5

The robot works perfectly fine when tethered via USB as well as when run using the IR control. However I cannot upload a script to the mBot using Makeblock. I always seem to get the same messages in the bottom right window. Also I have noticed that several commands don’t work either even when tethered.

Please explain the additional serial connection. I didn’t quite understand that.

Also thank you so much for all your help.


#6

Do you have the right board selected in Makeblock?


#9

You were right. The board was the problem. By default “mBot (mCore)” had been selected. However this is the mBot Ranger so for that I needed to connect to mBot Ranger (Auriga).

Thank you so much for workshopping this issue with me Andreas. I highly appreciate all your help. :slight_smile:


#10