Troubleshooting¶
Common problems and how to fix them.
I2C / hardware issues¶
DeviceNotFoundError: No device at I2C address 0x2B on bus 1¶
The robot's microcontroller was not found on the I2C bus.
Checklist:
-
Is I2C enabled?
-
Is the robot powered on? The Raspbot V2 requires its own power supply (batteries or DC barrel jack). The Pi's 5 V USB supply alone is not sufficient.
-
Can the device be detected?
You should see2bat the intersection of row 20, column b. If not, check power and the physical 40-pin header connection.
PermissionError: [Errno 13] Permission denied: '/dev/i2c-1'¶
Your user account does not have access to the I2C device.
Verify with:
Motors don't move (servos/buzzer work fine)¶
The motors need a separate power rail. If the robot is running on USB power from the Pi, the motors will be under-powered.
- Connect the robot's battery pack or a suitable 5-12 V supply.
- Confirm the power switch on the chassis PCB is in the ON position.
Ultrasonic sensor always returns 0¶
- Did you call
enable()first (or use the context manager)? - Is there an object within range? The HC-SR04 has a typical range of 2 cm - 400 cm. At very short distances (< 2 cm) the reading is unreliable.
Line tracker reads all zeros¶
- Check that the sensor array is facing down towards the floor/track.
- Verify adequate lighting -- IR sensors can be confused by bright IR sources.
- Confirm the track is high-contrast (black tape on white/light surface).
- Print the raw byte for debugging:
OLED display¶
ImportError: OLED support requires additional packages¶
Install the optional extra:
OLED display shows nothing after begin()¶
-
Check the I2C address. The default is
0x3C.If it is at0x3D, create the display withOLEDDisplay(i2c_address=0x3D). -
Did you call
refresh()after drawing?
Camera¶
ImportError: Camera support requires opencv-python¶
Install the optional extra:
camera.open() returns False¶
-
Is the camera connected?
-
For Pi Camera Module on Bookworm: ensure the V4L2 driver is configured. See the Camera API reference for details.
-
Is another process using the camera?
RuntimeError: Camera is not open¶
You called read_frame() without calling open() first:
Or use the context manager:
Python / package issues¶
ModuleNotFoundError: No module named 'raspbot'¶
The package is not installed in the active Python environment:
If using a virtual environment, make sure it is activated.
mypy or LSP reports errors on raspbot imports¶
If you are developing on Windows and remoting to the Pi, the LSP server runs on Windows where
smbus2 and luma.oled are not installed.
These are false positives -- the code runs correctly on the Pi.
Ignore them, or add the Pi's site-packages to the LSP's Python path.
Running hardware tests¶
Hardware tests are skipped by default. To run them on the actual robot:
These tests require a Raspbot V2 to be physically connected and powered on.