Failing to upload simple program to mBot - OSX Yosemite 10.10.5


#1

I need some help. This is my first attempt to upload a program to our mBot.

The program is the “blinkingLEDs” program, the very first example from Charles McKnight’s “A Gentle Introduction to Robotics, Volume 1”. I’ve tried both my own build of the program, which looks identical to the book, and also the downloaded example code.

The program works (LED’s alternatively flash red) when I run it wirelessly over 2.4G by double-clicking the hat-block. However, there is no response from the mBot after I upload the program with the “Upload to Arduino” button via USB cable. No errors appear after the download.

I am using:
mBlock 3.3.7 for Mac
Macbook Air running OS X Yosemite 10.10.5
USB Serial Driver CH34X v1.0, installed by running the “CH34x_Install.pkg” file, then rebooting.
mBlock “Board” selected is “mBot/mCore”.

At first I thought that the USB driver was the problem. However, it is showing up correctly under Connect -> Serial Port -> as “/dev/tty.wchusbserial1410”, and when I select it it shows as “Serial Port Connected”. I seem to be able to successfully upload the firmware to the mBot, and after my program upload attempts, I can successfully upload the Default Program.

When I perform the program upload, no errors appear, and the script finishes with “6318 bytes of flash verified. avrdude done. Thank you.” So it appears to me that the program is uploading successfully. However, the mBot does not respond at all, in that the LED’s do not start flashing (as they do when the program is activated wirelessly).

I can provide any other information that might help. Can anyone suggest what I am doing wrong? Unlike many other forum posts, I’m not getting any error messages, and my serial connection appears to be working - I just can’t get the mBot to run the uploaded program. @tec_support ?


#2

A little further info: I uploaded the next demo program in Charles’ ebook, “PlayOctave”, and that worked perfectly! So, my USB communication appears to be fine.

The problem therefore seems to be something specific about the little program “BlinkingLEDs”, even though all it does it switch the onboard LED’s on and off. I’ve experimented with different colour settings, and different Wait durations, but there is no response at all from the mBot.

As I’ve said before, the program works fine when run from mBlock wirelessly.

I’ve found posts describing issues with the onboard LED’s, but these were referring to earlier versions of mBlock and the issues were more to do with incorrect colours, not a complete lack of response such as I’m experiencing.

I’m at a loss for ideas. It worries me that the simplest little demo program won’t work when uploaded! @chuckmcknight


#3

Hi @BrainSpice,

I just loaded the program via USB from mBlock 3.3.7 and the LEDs alternated blinking on and off. I’m at a bit of a loss as to why it’s not working on your end. I have an mBot 1.0 (not sure what you have) and I performed the following steps:

  1. Upgrade firmware to ensure memory is clean (Connect->Upgrade Firmware)
  2. Change to Arduino mode (Edit->Arduino Mode)
  3. Click Upload to Arduino button

I watched the program compile and load into the mBot and at that point the LEDs started flashing.

The only difference in our setups is that I’m using OS X El Capitan 10.11.6 and I’m using the signed serial driver from the Sengotta blog link. I would note that sometimes having multiple USB drivers can cause conflict issues so you might want to review the troubleshooting tips at this link.

If this doesn’t resolve it, I’m copying @tec_support in on this thread.

Hope this helps.

Chuck


#4

Thanks Chuck, I appreciate your quick response. My mBot is v1.1.

My steps are identical to your steps: upgrade firmware, go to Arduino mode (I’ve been doing this with a single click on the hat block, but it appears to have the same effect), and click Upload to Arduino. The process completes without error, comes up with a “Finished - OK” box, but no flashing LED’s.

If I upgrade the firmware, and then double click on the hat block from Arduino mode, then the LED’s flash as they should. Once I’ve attempted to upload the program though, double-clicking the hat block no longer works either. Does that sound strange or normal?

I’ve downloaded the serial driver from the Sengotta link, and it looks identical to the package that I downloaded and installed via the link on the Makeblock getting started page (installed via CH34x_Install.pkg). However, I’ve definitely installed multiple drivers, starting with the one from the mBlock menu.

I’ve gone through the troubleshooting process via your second link. I’m afraid I am not familiar with any of this, so it is difficult to know what I should expect when I run the various commands. For example, when I run:

sudo find /System/Library/Extensions/ /Library/Extensions/ -name osx-pl2303.kext -o -name osx-ch341.kext -o -name usb.kext -o -name ProlificUsbSerial.kext -o -name ch34xsigned.kext

…the only driver that is listed is “usb.kext”. Is this a driver that I should be removing, if it is the only one listed? Or should I be substituting driver names in the command with an appropriate set for my situation?

I charged ahead anyway, and tried to remove “usb.kext”. I ran:

sudo kextunload ./usb.kext

but it came back with an error, stating:

Can’t open CFBundle for /Users/BrainSpice2/usb.kext.
Can’t create ./usb.kext.

Then I rebooted the Mac and tried again, as the article suggests. Same error.

Flying completely blind now, I don’t know what drivers I should be looking for in the next suggested command:

sudo kextload ./name.kext

Instead I just decided to rerun the driver installation file, reboot, and test the mBot. No improvement.

Just on another note; when I follow the instructions in the ReadMe file that is zipped up with the driver installation file, and run this:

ls /dev/tty*

I can see the “tty.wchusbserial” driver in the resulting list.

When I open mBlock and connect the USB cable to the mBot (switched on), I can see “/dev/tty.wchusbserial1410” as the third option on the Serial Port menu. When I select it, it remains ticked, and the title bar says “Serial Port Connected”. However if I go to the System Information utility (as the ReadMe file also suggests), and go to Hardware/USB, then in the USB Device Tree I do not see the “Vendor-Specific Device” that the ReadMe file says I should see. Is that strange or normal?

@tec_support - please help!


#5

Hi BrainSpice,

For the issue that the program doesn’t take effect after upload the program into mBot.
Here I attach the instructions with detailed steps, you may try again refer to it though I know you have tried several times.How can I upload my mBlock program to the mBot.zip (453.2 KB)
7. How to Upgrade Firmware for mBot.docx.zip (406.5 KB)
Besides, you may remove the 2.4G module from the mCore temporarily have a try while upgrade firmware, upload program to mBot.
Once still the same issue, please send me the program file, we will test it with mBot v1.1 here.

As for the phenomenon " Once I’ve attempted to upload the program though, double-clicking the hat block no longer works either. Does that sound strange or normal?", actually, this is normal. You need upgrade firmware for mBot to clear the board (clear the program which has been uploaded to board before) before you test the online program.


#6

Hi @tec_support,

Thanks, I’ve followed the instructions in these two documents exactly as described. The uploaded program still doesn’t work.

The program file is here: BlinkingLEDs.sb2 (73.7 KB)

It is the first example program (downloaded) for the book “A Gentle Introduction to Robotics Volume 1” by Charles McKnight.

If the program works at your end, it would suggest a USB connection or driver issue, would that be correct? I’m thinking that if double-clicking runs the program successfully for me, then it shows that the mBot hardware is working okay.

If so, can you please step me through how to uninstall the Arduino Driver from mBlock (Connect -> Install Arduino Driver) and also the driver installed from CH34x_Install.pkg (from the zip file linked on your Getting Started page). I can then try to reinstall the driver from a clean slate!


#7

Hi BrainSpice,

The program test ok here with mBot 1.1 on Mac.
Please check if it will work after upload this program below:

For the previous program, you may send us a screenshot for both the mBlock program and the generated Arduino program on your side have a check.


#8

Hi @tec_support,

Interesting experiment: the modified program that you suggested works! Afterwards, I reloaded the firmware, and tried the original BlinkingLEDs program again. Still doesn’t work.

I’ve attached screenshots of both programs on my screen. I’ve also copied the Arduino programs to rtf files, and zipped them up for you.

Regards,
Colin.

Archive.zip (2.8 KB)


#9

Hi Brain Spice,

We have found the reason for this issue.
Since the LED command execute very fast offline, resulting in continuous LED commands may be disturbed executed due to the difference in individual mBot chip, so the LED program run offline OK on some mBot, while do not respond on some other parts.
This issue will be fixed on mBlock 3.4.0 which may be published in late October.
Please use the following program as a workaround:

Thanks for feedback this issue to us.


#10

Thanks guys. I must say, while the issue itself is unfortunate, your support has been absolutely first class. I appreciate your help!

Regards,
Colin.


#11