Makeblock mBot for Scratch X Bluetooth Connection

Makeblock mBot for Scratch X Bluetooth Connection

This is one of those head-scratchers that has posed a problem for me but I didn’t really look at how to solve the problem until there was a real need to do so.

Let me explain. The mBlockly software for Mac and Windows works very well. There is a version, however, that is available from developers on GitHub for the Chrome browser and Chromebook. Github is a repository and hosting service of a variety of projects from developers. These projects are created and maintained by a community of developers who often make their projects available to the public. The Chrome version of the mBot software is still being developed and doesn’t have all the features of the installable versions for Windows and Mac. This is the reason I haven’t seen the need to use the online version since the installed version works very well.

What makes the Github version so different?

This version is meant to work as an application on the Chrome browser or Chromebook. This means the full application does not need to be installed on a computer. Only some components are installed that allow it to work with the cloud application. This is ideal for those that want to use a Chromebook. A Chromebook does not provide the traditional installation tools used on operating systems like Windows or Mac. Most applications for the Chromebook are cloud based in one form or another.

The reason I took a closer look is that my district has issued a Chromebook to all third to eighth-grade students. In addition, the Gifted and Talented Department along with the Science department has purchased mBots for each elementary and middle school campus. Most mBots are able to connect to the Chromebook without a problem but there are still several that cannot connect for one reason or another. Campuses have been able to get it to work with some trial and error. Those that have been able to get it to work can’t really explain how they did it but are happy it works.

The difficulty lies in connecting the Chromebook and mBot through Bluetooth. There needs to be a systematic way to determine the problem and to solve the problem no matter when it occurs. After lot’s of trial and error, I have come up with a solution I hope will resolve current and future issues with the mBot and connecting with Bluetooth.

The first step in the process is to update the firmware on the mBot. Firmware is the devices Operating System. The mBot uses a version of the Arduino Board called the mCore. The mCore like the Arduino is a micro-controller. A microcontroller is essentially a small computer that is designed to interact with a variety of electronic components like the motors and sensors on the mBot.

It appears that the mBot will not accept Bluetooth commands if there is code running on the microcontroller. The code on the microcontroller is essentially overriding any commands issued from an external device using Bluetooth. Updating the firmware erases any code on the mBot leaving it free to accept instructions from the Chromebook over Bluetooth.

To update the firmware, we need to use a Windows or Mac computer with the full version of the mBlockly software installed. The latest software can be downloaded from (http://learn.makeblock.com/en/software/). It can also be downloaded from (http://www.mblock.cc/download).

download Mac or Windows mblockly software

 

connect to the virtual serial port on mblockly for mac

Install the software and connect the mBot to one of the USB ports on the computer. After physically connecting the mBot you will need to make the virtual connection to the mBot using the mBlockly software. Using the Mac software, you will click the Connect menu option, select Serial Port and choose the (/dev/tty.wchusbserial1420) connection.

mblockly serial port connection for Windows

On Windows computers, click the Connect option in the menu, select Serial Port and choose the Com 3 port.

upgrade firmware option for mBot

Go back to the Connect menu option and select the option to upgrade the Firmware. This is the same process for either operating system.

firmware update message on mblockly

The firmware upgrade process takes a few seconds. Click the close button when the process is complete. Disconnect the mBot from the computer and the USB cable.

Connecting mBot with Bluetooth

The next step is to connect the mBot to the Chromebook using Bluetooth. Turn on the mBot and make sure the Bluetooth LED light is blinking. The light on the Bluetooth module is “blue”.

Chromebook shelf option and bluetooth option

Click on the status area in the Shelf then click on the Bluetooth option. In this example, Bluetooth is disabled. We can also enable Bluetooth using this process.

turn on bluetooth in Chromebook

If Bluetooth is disabled, click on the toggle button to enable Bluetooth.

list of bluetooth devices

Bluetooth is a common communication format between devices so you are likely to see a lengthy list of Bluetooth devices in the Bluetooth selection list.

select Makeblock Bluetooth connection

Find the Makeblock Bluetooth device. Make sure to select the “Makeblock” and NOT the “Makeblock LE” device.

bluetooth connection code

A Bluetooth confirmation box will display prompting us to enter the number displayed in the box. There is no way to enter the number so we will click the “Accept” button.

bluetooth error message

The information in the box will update and inform us that there has been an error. This is fine because the mBot Chromebook application will help make the final connection. The light on the Bluetooth module is still blinking. This is normal.

Makeblock Chrome app in Chrome Launcher

Click on the Apps launcher and click on the Makeblock mBot App.

bluetooth pull-down menu selector

Click on the Bluetooth options pull-down menu.

select Makeblock bluetooth option

Select the Makeblock Bluetooth connection.

bluetooth connect button

Click on the Bluetooth Connect button. The Bluetooth light on the mBot will stop blinking and remain lit. This means there is an active connection between the Chromebook and the mBot.

bluetooth disconnect button

The connection is successful when the Connect button changes to read Disconnect. Click on the “Open Scratch” button.

default code block

Use the arrows on the keyboard to maneuver the mBot.

Notes on working with mBots in the classroom

You will need to reconnect the Bluetooth to the mBot using the Makeblock application each time. If the Makeblock application does not want to connect in the future you will need to remove the Bluetooth connection on the Chromebook and reconnect. The instructions to do that are shown below.

If you have a class set of these mBots don’t try to connect them all at once. Each one has the same Makeblock name and you won’t be able to distinguish them unless you know their specific Bluetooth address. I recommend labeling each mBot and placing the matching label on the Chromebook that is paired with the mBot.

A classroom that has a matching one-to-one mBot and Chromebook is not very likely so you might want to label each mBot with the corresponding Bluetooth address. The Bluetooth address is different for each mBot and can be found to the right of the Makeblock name. I recommend a label maker. This may seem time-consuming but it pays off the rest of the year. Students can pair their own mBot.

Here is another thing to consider and I bring it up because my district has issued one Chromebook per student. Once a Chromebook is paired with an mBot it will more than likely want to maintain that pairing when the computer is not in the same room. Bluetooth signals can travel for up to thirty feet or more. This may mean that a student’s Chromebook in the next room may maintain the pairing to an mBot and thus interfere with the pairing to another Chromebook.

bluetooth enabled status

A pairing is usually a one to one connection. Unless students need to connect to other Bluetooth devices I recommend that students turn off their Bluetooth when not working with the mBot. If students need to connect to other Bluetooth devices like keyboards and mice then it would be a good idea to unpair the mBot from the Chromebook. The instructions for that are shown below.Unpairing an mBot Bluetooth connectionClick on the status area in the Shelf and select the Bluetooth option.

settings option

Click on the Bluetooth settings icon.

actions menu option

The Makeblock mBot paired connection will be listed in the Paired devices section. Click on the Actions menu option on the right. This is represented by three dots.

remove bluetooth connection from list bluetooth connect option

Select the option to remove the device from the list to break the pairing between the Chromebook and mBot.

Reconnecting an mBot pairing

If you are having trouble connecting to an mBot you might need to reconnect the devices. Follow the step above to access the Bluetooth settings for the Makeblock and select the option to connect. If the mBot refuses to connect you will need to remove the pairing and then pair the mBot again.

I hope you found that useful.

Posted in Chromebook, Makeblock, mBot and tagged , , .