Hey everyone, I’m stuck trying to get my ArduCam 8MP IMX219 (B039001) working on a Raspberry Pi Zero W. The ArduCam v2.2 preview just won’t connect or display anything. When I run libcamera-hello it comes straight back with “Preview window unavailable”. I’ve gone through a couple of the Arducam quick start guides and tried a bunch of config changes, but no luck so far. Has anyone run into this before?
Hi there, let’s dig in. Can you give a bit more detail on your setup? Which OS image are you running, what does your /boot/config.txt currently look like, and which steps/guides have you already tried? That way I won’t ask you to redo things you’ve already covered.
Sure. Hardware is a Pi Zero W, OS is Raspberry Pi OS Legacy 32-bit Debian bullseye (2024-03-12), and libcamera is v0.0.0+4367-ad9428b4. I followed the Arducam native camera quick start guide and the IMX219 Motorized Focus Camera guide. In /boot/config.txt I added dtoverlay=imx2019 under [all], then tried dtoverlay=imx2019, vcm, and removed camera_auto_detect=1. I ran sudo apt-get update, sudo apt-get dist-upgrade, and rebooted. Still the same error, and the script just keeps returning unicam format options endlessly.
I can see at least one problem right away. In your config you wrote dtoverlay=imx2019, but the overlay is actually imx219. That typo would definitely stop the camera from being set up properly. Also, the “, vcm” part is for the motorized/autofocus version of the IMX219. Since you have the standard B039001 module, you can drop that. Try this instead:
sudo nano /boot/config.txt
Add this under the [all] section at the bottom:
dtoverlay=imx219
Then sudo reboot to apply it.
I’ve also sent you a connection reference image in a private message, worth double-checking the ribbon cable orientation on the Zero W while you’re in there.
Okay, I fixed the typo and removed the vcm part, so now it’s just dtoverlay=imx219 under [all]. Rebooted. Still getting “Preview window unavailable”. The camera does seem to be detected now though, because it registers the imx219 and then the unicam format output just keeps going. Not sure what to try next.
That’s progress. Can you run libcamera-hello again and paste the full terminal output here? The whole thing, including the camera registration lines and the fps/exposure lines. That’ll tell us whether the sensor itself is actually streaming.
Here’s the full output:
Preview window unavailable
[0:01:40.357186000] [864] INFO Camera camera_manager.cpp:297 libcamera v0.0.0+4367-ad9428b4
[0:01:41.018363000] [930] WARN RPI vc4.cpp:390 Mismatch between Unicam and CamHelper for embedded data usage!
[0:01:41.033960000] [930] INFO RPI vc4.cpp:444 Registered camera /base/soc/i2c0mux/i2c@1/imx219@10 to Unicam device /dev/media3 and ISP device /dev/media0
[0:01:41.039855000] [930] INFO RPI pipeline_base.cpp:1101 Using configuration file ‘/usr/share/libcamera/pipeline/rpi/vc4/rpi_apps.yaml’
[0:01:41.045436000] [864] INFO Camera camera.cpp:1033 configuring streams: (0) 1640x1232-YUV420
[0:01:41.057240000] [930] INFO RPI vc4.cpp:572 Sensor: /base/soc/i2c0mux/i2c@1/imx219@10 - Selected sensor format: 1640x1232-SBGGR10_1X10 - Selected unicam format: 1640x1232-pBAA
#0 (0.00 fps) exp 12570.00 ag 2.00 dg 1.29
#1 (15.00 fps) exp 12570.00 ag 2.00 dg 1.29
#2 (15.00 fps) exp 12570.00 ag 2.00 dg 1.29
#3 (30.01 fps) exp 16181.00 ag 2.00 dg 1.00
#4 (7.50 fps) exp 16181.00 ag 2.00 dg 1.00
#5 (15.00 fps) exp 16162.00 ag 2.00 dg 1.00
#6 (15.00 fps) exp 16162.00 ag 2.00 dg 1.00
Good news: your camera is actually working. See how the imx219 sensor is registered and the framerate, exposure, ag, and dg values are being reported normally? That means the sensor is streaming fine. The real problem is that very first line: “Preview window unavailable”. So let me ask - how are you connected to this Pi? Are you on SSH by any chance, with no monitor attached to the Zero W?
Yeah, I’m running everything over SSH. There’s no monitor plugged into the Pi at all. I didn’t think that would matter for the camera.
That’s exactly it. When you’re on SSH with no display, there’s nowhere for a local preview window to be drawn, so libcamera-hello fails with “Preview window unavailable” even though the camera itself is fine. The framerate/exposure/ag/dg values in your log confirm the sensor is functioning normally.
For a headless setup, use commands that don’t need a local preview window. For example:
Preview (via Qt preview)
libcamera-still -t 0 --qt-preview
Or just capture an image without any preview
libcamera-still -t 5000 -o test.jpg -n
Try the capture command first and check that test.jpg is a valid image. That’ll confirm the camera is working over SSH.