FAQ/ Troubleshooting

This is place to check for common problems and solutions:

  • Error:
    “picamera.exc.PiCameraMMALError: Failed to enable connection: Out of resources”

Possible solutions:

  1. Cable is not installed correctly. The silver contacts of the ribbon cable to face away from the ethernet port, towards the rear of the donkeycar on the default mount.
  2. Metal screws holding in the camera may be short circuiting the power. Remove all screws holding the camera.
  3. Power supply is not rated for 2A or more and/or your USB cable is too cheap and can’t carry 2A or more. Replace them with known good parts
  4. The camera driver has not been loaded/enabled via raspi-config. the command ls /dev/video0 should show a file. If not, your camera device driver failed to load because it was disabled.
  5. Try installing and using raspicam to take pictures if you don’t think you installed donkey correctly.
    raspistill -o testPic.jpg
  6. The camera module is bad. Swap for another or try with another pi board to cross reference.
1 Like

Error: picamera.exc.PiCameraError: Camera is not enabled. Try running ‘sudo raspi-config’ and ensure that the camera has been enabled.

  1. run sudo raspi-config Make sure that camera is enabled and reboot.
  2. check general camera advice for PiCameraMMALError above.

“ackages/Adafruit_GPIO/I2C.py”, line 114, in write8 self._bus.write_byte_data(self._address, register, value) File “/home/pi/env/lib/python3.5/site-packages/Adafruit_PureIO/smbus.py”, line 256, in write_byte_data self._device.write(data) OSError: [Errno 121] Remote I/O error"

Possible Solutions:

  1. check wiring connection from pi headers to pwm board. brown or black is ground and needs to go on outside edge of pwm board.
  2. check that I2C is enabled in sudo raspi-config
  3. check that user is part of the I2C group. the command groups should list I2C. If not, then `sudo usermod +aG I2C . Reboot, or logout and login.
  4. install i2c tools with sudo apt install i2c-tools. Then run the command i2cdetect -y 1 and make sure to see the number 40 in the grid of address that prints out.
  5. if this happens while driving or after vibration, you need new wires to connect your pwm board to the pi.

Q: can I use camera XYZ?
A: Your best bet is to stick with recommended supported cameras for your platform. Check the hardware guide.

It will depend on the capabilities of your camera, the camera driver, and the resolution you request. There’s quite a lot of variety. As long as the OS can mount your camera to /dev/video0 there’s a good chance we can support it.

To use a USB camera, you can use OpenCV, PyGame, or an experimental V4L wrapper. They each require additional steps to install. Since OpenCV install steps are given for the Pi and Nano, that’s a good first one to try. PyGame can take some effort to install, but I’ve tested that on multiple SBC’s and it works well, but takes some time to setup. V4L currently will work if your camera has a MJPG mode. Other modes require you to parse the output buffer before you get an RGB buffer that is expected by the rest of the components.

Currently the V4L has the fewest dependencies and can compile in resource constrained SBC’s with low ram, so will be a good option when other’s fail. But probably not the default choice at the moment.