MBot System Setup
Last Updated: Oct 21, 2025
This guide has been updated for ROS2 MBot Classic!
The following items are needed:
- microSD card
- SD adapter
- A laptop can read and write SD card
Notice #1: You do not need an external monitor during the set up process. However, if you want to connect to external monitor at any point, you need to plug into HDMI-0 port. The Pi5 has 2 HDMI ports, plug into the one closer to USB C port.
Notice #2: This guide will walk you through the steps needed to setup the MBot Classic system. The guide is intended to be followed in order, do not jump back and forth.
Contents
Set up RPi 5 System
1. Flash the image
- Download the custom image
2025-08-15-mbot-ros2-base-ubuntu24.img.gzfrom this link to your laptop. - Download Balena Etcher to your laptop, it is a tool to flash the OS image to the SD card. Plug in the SD card to your laptop using SD card reader then following the steps in Balena Etcher. (The image is 18GB, this can take 15 min).
Once you have the SD card with the OS image flashed on it, don’t insert the SD card in the Pi 5 yet, continue to the next step.
If you do the flashing on a Windows computer, you may see many file explorer windows and error messages pop up when you insert the SD card and when you finish flashing. Those are expected, and you can safely close the file explorer windows and dismiss the error messages. However, if Windows asks you to format the SD card through a popup dialog box, close the message through the “Cancel” button and do not click the “Format Disk” button.
2. Set up system utilities
If the flash was successful, insert the SD card into your laptop, you should see a folder named “system-boot” or something similar.
Find the file mbot_config.txt on this volume and modify it as follows:
- Set
mbot_hostnamefollowing this format:mbot-<section>-<team#>-<unique_name>- For example: if you are in the AM section team 6, and your unique_name is johndoe, you should name the robot as
mbot-AM-team6-johndoe
- For example: if you are in the AM section team 6, and your unique_name is johndoe, you should name the robot as
- Enter your home Wi-Fi details for
new_wifi_ssidandnew_wifi_passwordif you intend to use it at home later. - Leave all other variables unchanged.
Then save the file. Now you can eject the SD card.
3. Boot the Pi5
-
Insert the SD card into your Pi5. The SD card slot is located on the bottom on the side opposite the USB ports.
- Turn on the power bank and ensure that the power cables are connected as per the assembly guide.
-
Wait for about 1 minute until the OLED screen lights up like the image below, where the IP should be something like
192.168.X.Xmeaning it is part of a local network and not directly accessible from the public internet. Once you see this, you can proceed to the next step.
4.1 Connect to the Internet on Campus
Video Demo:
-
Connect to the MBot’s local access point. See the instructions on the official MBot website here under the “Connecting to the MBot’s Access Point” section.
- Use NoMachine to connect to MBot. Follow the instructions on the official MBot website here.
- At the second step, you can:
- Either eneter the numeric IP address on the OLED screen.
- Or enter
<MBOT-HOSTNAME>.locallike in the video demo.
- Note: NoMachine can be SLOW so please be PATIENT. In the video demo below, we reopen NoMachine a few times due to delays. If you feel it’s taking too long, you can try reopening the connection as well. you will eventually get through.
- At the second step, you can:
- Connect the MBot to the Internet. Open a terminal in the NoMachine desktop and run the following commands to connect the MBot to the Internet:
cd ~ ./SecureW2_JoinNow.run -
When prompted for your unique name and password, use the 550 course credentials, it will be distributed during lab. Avoid using your own UM credentials for your privacy safety. You will be disconnected from the NoMachine session, but that is normal.
- After entering your credentials, NoMachine will disconnect during the process. Close the NoMachine window and wait for about 1 minute. Check the OLED screen to see if the IP address has changed from
192.168.X.Xto a different one. This indicates that the MBot has successfully connected to the Internet.- If the OLED screen says “IP Not Found” or “Error” and has been that way for over two minutes, you aren’t connected to the network, you might have typo when input the UM account password, find GSIs and ask to connect to an external monitor.
4.2 Connect to the Internet at Home
-
Ensure the
new_wifi_ssidandnew_wifi_passwordare correctly set in thembot_config.txtfile (check for any typos). They should be your home wifi name, and home wifi password. -
Start the MBot, wait for about 1~2 minute, please be patient. You may hear the fan start a couple of times, and eventually, the OLED screen will display the MBot’s IP address (since you are at home, the IP be
192.168.x.xis normal unlike on campus), meaning the mbot is connected to your home Wi-Fi.
If you have successfully connected your MBot to MWireless or your home Wi-Fi, you can use its IP address to remotely access the MBot. From now on, you can always find the IP address on the OLED screen. Proceed to the next step for more details.
5. Remote Access
At this point, your laptop functions only as a gateway for the SSH connection to your MBot. All programming is executed on the MBot, not on your laptop. When this guide later refers to opening a terminal, it means using the VS Code terminal to access your MBot, unless stated otherwise.
To access the mbot, your laptop and the MBot must always be on the same network. And there are 2 options to connect:
Username: mbot
Password: i<3robots!
6. Change your mbot’s password
For mbot network security, we encourage you to change your password once you have set up your mbot. The default password is i<3robots!, which everyone uses. You should set your password to the default password followed by your unique name. Here’s how to change your mbot’s password:
- Open a VSCode terminal on your laptop.
- Enter this command:
passwd. You will be prompted to enter your current password. - Next, you will be asked to enter your new password and retype it to confirm.
- If the passwords match, you will see a message indicating that your password has been updated successfully.
The output will look like this:
mbot@mbot-0018-shaw:~ $ passwd
Changing password for mbot.
Current password:
New password:
Retype new password:
passwd: password updated successfully
Flash MBot firmware
In this session, we are going to work on setup of the Control Board.
1. Download the Firmware Files
- Go to the GitLab botlab_uf2 repository.
- Clone the repository to home directory.
cd ~ git clone https://gitlab.eecs.umich.edu/rob550-f25/botlab_uf2.git
2. Calibrate the MBot and flash the firmware
In this step, we are going to flash the calibration script onto the Pico to calibrate it and then flash the firmware.
- Place the MBot on the floor in a spot with at least 2 feet of clear space around the robot, preferably on the same type of surface you plan to use it on.
- First, flash the calibration file to calibrate your MBot.
cd ~/botlab_uf2 sudo mbot-upload-firmware flash mbot_calibrate_classic_v1.1.1.uf2Expected output:
$ sudo mbot-upload-firmware flash mbot_calibrate_classic_v1.1.1.uf2 [sudo] password for mbot: Detected Raspberry Pi 5, entering flash mode... Flashing action for mbot_calibrate_classic_v1.1.1.uf2... Loading into Flash: [==============================] 100% The device was rebooted into application mode.Here is a video showing the expected calibration routine:
- Allow the Pico to finish its calibration routine without interference. The calibration script will save the parameters onto the Pico’s memory.
- Then, you can flash the firmware that will run on the Pico during operation.
sudo mbot-upload-firmware flash mbot_classic_ros_v1.1.1.uf2
3. Using Minicom to verify
Minicom is a program designed for serial communication that connects devices to a Linux PC via serial ports, we will use Minicom to read the pico printouts during the flash process.
- After flashing the firmware to the Pico, run the following command to start minicom
sudo minicom -D /dev/ttyACM0 -b 115200You should see output like this:
|-----------------------------------------------| | ANALOG | | AIN 0 | AIN 1 | AIN 2 | BATT (V) | |-----------|-----------|-----------|-----------| | 0.0088 | 0.0095 | 0.3743 | 10.4993 | |-----------------------| | ENCODERS | | ENC L | ENC R | |-----------|-----------| | 1 | -1 | |-----------------------------------| | IMU | | ROLL | PITCH | YAW | |-----------|-----------|-----------| | -0.1026 | 0.0616 | 0.0044 | |-----------------------| | MOTOR | | MOT L | MOT R | |-----------|-----------| | 0.0000 | 0.0000 | |-----------------------------------| | ODOMETRY | | X | Y | THETA | |-----------|-----------|-----------| | 0.0000 | 0.0000 | 0.0000 | |-----------------------------------|- Successful Firmware Flashing: After flashing the firmware successfully, Minicom will display a table, showing the encoder counts, IMU values, and more. Manually turning the wheel will update the encoder counts in the Minicom terminal.
- Unsuccessful Firmware Flashing: If the firmware doesn’t flash correctly, repeat the calibration and firmware flashing steps. This time, open a second terminal window with Minicom running to monitor its outputs for troubleshooting.
- To exit Minicom, press
CTRL-A, then pressX, then pressEnterto quit.
Drive the mbot
Run the following command in the VSCode terminal:
ros2 run teleop_twist_keyboard teleop_twist_keyboard
- Press
xa few times to reduce the linear speed to 0.2, so the robot doesn’t tip over. - Use your keyboard to drive the robot. As shown in the terminal:
i= forward,= backwardj= turn leftl= turn right
If you’ve successfully driven your robot around, your control board setup is complete!
Setup mbot_ws
- Fork the mbot_ws code to your group, and clone it to your mbot home directory.
cd ~ mkdir mbot_ws cd ~/mbot_ws git clone --recurse-submodules your_group_url src- The repository is called
mbot_ros2_ws, but here we clone it into~/mbot_ws/src, the repo’s name is irrelevant.
- The repository is called
- Update the package lists, then reboot the mbot.
sudo apt update - Run the following commands:
cd ~/mbot_ws # install ros dependencies rosdep install -y --from-paths src --ignore-src --rosdistro $ROS_DISTRO --skip-keys=libcamera # build the packages colcon build --symlink-install # source the env echo "source $PWD/install/local_setup.bash" >> ~/.bashrc source install/local_setup.bash- There might be warnings after running colcon build from sllidar_ros2 package, it is normal, if you re-run the command the warnings will be gone.
Test Camera
Test your camera by going through the following steps in order. If any of the steps produce unexpected results, contact the GSIs for assistance.
- To test if camera is detected, run this in the VSCode terminal:
rpicam-hello- If the terminal didn’t say “ERROR: ** no cameras available **”, your camera is detected. Everything is good, use
ctrl+Cto quit.
- If the terminal didn’t say “ERROR: ** no cameras available **”, your camera is detected. Everything is good, use
- To test if camera is working, run:
cd ~ rpicam-still -t 1 -o test.jpg- This will take a photo and save it in the home directory, you can use VSCode to check the photo. The photo will be upside-down, that’s expected.
- To test if camera ROS driver is working, run the following in the VSCode terminal:
# bring up the camera node and flip the image ros2 run camera_ros camera_node --ros-args \ -p orientation:=180 \ -p width:=640 -p height:=480 \ -p format:=BGR888- Ignore the errors about calibration files.
- You can visualize the camera view in rqt on NoMachine desktop. Run the following in the NoMachine Terminal:
ros2 run rqt_image_view rqt_image_view - Select the image topic
/camera/image_raw
Test LiDAR
- Run the following in the VSCode terminal:
ros2 launch mbot_bringup mbot_bringup.launch.py- This will bring up the lidar driver, the robot description for visualization, and the static tf.
- Run the following in the NoMachine Terminal:
ros2 launch mbot_bringup mbot_viz.launch.pyYou should see the rviz with the robot model and the LiDAR scan show up.
If you have successfully completed both tests, your MBot setup is complete, which means Checkpoint 0 is finished. Make sure everything is working properly before the lab starts Checkpoint 1.