Hi, hoping someone here can help me out. I bought one of the OV5647 camera modules (the board that looks like the Pi Camera v1) and I cannot get it working on my Raspberry Pi 4. The listing says it works with the Pi 4 but I’m stuck.
My setup:
Raspberry Pi 4, Raspberry Pi OS Bullseye (fresh install, updated)
OV5647 camera module, ribbon cable in the CSI port, seated correctly and the clip is tight
When I run raspistill I get this:
ERROR: the system should be configured for the legacy camera stack
What I’ve already tried:
Looking under Interface Options in the desktop preferences / raspi-config GUI — the camera entry doesn’t even show up, so I can’t enable it there
The command line raspi-config does show the camera entry and it says it’s enabled
Added camera_auto_detect=1 to the config file → no change
Added dtoverlay=ov5647 → no change
Is this camera actually supposed to work on a Pi 4? If it is, what should I be checking to debug this? I’m out of ideas.
Welcome! The error you’re seeing is basically the whole story here. That message comes from raspistill, which is the old tool and only talks to the legacy camera stack. On Bullseye the default is libcamera, so raspistill bails out with exactly that error if the legacy stack isn’t enabled.
A couple of quick things so I can point you the right way:
Does the camera show up with the libcamera tools? Try libcamera-hello --list-cameras, then libcamera-still -o test.jpg.
In /boot/config.txt, do you currently have BOTH camera_auto_detect=1 and dtoverlay=ov5647 in there at the same time? Those two can fight each other — camera_auto_detect is meant to detect the sensor for you, so if you also force an overlay you can end up in a strange state.
Also worth knowing up front: libcamera and raspistill use two different camera stacks and you can’t have both active at once. So if the libcamera tools work, raspistill won’t, and vice versa.
Thanks for the reply. So libcamera-hello and libcamera-still -o test.jpg both work fine — I get a preview and a photo out of it. So the camera itself seems OK at least.
But raspistill still throws the legacy stack error. And a couple of other apps I wanted to use don’t see the camera either (mostly the older python picamera stuff).
In config.txt I did have both lines:
camera_auto_detect=1
dtoverlay=ov5647
I removed the overlay line and rebooted, but I still get the same error from raspistill. That’s the part that’s confusing me. Anything else I should be looking at?
Good — that confirms the hardware is fine. If libcamera sees the sensor and captures frames, there’s nothing wrong with the camera or the cable.
So here’s the root cause: raspistill is the legacy command. It only talks to the legacy camera stack (the old MMAL/bcm2835-v4l2 side). libcamera-hello and libcamera-still talk to the newer libcamera stack. You can’t use both at the same time — one stack has to be selected globally, which is exactly why you’re getting “the system should be configured for the legacy camera stack”.
Two things to sort out in your config:
In /boot/config.txt, comment out or delete the overlay line, so it looks like this:
[all]
dtoverlay=ov5647
camera_auto_detect=1
Make sure the ov5647 overlay isn’t being forced on top of auto-detect. camera_auto_detect=1 on its own handles the OV5647 fine on a Pi 4.
Then enable the legacy camera stack, because that’s what raspistill needs. Run sudo raspi-config → Interface Options → Legacy Camera → Enable, then reboot. (The desktop preferences tool is the one that doesn’t always list the camera entry — the command line raspi-config is the one you want, and you already saw the entry there.)
One heads up: once the legacy stack is enabled, the libcamera tools will stop working. That’s expected — you’re deliberately switching stacks so raspistill can take over.
OK that makes sense now. Question before I switch over — is there any way to keep libcamera working AND have raspistill work? Half the tutorials I’ve been following use raspistill and the other half use libcamera-hello and I didn’t realise they were two different stacks.
Also, if I enable the legacy camera in raspi-config, does the camera_auto_detect=1 line still matter, or should I remove that too?
Nope, unfortunately there’s no way to have both at once. libcamera and raspistill are mutually exclusive — it’s a global stack selection, not a per-app thing. You pick one:
Modern route: leave the legacy camera disabled, keep camera_auto_detect=1, and use libcamera-still / libcamera-hello (and picamera2 for python).
Legacy route: enable the legacy camera in raspi-config, and use raspistill / the older picamera on that side.
Keep camera_auto_detect=1 in either case — that line just lets the firmware auto-detect the sensor instead of you hardcoding an overlay. What you don’t want is dtoverlay=ov5647 sitting under [all] while auto-detect is also enabled; those can conflict, so leave the overlay commented out.
Alright, thanks for sticking with me on this. I’m not fully out of the woods yet though. I enabled Legacy Camera in sudo raspi-config, went back and confirmed dtoverlay=ov5647 is commented out, rebooted, and now raspistill at least gets past the ‘legacy camera stack’ error, but a few of my other apps still don’t see the camera.
Is there anything else in the config file worth checking? The listing for this camera says it works with a Pi 4 out of the box, so I’d like to actually understand what I’m doing wrong. I’d really appreciate a fast reply, I’ve been fighting this for days.
Setup again for reference:
Raspberry Pi 4, running Bullseye
OV5647 camera module, cable seated correctly and tight
config file has camera_auto_detect=1 and the ov5647 overlay commented out
original error was: ERROR: the system should be configured for the legacy camera stack
Sorry for the slow turnaround — I actually replied to your earlier post too, so check your private messages in case the notification didn’t reach you.
Where things stand: since libcamera-hello and libcamera-still can capture fine, your camera module and cable are working normally — the hardware isn’t faulty. The whole issue was a camera stack mismatch.
Recap of the fix:
Under [all] in /boot/config.txt, delete (or comment out) the dtoverlay=ov5647 entry so it looks like:
[all]
dtoverlay=ov5647
camera_auto_detect=1
Enable the legacy camera stack with sudo raspi-config → Interface Options → Legacy Camera → Enable, then reboot.
After that, raspistill will work. Just remember the libcamera commands will stop working in that mode — libcamera and raspistill can’t run at the same time because they use different stacks.
For any app that still doesn’t detect the camera: check whether it’s built for libcamera or for the old raspistill/MMAL side, and make sure it matches whichever stack you’ve enabled. The camera itself works fine on a Pi 4 with camera_auto_detect=1 and the ov5647 overlay left off.