VMware ESXi and vSphere Cluster Management

Enable and Configure a Raspberry Pi Camera with raspi-config

Learn how to connect, enable, detect, and test a Raspberry Pi camera using raspi-config, rpicam tools, libcamera, and version-aware settings.

A Raspberry Pi camera connects through the board's CSI connector. CSI means Camera Serial Interface, the ribbon-cable interface used by official Raspberry Pi Camera Modules and many compatible modules.

This guide separates two situations: older Raspberry Pi OS installations that used an Enable Camera switch in raspi-config, and current Raspberry Pi OS installations that normally detect supported cameras automatically through libcamera and the rpicam-apps tools.

What the camera setting in raspi-config does

raspi-config is the Raspberry Pi OS text-based configuration utility. It provides settings for system options and hardware interfaces, including interfaces such as the camera, display, SSH, and I2C when those settings are exposed by the installed operating-system release.

Historically, the Enable Camera option acted as an on-or-off switch for camera-module support. Selecting the enabled state changed the system configuration so the camera software could use the camera interface. Selecting the disabled state removed or turned off that older support.

On newer Raspberry Pi OS releases, the menu may not contain an Enable Camera entry. It might instead show a Legacy Camera option, or no camera option at all. Current supported cameras generally use automatic detection and the libcamera-based stack, so a separate enable step is normally unnecessary.

Prerequisites and safe hardware setup

  • Use a Raspberry Pi model with a compatible CSI camera connector.
  • Use an official Raspberry Pi Camera Module or a compatible module supported by your Raspberry Pi OS camera stack.
  • Install an up-to-date Raspberry Pi OS release before troubleshooting software.
  • Shut the Raspberry Pi down completely and disconnect power before connecting, removing, or reseating a ribbon cable.
  • Identify the CSI camera connector. Boards with both camera and display connectors may have a second connector for the display interface; the two connectors are not interchangeable on every board.

Open the connector latch, insert the ribbon cable fully, and close the latch to hold it in place. The exposed contacts on the ribbon must face the correct direction for both the Raspberry Pi connector and the camera-board connector. The exact orientation depends on the board and module, so check the hardware markings or its current documentation rather than relying on the cable color alone.

A reversed cable, a cable inserted only part way, or a cable connected to the wrong socket can prevent detection. Never force the latch or cable.

Check which camera software stack you have

The legacy camera stack is the older Raspberry Pi camera software and driver approach used by previous Raspberry Pi OS releases. The current stack is based on libcamera, a Linux camera framework that manages camera hardware and exposes modern camera applications.

Current Raspberry Pi OS releases generally provide rpicam-apps, a collection of command-line camera programs. Common tools include rpicam-hello for a preview and rpicam-still for still images. Some earlier libcamera-based releases use the older command names libcamera-hello and related tools.

Raspberry Pi OS generationTypical raspi-config behaviorPreferred camera stackRecommended test utilityNotes
Older Raspberry Pi OSMay provide an Enable Camera switch under an interface or camera menuLegacy stack or an early transition stackThe test command supplied by that releaseEnabling the camera could also affect the GPU memory split.
Earlier libcamera-based releasesMay show no Enable Camera switchlibcameralibcamera-helloSome tutorials use command names from this period.
Current Raspberry Pi OSUsually relies on automatic detection; a Legacy Camera entry may be available for compatibilitylibcamera with rpicam-appsrpicam-hello or rpicam-stillLegacy mode is normally unnecessary for new applications.

Enable the camera interactively on an older installation

  1. Power down the Raspberry Pi and connect the camera to the CSI connector.
  2. Boot Raspberry Pi OS and open a terminal.
  3. Start the configuration utility with administrator privileges:
    sudo raspi-config
  4. Use the arrow keys and Enter to open the interface, camera, or similarly named menu available on your release.
  5. Select the camera option. If an Enable Camera setting is present, choose the enabled state.
  6. Choose the finish option. Accept the reboot prompt if one appears. If no prompt appears, reboot manually:
    sudo reboot

After the reboot, run the camera test appropriate for that operating-system generation. The old menu wording is not evidence that the current rpicam tools are installed, so test with a command that exists on your system.

Use a camera on current Raspberry Pi OS

For a current Raspberry Pi OS installation, connect a supported CSI camera while the board is powered off, boot normally, and allow the modern camera stack to detect it. In most cases, you should not select a Legacy Camera option.

First try a preview:

rpicam-hello

A successful test normally opens a preview window briefly or displays camera initialization and stream information, depending on whether the system has a graphical desktop and how the command is configured.

You can also capture a still image:

rpicam-still -o image.jpg

A successful capture creates image.jpg in the current directory. If your installation uses the earlier libcamera command names, try:

libcamera-hello

A legacy command or old application may fail even when the camera is physically connected because it expects the older software stack. Prefer rpicam/libcamera applications on current Raspberry Pi OS.

GPU memory allocation and the historical camera setting

The GPU memory split is the amount of system RAM reserved for the graphics processor instead of general-purpose CPU processes. On older Raspberry Pi camera configurations, enabling camera support was historically associated with reserving at least 128 MB for the GPU.

That reservation has a cost: RAM assigned to the GPU is unavailable to normal programs. A larger GPU allocation can therefore leave less memory for applications, services, and the operating system.

Memory handling depends on the Raspberry Pi model and the Raspberry Pi OS generation. Modern camera setups do not automatically require manually adding a gpu_mem line, and changing it without a specific reason can reduce available system memory.

Review or adjust the GPU memory split only when the installed camera stack or workload explicitly requires it, such as a version-specific legacy application. A historical setting might look like this:

gpu_mem=128

Do not copy this setting blindly into a modern installation. If a manual review is necessary, inspect the boot configuration file used by your release. Newer systems commonly use /boot/firmware/config.txt; older systems commonly use /boot/config.txt.

grep -E '^(camera_auto_detect|gpu_mem|start_x)' /boot/firmware/config.txt

If that file does not exist, repeat the check with the older path:

grep -E '^(camera_auto_detect|gpu_mem|start_x)' /boot/config.txt

The modern setting camera_auto_detect=1 is commonly enabled by default. Avoid adding duplicate or conflicting entries. A boot configuration change normally requires a reboot.

Confirm detection and operation

Use a preview or still capture as the primary check. Detection alone is not enough: a successful capture confirms that the software can initialize the camera and produce an image.

PurposeCommandExpected successful resultApplicable system generation
Open a modern preview testrpicam-helloA preview opens, or camera initialization and stream information are reported.Current Raspberry Pi OS with rpicam-apps
Capture a still imagerpicam-still -o image.jpgAn image file named image.jpg is created.Current Raspberry Pi OS with rpicam-apps
Open an earlier libcamera preview testlibcamera-helloA preview opens or the camera stream initializes.Some earlier libcamera-based releases
Review camera-related boot settingsgrep -E '^(camera_auto_detect|gpu_mem|start_x)' /boot/firmware/config.txtMatching configuration lines are displayed, if present.Newer Raspberry Pi OS; use /boot/config.txt on older systems

When a test fails, use device information and logs as secondary checks. For example, review recent kernel messages with:

dmesg | grep -iE 'camera|csi|imx|libcamera'

The exact log messages depend on the camera sensor, kernel, and operating-system release. Absence of an obvious message does not by itself prove that the hardware is defective.

Disable historical camera support

If your older Raspberry Pi OS installation still provides the historical camera setting, open the utility again:

sudo raspi-config
  1. Open the applicable interface or camera menu.
  2. Select the camera setting.
  3. Choose the disabled state.
  4. Finish the utility and reboot when prompted, or run sudo reboot.

Disabling may be useful on an older installation when the camera is no longer used, when unused legacy configuration should be removed, or when resources need to be reclaimed. Afterward, review any manually configured GPU memory setting and make sure it still suits the Raspberry Pi model and workload. Disabling a menu item does not necessarily undo every manual edit made to a boot configuration file.

Troubleshooting camera problems

SymptomLikely causeCheck or corrective action
No camera menu is present in raspi-configThe release uses automatic detection, or it exposes only a Legacy Camera option.Check the OS version and try rpicam-hello or libcamera-hello. Enable legacy mode only when an older application explicitly requires it.
The camera is not detectedThe ribbon cable is loose, reversed, connected to the wrong connector, or the module is unsupported.Shut down fully, disconnect power, inspect cable orientation and the latch, reconnect to the CSI port, and test again.
A legacy command does not exist or failsThe system uses the current rpicam/libcamera stack, or the tutorial targets an older release.Use the modern rpicam equivalent and follow documentation matched to the installed Raspberry Pi OS version.
Less memory is available after an older camera configuration was enabledA larger GPU memory allocation has been reserved.Review gpu_mem in the correct boot configuration file and choose a version-appropriate allocation.
The camera is detected but preview is blank or capture failsAn incompatible camera mode, insufficient power, unsupported third-party hardware, or a software-stack mismatch.Update Raspberry Pi OS packages, test with a supported camera and a basic rpicam command, and review logs.

Version-aware checklist

  • Identify the Raspberry Pi OS generation before following a camera tutorial.
  • Use raspi-config to enable the camera only when the installed release actually provides the historical camera switch and your software requires it.
  • Use automatic detection and rpicam/libcamera tools on current Raspberry Pi OS installations.
  • Treat a Legacy Camera option as a compatibility feature for older software, not as the preferred default.
  • Check whether your release uses /boot/firmware/config.txt or /boot/config.txt before inspecting boot settings.
  • Reboot after changing interface or boot configuration settings.

For a concise version-specific procedure, return to the Raspberry Pi camera raspi-config guide and match the instructions to the tools and menus present on your system.