Raspberry Pi, Module 3 Camera

Hello,

My team is trying to add a camera to this years robot. We have a raspberry Pi 4 and we also have raspberry Pi camera module 3 (RSP-CAM-V3-WIDE. We followed the instructions on how to set it all up but when we try and connect we get a

error reading camera config: TypeError: Failed to fetch

I’ve looked to see where to get the config information but can’t find it. I’m under the assumption this is because it is not a USB camera. We are running robotpy on our roborio, though for now we are trying to connect without the roborio directly connecting the Pi to our computer via a ethernet connection.

Any help would be appreciated.

Cheers,
Team 601

1 Like

From the sound of it seems like you’re encountering a configuration issue with the Raspberry Pi Camera Module 3 on your Raspberry Pi 4, especially with connecting over Ethernet without the RoboRIO. The error you’re seeing (TypeError: Failed to fetch) suggests that the system might be trying to pull camera settings or config but failing to do so, possibly due to a mismatch in the expected configuration or camera type.

Here are a few steps that you can probably try:

  • Ensure that the camera interface is enabled on the Raspberry Pi. You can check this by running:

sudo raspi-config

Then navigate to Interface Options and ensure the Camera option is enabled.

  • To verify that the Raspberry Pi is detecting the camera, run:

libcamera-hello

or

vcgencmd get_camera

This will let you know if the camera is properly connected and detected.
Also, be sure that all the necessary libraries are installed for the camera module. Run:

sudo apt update
sudo apt install libcamera-apps

This ensures that the required tools are installed to support your camera.

To isolate the issue from RobotPy, you could try capturing images or video directly on the Raspberry Pi using:

libcamera-still -o test.jpg
libcamera-vid -t 10000 -o test.h264

This can help confirm if the issue lies with the camera or with RobotPy’s integration.

Since you’re connecting via Ethernet, ensure that both the Pi and the computer are on the same network. You may need to set up static IP addresses for both devices if they aren’t obtaining addresses automatically.

The error suggests it might be looking for a configuration file. If you’re using software that requires camera config files, check /etc/ or /boot/ directories for configuration files related to libcamera or picamera. For using RobotPy, make sure you have the correct vision libraries and plugins installed. RobotPy works with WPILib, and if you’re trying to get camera feedback for vision processing, check that the cscore and opencv-python libraries are properly installed:

pip install robotpy-cscore opencv-python

Hope this helps :smile: