Close

Bringing Up an IMX219 Camera on Raspberry Pi 5 with Ubuntu 24.04

A project log for GestureBot - Computer Vision Robot

A mobile robot that responds to human gestures, facial expressions using real-time pose estimation and gesture recognition & intuitive HRI

vipin-mVipin M 08/04/2025 at 02:290 Comments

Getting a Raspberry Pi camera operational on a freshly installed OS—especially something as new as Ubuntu 24.04 on a Raspberry Pi 5—requires a bit more than just plugging it in. This week, I tackled the bring-up of an IMX219 camera module with that exact setup.

The camera was physically connected to the CAM0 port on the Pi 5, but any attempt to access /dev/video0 resulted in “Invalid argument” errors. Likewise, package installation attempts for libcamera-apps failed with a “Unable to locate package” error, confirming that the expected userland camera utilities were missing from the Ubuntu repositories.

I verified the kernel-side device tree configuration by checking /boot/firmware/config.txt to ensure the correct overlay was in place:

dtoverlay=imx219
camera_auto_detect=1

After confirming that the overlay was applied, I checked the kernel logs with dmesg | grep imx219. The IMX219 driver was clearly probing, but ultimately failed to read the sensor chip ID, throwing I2C error -121. This hinted at a hardware-level issue or missing driver support rather than a simple configuration error.

To eliminate hardware misconnection as a factor, I reseated the ribbon cable, verified pin orientation, and scanned the I2C bus (i2cdetect -y 10) for a response at address 0x10, which remained absent.

With hardware issues ruled out, I moved to software. Ubuntu’s libcamera support is incomplete out of the box, so I followed the official Raspberry Pi instructions for building the full libcamera stack and associated rpicam-apps from source:

This included:

After a successful build, I encountered Permission denied errors when accessing /dev/video*. Adding the user to the video group resolved this:

sudo usermod -a -G video $USER
sudo reboot

Finally, I was able to run:

rpicam-still -o test.jpg

This successfully captured an image, confirming end-to-end camera functionality at the libcamera level.

This bring-up was motivated by a larger goal: using the camera with ROS 2 Jazzy. While I haven't yet integrated it with the camera_ros package by christianrauch, having a functional camera pipeline with libcamera is a prerequisite for ROS-level integration.

Key Takeaways

If you're trying to bring up a CSI camera on Pi 5 with a non-Raspberry Pi OS, be prepared to build the userland stack yourself and validate each layer from hardware to driver to application.

Discussions