Tips for using the Makeblock mBot 2 / mBot Neo under Linux

Couple of weeks ago i purchased the Makeblock mBot 2 to get into Robot tinkering with the kids. Since Lego left the market with its Mind Storms sets there arent many good alternatives on the market. There are some kits like this, but things like the Ozobot are quite expensive for what you get, on the other end of the scale there are cheap robot car kits from China, which feature an arduino clone where you have to program everything from scratch. Not really beginner friendly

Compared to this the mBot 2 is really nice. You can set it up in a couple of minutes with the kids and you have the choice to program it graphical with a blockly style IDE like or in Python. The IDE is web based so it should work on most devices.

But my children have Linux Desktops and that wasnt as straight forwarded as expected. Because i didnt find many ressources on this topic i thought i share my experience, so other people dont have to search that much.

In the end there are two ways to connect to the mBot 2 or better to say to the Makeblock Cyberpi which is the ESP32 based brain of the robot, via USB Serial over USB-C or via bluetooth. We will also have a look at two IDE’s the Makeblock mBlock 5 and the Open Roberta Lab by the Frauenhofer Institut which you can also host yourself.

BotheIDE’s are in the end based on Blocky if i understood that correctly.

Enable USB Serial on Linux for non root users

One thing you really want to do is to enable non root users on linux to use Serial Port connections. It gave me quite a headache to understand why for example the Open Roberta Connector works on my laptop but not on the Desktop of my daughter. It was espcially confusing that there was a connection but i was not able to upload any stuff. Normally it should be sufficient to add her user to group dialout or uucp but that wasnt the case. Because after that the file permissions are still not correct for ttyUSB0. Instead of fiddling around i took the „nuclear“ approach. I use Platformio on my laptop and that project gives me a nice udev ruleset which solves that problem for all kinds of USB-Serial converters incl the one used in the mBot 2. So had over to them and simply use that, one problem solved: https://docs.platformio.org/en/stable/core/installation/udev-rules.html

Makeblock mBlock 5

The Makeblock mBlock 5 IDE is the standard IDE for the mBot 2 which makes use of all its features. Afaik it is not self hostable any more. Makeblock tend to share their sourcecode on Github which is not the case anymore. Nevertheless if you want to get the most out of mBot 2 (with block style programming) thats the way to go. You find that ide under https://ide.mblock.cc

Yep it is a China based program but you know from the start what you bought

Do yourself a favour: use this IDE with a Webserial enabled Browser. So afaik Firefox is a no-go, you should use Chromium or a browser based on that, than you have no problem.

In that IDE you could also use Bluetooth, which is quite cool in live mode, in fact you could remote control your mBot 2 over this. To use this you either have to enable Web Bluetooth support or the Experimental Web Platform Features, both you can find if the call chrome://flags from the address bar.

Open Roberta Lab

The Open Roberta Lab is a web based block style IDE for different Robots and micro controller boards made by the Frauenhofer IAIS. It is also based on blockly. The approach here is a bit different because they dont rely on webserial. That means you can also use Firefox on the other hand you have to install the Open Roberta Connector which is a small Java program. That means you have to install Java on your System. I tried it with OpenJDK 17 and 25 which both worked. Just grab the tarball from Github, unzip and use the install script from the tarball or go into the folder an launch the Program manually: java -jar -Dfile.encoding=utf-8 OpenRobertaConnector.jar

Form here it ist quite straight forwarded like in the wiki entry: https://jira.iais.fraunhofer.de/wiki/spaces/ORInfo/pages/252155447/Set+up+mBot+2?showLanguage=en_GB

If you cant upload programs than restart the program using sudo, if it works then, that means you have a permission problem with the USB Serial port.

Compared to mBlock 5 Open Roberta Lab is quite limited, which must not be bad for first experiments.

I hope that post is a little help to someone. Because the holidays will begin shortly i will now start to experiment with the robot with my kids. Lets see what we can do with it.

Björns Techblog
Björns Techblog
@blog@blog.sengotta.net
313 Beiträge
21 Folgende
Fediverse-Reaktionen

Schreibe einen Kommentar