Hi, hoping someone can help me with a Raspberry Pi camera module (model 0V5642) that I’m driving manually from a Pi Pico.
I’m trying to interface the camera by hand, following the pico-spi-cam Python example. What’s happening is weird: I can trigger a capture and read the FIFO length back fine, so the SPI side of things seems alive. But whenever I try to read the framebuffer, it comes back completely full of 0x56 bytes. Every single byte, nothing but 0x56.
So far I’ve tried following the Python code and also the C++ code from various repositories, and I get the same result. The camera has always been a bit intermittent/unstable for me too.
I’d be happy to paste my Python code if someone can tell me what I’m missing. What am I doing wrong here?
Hi, sorry for the late reply, and thanks for the detailed writeup.
Before we dig into the code, let’s rule out the hardware side first, because the symptom you describe (FIFO length reading back fine but the framebuffer content being garbage) is often caused by connection instability.
Two things to check:
Please double-check your hardware connection - make sure every jumper/wire is seated properly and the SPI lines are solid.
Try to make the data cable line as short as possible. Long data cables are a common source of this kind of intermittent, garbage-read behavior.
Shortening the cable and re-seating the connection is usually the first thing to try for instability like this.
If it still misbehaves after that, post your Python code and we’ll take a look at what’s missing.
Okay, update - I got the original problem sorted out. Turns out I was not sending byte 0x3c correctly, so that explains the 0x56 framebuffer. Everything reads back properly now.
But now I’ve hit a new issue with the lens and I’m not sure if this is expected or not.
The camera only works when the lens is screwed very tightly into the camera. The problem is it makes the image super blurry. If I unscrew the lens just a little bit, the image goes black in the host app.
Is that supposed to happen? It seems really odd that the image depends on how tight the lens is.
Good to hear the 0x3c byte fix resolved the framebuffer issue - nice catch.
No, that lens behavior is not normal. The image shouldn’t go black just because you loosen the lens slightly, and you shouldn’t have to crank it down hard to get a picture.
To help us reproduce it, could you record a video demo of the problem? Show the whole sequence: the lens tight (blurry image), then unscrewing it bit by bit until the image goes black, along with whatever is shown in your host app at each point.
Once we have that, we’ll try to test it following your exact steps on our side and see what’s going on.
I followed all the steps in the PICO-SPI-CAM Github repository exactly as shown. Instead of a blurry image, now the image is gone entirely and it’s just a black screen.
Watching the size indicator at the bottom left of the window: when the lens is screwed tightly into the camera, the size reads 320x240 or anything above 0. As soon as I unscrew the lens, that size drops to 0x0, and the black screen changes to a slightly brighter shade of black.
So it’s like the resolution/size itself collapses to zero the moment the lens isn’t fully tight. Platform is still Pi Pico, same camera module.
Thanks, the video and the 320x240 vs 0x0 detail are really useful - that tells us the host app is losing the frame entirely once the lens is loosened, not just degrading the image.
So to summarize where we are:
The original 0x56 framebuffer issue is resolved - it came down to the 0x3c byte not being sent correctly.
The new lens-dependent behavior is confirmed abnormal on our side. It should not require the lens to be screwed in extremely tightly, and loosening it slightly should not drop the size to 0x0 and give a black screen.
At this point we don’t have a fix or workaround for the lens/black-screen issue yet. We’re going to test it following your exact steps (per the PICO-SPI-CAM repo) using your video as the reference, so please keep that setup as-is for now. If we can reproduce it, we’ll follow up here with what we find.