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:
-
Cloning and building
libcamera -
Cloning and building
rpicam-apps(the new name forlibcamera-apps)
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
-
Ubuntu 24.04 does not currently ship with working
libcamera-appspackages for Raspberry Pi. -
Manual overlay configuration and source builds of
libcameraandrpicam-appsare necessary. -
I2C detection (
i2cdetect -y 10) is a helpful diagnostic step for confirming hardware-level communication with the sensor. -
Permissions (
/dev/video*) require membership in thevideogroup.
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.
Vipin M
Discussions
Become a Hackaday.io Member
Create an account to leave a comment. Already have an account? Log In.