Troubleshooting and help
Each problem here has a cause and a fix. If your problem is not here, write to support: mobot.dz/en/support.
Help: my robot is broken, stuck or not working
Section titled “Help: my robot is broken, stuck or not working”The causes on this page are things like a cable, the robot’s mode, a name in your program or a setting. Find what you see:
- The computer cannot find the robot. See No port appears.
- I pressed Run or Save and nothing happens. See I saved my program and nothing happens.
- My program stops and shows an error message. See Python errors.
- The robot is stuck: it keeps moving and will not stop. See The robot keeps moving after my program ended and The robot did not stop.
- The wheels turn the wrong way in the app. See Wheels turn the wrong way in the app.
- A light on the Smart Home does not light. See
home.led1orhome.led2shows no light. - Flashing fails. See Flashing.
Connecting
Section titled “Connecting”No port appears
Section titled “No port appears”Cause. The USB cable carries power but no data, or, on Windows, the driver for the board’s USB chip is missing. A driver is a small program that lets Windows use a piece of hardware. The USB chip is the small chip on the board that lets the computer talk to it over USB.
Fix.
- Use a data USB cable. A charge-only cable powers the board but carries no data.
- On Windows, install the driver for your board’s chip, then reboot: CP210x, CH340 or FTDI.
- Open Device Manager and look under Ports (COM & LPT). A device under Other devices with a yellow warning sign means the driver is missing.
- Press Refresh in the port picker.
See Connect your robot.
“Web Serial is not available in this browser”
Section titled ““Web Serial is not available in this browser””Cause. The web IDE and the flash tool talk to the robot through Web Serial. Web Serial is the part of a browser that lets a web page talk to a USB device. Only Chromium-based browsers have it.
Fix. Use Chrome or Edge. Or install the desktop MoBot IDE.
MoBot Blocks says “This phone can’t talk over a cable”
Section titled “MoBot Blocks says “This phone can’t talk over a cable””Cause. Some phones and tablets cannot send anything out through their USB socket.
Fix. Your blocks are safe. To send them to the robot, use a different phone or tablet, or a computer.
MoBot Blocks says “No robot plugged in”, or asks “Android needs your OK”
Section titled “MoBot Blocks says “No robot plugged in”, or asks “Android needs your OK””Cause. The robot is not plugged in or switched on. Most phones need a small USB adapter (an OTG adapter) between the cable and the phone. Or Android has not yet been asked whether MoBot Blocks may use the cable.
Fix. Plug the robot into the phone, switch it on and tap Look again. When Android asks, tap Allow and connect, then OK. Tick the box in Android’s window so that it stops asking.
The MoBot app takes the robot away
Section titled “The MoBot app takes the robot away”Cause. The MoBot app connects to the robot over Bluetooth by itself and can take the robot in the middle of a run.
Fix. In MoBot Blocks, tap Ask it to wait on the connect screen. Tap Let it go when you are done.
“The robot did not answer”
Section titled ““The robot did not answer””The IDE says: “The robot did not answer. If it is in one of the app’s modes, choose Programmable in the MoBot app, then try again. Otherwise press Stop.”
Cause. The robot is busy running one of the app’s modes, or a program. Firmware 2.0.0 cannot be taken from the computer while it is in one of the app’s modes.
Fix. Do what the message says. Choose Programmable in the MoBot app, or press Stop in the IDE.
The file list says “Press Stop to see the robot’s files”
Section titled “The file list says “Press Stop to see the robot’s files””Cause. The robot is running a mode or a program. The IDE never stops a mode just to show the files.
Fix. Press Stop.
My program does not run
Section titled “My program does not run”I saved my program and nothing happens
Section titled “I saved my program and nothing happens”Cause. A program runs only in Programmable mode. A new Mini starts in Manual mode. A Smart Car that was set to another mode in the app is not in Programmable either. When the robot starts in another mode and has a main.py, it prints: [MOBOT] The robot is in ... mode, so your program is not running. Choose Programmable in the MoBot app.
Fix. Save or run from the IDE and answer Switch to Programmable when it asks, or choose the Programmable tile in the app. See Modes and programs.
“Could not set the robot to Programmable”
Section titled ““Could not set the robot to Programmable””Cause. The robot did not confirm the mode change.
Fix. The IDE says it: “Choose Programmable in the MoBot app, then try again.”
“Could not read the robot’s mode”
Section titled ““Could not read the robot’s mode””Cause. The IDE saved your program but could not read the robot’s mode.
Fix. The IDE says: “If your program does not start, choose Programmable in the MoBot app.”
The Mini does nothing after I save the example
Section titled “The Mini does nothing after I save the example”Cause. The Mini is in Manual mode (Manual driving in the app), so it never reached your program. The program is fine.
Fix. Set the Mini to Programmable, once. The Mini remembers it, and every reset after that runs your main.py. To take the Mini back to the app’s modes, pick any other mode in the app.
Python errors
Section titled “Python errors”NameError: name 'robot' isn't defined, or name 'mobotROBOTICS' isn't defined
Section titled “NameError: name 'robot' isn't defined, or name 'mobotROBOTICS' isn't defined”Cause. The program uses the names of the other firmware. A 3.0 robot has robot and home. A 2.x robot has mobotROBOTICS, mobotMINI and mobotIOT. The IDE adds a tip under the error, for example: Tip: On firmware 3.0, mobotROBOTICS is called robot.
Fix. Use the names of your robot’s firmware. The IDE can offer to rename them for you, with the button Show the new names. See Firmware versions and the name map.
NameError: name 'robot' isn't defined in a file I wrote myself
Section titled “NameError: name 'robot' isn't defined in a file I wrote myself”Cause. Only main.py gets the name robot for free. Your other files do not.
Fix. Ask for the robot at the top of the file: from smart_car import robot on the Smart Car, from smart_car_mini import robot on the Mini, from smart_home import home on the Smart Home.
ImportError: no module named '...'
Section titled “ImportError: no module named '...'”Cause. Your project has more than one file, and one of them is not on the robot. Save puts only the tab you are looking at on the robot. The error names the file you forgot.
Fix. Click each tab and press Save. Save main.py last.
AttributeError: 'NoneType' object has no attribute '...'
Section titled “AttributeError: 'NoneType' object has no attribute '...'”Cause. A part of the robot is None. Either you have not switched it on yet, or it did not start.
Fix. Servos and joysticks on the Smart Car need robot.enable_servos() and robot.enable_joysticks(). The Mini’s distance sensor and line sensor need robot.enable_distance_sensor() and robot.enable_line_sensor(). Read the lines the robot printed when it started. A part that did not start has a line such as Left motor init error:. On the early L298N Smart Car, robot.battery is None because that board has no battery sensor. See The robot object.
A part stops working when I switch on another one
Section titled “A part stops working when I switch on another one”Cause. Some parts use the same pins.
- Smart Car: the five line-following eyes share pins with the joysticks and with servo 1.
- Mini: the distance sensor and the line sensor share two pins.
Fix. Choose one of the two.
home.led1 or home.led2 shows no light on the Smart Home
Section titled “home.led1 or home.led2 shows no light on the Smart Home”Cause. The current Smart Home board has no LED 1 and no LED 2. The firmware still has home.led1 and home.led2, so a program that uses them runs without an error, but there is no light for them to switch on. led1 also shares its pin with the three-digit number display.
Fix. Use the colour lamp. For example, home.rgb_led.set_color(255, 0, 0) lights it red. See the Smart Home page.
The compass has no heading
Section titled “The compass has no heading”Cause. The compass needs a calibration, once for each robot. The result is kept in the file compass_cal.json. Without it, the app shows the heading as unavailable.
Fix. Call robot.compass.calibrate() and turn the robot slowly all the way round. robot.compass.is_calibrated() tells you when it is done.
Stopping
Section titled “Stopping”The robot keeps moving after my program ended
Section titled “The robot keeps moving after my program ended”Cause. On firmware 3.0.1 and later, a program that ends by itself leaves the robot as it set it. On the Smart Home, nothing switches outputs off when a program ends.
Fix. Press Stop in the IDE. Or choose another mode in the app, or switch the robot off. In your program, end with stop() on both wheels and off() on the lights you turned on. See Stopping and leaving outputs.
“The robot did not stop. Press Stop again to restart it.”
Section titled ““The robot did not stop. Press Stop again to restart it.””Cause. Your program swallowed the interrupt, for example with a bare except: around a loop. A bare except: is an except line with no error name after it. It catches every error, and the stop signal too. Or the robot is in one of the app’s modes on firmware 2.0.0, which cannot be stopped from the computer.
Fix. Press Stop again within 30 seconds. The IDE restarts the robot. It plays the start-up sound, and the phone loses its Bluetooth connection. If the robot still moves, switch it off. On firmware 2.0.0, choose Programmable in the MoBot app, or update the robot.
The app asks “A computer is using this robot”
Section titled “The app asks “A computer is using this robot””Cause. You stopped the robot from a computer. The robot waits at the Python prompt until the computer gives it back.
Fix. If you set a mode from the phone now, the robot restarts into it. Or disconnect the IDE first. A robot that was in one of the app’s modes goes back to that mode.
The robot restarts when I choose a mode while my program runs
Section titled “The robot restarts when I choose a mode while my program runs”Cause. Your program did not stop within one second of the request, or it left a thread running. A thread is a piece of code that runs at the same time as the rest of your program.
Fix. Do not swallow the interrupt, and do not leave threads running. See Modes and programs.
Wheels turn the wrong way in the app
Section titled “Wheels turn the wrong way in the app”Cause. In the app’s Kit Settings, Invert left and the left motor speed are meant for the left wheel. On the Mini, before firmware 3.0.2, they turned the right wheel. On the Smart Car they were swapped too. The Smart Car fix was made later on the same day as the first build numbered 2.1.0, and the version number stayed 2.1.0. So a Smart Car that says 2.1.0 may still have the swap.
Fix. Update the robot to firmware 3.0.2. That is the sure fix, on the Smart Car and on the Mini. See Flashing firmware and the changelog. A program is not affected: left_motor and right_motor are the left and the right wheel.
Flashing
Section titled “Flashing”See Flashing firmware for the steps. These are the messages the flash tool gives.
| Message | Fix |
|---|---|
| Could not detect the chip on your board | If your board has a button marked BOOT, hold it while you press Connect, then let it go. This is the flash tool’s own advice. |
| No serial port was selected | Connect your board with USB and press Connect to pick it. |
| The serial port is already in use | Close any other program that uses the port, such as the Arduino IDE or a serial monitor, and try again. |
| Failed to connect to the device | Make sure the USB cable carries data, not only power, and try again. |
| The detected chip does not match the expected firmware target | Make sure you picked the right product for your board. |
| Failed to download the firmware binary | Check your internet connection and try again. |
| The downloaded firmware failed integrity verification | Try again. If it keeps failing, contact support. |
| Failed to erase the device flash memory, or Failed to write firmware to the device | Unplug the board, plug it in again and try again. Do not unplug it during flashing. |
| The device was disconnected during flashing | Reconnect the board and try again. Make sure the cable is secure. |
| Firmware verification failed after writing | Flash again. If it keeps failing, the flash memory may be damaged. |
| The operation timed out | Unplug the board, plug it in again and try again. |
| Browser Not Supported, or Your browser does not support Web Serial API | Use Chrome or Edge. |
| No firmware is available for this product | Contact your administrator to make sure firmware has been assigned. |
MoBot Flash erases the whole memory. After it, a Smart Home needs its Wi-Fi set up again in the app, and a robot has lost its saved program.